Class Telemetry

java.lang.Object
jenkins.telemetry.Telemetry
All Implemented Interfaces:
ExtensionPoint
Direct Known Subclasses:
DistributedBuilds, JavaSystemProperties, OptionalPermissions, SecurityConfiguration, SecuritySystemProperties, StaplerDispatches, Uptime, UserLanguages

public abstract class Telemetry extends Object implements ExtensionPoint
Extension point for collecting JEP-214 telemetry. Implementations should provide a description.jelly file with additional details about their purpose and behavior which will be included in help-usageStatisticsCollected.jelly for UsageStatistics.
Since:
2.143
See Also:
  • Constructor Details

    • Telemetry

      public Telemetry()
  • Method Details

    • getId

      @NonNull public String getId()
      ID of this collector, typically an alphanumeric string (and punctuation). Good IDs are globally unique and human readable (i.e. no UUIDs). For a periodically updated list of all public implementations, see the developer documentation.
      Returns:
      ID of the collector, never null or empty
    • getDisplayName

      @NonNull public abstract String getDisplayName()
      User friendly display name for this telemetry collector, ideally localized.
      Returns:
      display name, never null or empty
    • getStart

      @NonNull public abstract LocalDate getStart()
      Start date for the collection. Will be checked in Jenkins to not collect outside the defined time span. This does not have to be precise enough for time zones to be a consideration.
      Returns:
      collection start date
    • getEnd

      @NonNull public abstract LocalDate getEnd()
      End date for the collection. Will be checked in Jenkins to not collect outside the defined time span. This does not have to be precise enough for time zones to be a consideration.
      Returns:
      collection end date
    • createContent

      @CheckForNull public abstract net.sf.json.JSONObject createContent()
      Returns the content to be sent to the telemetry service. This method is called periodically, once per content submission.
      Returns:
      The JSON payload, or null if no content should be submitted.
    • all

      public static ExtensionList<Telemetry> all()
    • isAnyTrialActive

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static boolean isAnyTrialActive()
    • isDisabled

      public static boolean isDisabled()
      Returns:
      whether to collect telemetry
      Since:
      2.147
    • isActivePeriod

      public boolean isActivePeriod()
      Returns true iff we're in the time period during which this is supposed to collect data.
      Returns:
      true iff we're in the time period during which this is supposed to collect data
      Since:
      2.202
    • buildComponentInformation

      protected final Map<String,String> buildComponentInformation()
      Produces a list of Jenkins core and plugin version numbers to include in telemetry implementations for which this would be relevant.
      Returns:
      a map in a format suitable for a value of createContent()
      Since:
      2.325