Class JenkinsOpenTelemetryPluginConfiguration

java.lang.Object
hudson.model.Descriptor<GlobalConfiguration>
jenkins.model.GlobalConfiguration
io.jenkins.plugins.opentelemetry.JenkinsOpenTelemetryPluginConfiguration
All Implemented Interfaces:
ExtensionPoint, Describable<GlobalConfiguration>, Saveable, Loadable, OnMaster

@Extension(ordinal=2.147483646E9) @Symbol("openTelemetry") public class JenkinsOpenTelemetryPluginConfiguration extends GlobalConfiguration
  • Field Details

    • currentOpenTelemetryConfiguration

      protected transient OpenTelemetryConfiguration currentOpenTelemetryConfiguration
      The previously used configuration. Kept in memory to prevent unneeded reconfigurations.
  • Constructor Details

    • JenkinsOpenTelemetryPluginConfiguration

      @DataBoundConstructor public JenkinsOpenTelemetryPluginConfiguration()
  • Method Details

    • configure

      public boolean configure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject json) throws Descriptor.FormException
      Overrides:
      configure in class GlobalConfiguration
      Throws:
      Descriptor.FormException
    • readResolve

      protected Object readResolve()
    • toOpenTelemetryConfiguration

      @NonNull public OpenTelemetryConfiguration toOpenTelemetryConfiguration()
    • configureOpenTelemetrySdk

      @Initializer(after=SYSTEM_CONFIG_ADAPTED, before=JOB_LOADED) public void configureOpenTelemetrySdk()
      Initialize the Otel SDK, must happen after the plugin has been configured by the standard config and by JCasC JCasC configuration happens during `SYSTEM_CONFIG_ADAPTED` (see `io.jenkins.plugins.casc.ConfigurationAsCode#init()`)
    • sanitizeOtlpEndpoint

      @CheckForNull public String sanitizeOtlpEndpoint(@Nullable String grpcEndpoint)
      Returns:
      null or endpoint URI prefixed by a protocol scheme ("http://", "https://"...)
    • getEndpoint

      @CheckForNull public String getEndpoint()
      Never empty
    • setEndpoint

      @DataBoundSetter public void setEndpoint(String endpoint)
    • getAuthentication

      @NonNull public OtlpAuthentication getAuthentication()
    • setAuthentication

      @DataBoundSetter public void setAuthentication(OtlpAuthentication authentication)
    • getTrustedCertificatesPem

      @CheckForNull public String getTrustedCertificatesPem()
    • setTrustedCertificatesPem

      @DataBoundSetter public void setTrustedCertificatesPem(String trustedCertificatesPem)
    • setObservabilityBackends

      @DataBoundSetter public void setObservabilityBackends(List<ObservabilityBackend> observabilityBackends)
    • getObservabilityBackends

      @NonNull public List<ObservabilityBackend> getObservabilityBackends()
    • getExporterTimeoutMillis

      public Integer getExporterTimeoutMillis()
    • setExporterTimeoutMillis

      @DataBoundSetter public void setExporterTimeoutMillis(Integer exporterTimeoutMillis)
    • getExporterIntervalMillis

      public Integer getExporterIntervalMillis()
    • setExporterIntervalMillis

      @DataBoundSetter public void setExporterIntervalMillis(Integer exporterIntervalMillis)
    • getIgnoredSteps

      public String getIgnoredSteps()
    • setIgnoredSteps

      @DataBoundSetter public void setIgnoredSteps(String ignoredSteps)
    • getStatusUnsetCausesOfInterruption

      public List<String> getStatusUnsetCausesOfInterruption()
    • getDisabledResourceProviders

      public String getDisabledResourceProviders()
    • setDisabledResourceProviders

      @DataBoundSetter public void setDisabledResourceProviders(String disabledResourceProviders)
    • isExportOtelConfigurationAsEnvironmentVariables

      public boolean isExportOtelConfigurationAsEnvironmentVariables()
    • setExportOtelConfigurationAsEnvironmentVariables

      @DataBoundSetter public void setExportOtelConfigurationAsEnvironmentVariables(boolean exportOtelConfigurationAsEnvironmentVariables)
    • getConfigurationProperties

      public String getConfigurationProperties()
    • setConfigurationProperties

      @DataBoundSetter public void setConfigurationProperties(String configurationProperties)
    • getOtelConfigurationAsEnvironmentVariables

      @NonNull public Map<String,String> getOtelConfigurationAsEnvironmentVariables()
    • setJenkinsLocationConfiguration

      @Inject public void setJenkinsLocationConfiguration(@NonNull JenkinsLocationConfiguration jenkinsLocationConfiguration)
    • getVisualisationObservabilityBackendsString

      @NonNull public String getVisualisationObservabilityBackendsString()
      For visualisation in config.jelly
    • getLoadedStepsPlugins

    • addStepPlugin

      public void addStepPlugin(String stepName, JenkinsOpenTelemetryPluginConfiguration.StepPlugin c)
    • findStepPluginOrDefault

      @NonNull public JenkinsOpenTelemetryPluginConfiguration.StepPlugin findStepPluginOrDefault(@NonNull String buildStepName, @NonNull BuildStep buildStep)
    • findStepPluginOrDefault

      @NonNull public JenkinsOpenTelemetryPluginConfiguration.StepPlugin findStepPluginOrDefault(@NonNull String stepName, @NonNull org.jenkinsci.plugins.workflow.cps.nodes.StepAtomNode node)
    • findStepPluginOrDefault

      @NonNull public JenkinsOpenTelemetryPluginConfiguration.StepPlugin findStepPluginOrDefault(@NonNull String stepName, @NonNull org.jenkinsci.plugins.workflow.cps.nodes.StepStartNode node)
    • findStepPluginOrDefault

      @NonNull public JenkinsOpenTelemetryPluginConfiguration.StepPlugin findStepPluginOrDefault(@NonNull String stepName, @Nullable Descriptor<? extends Describable> descriptor)
    • findSymbolOrDefault

      @NonNull public String findSymbolOrDefault(@NonNull String buildStepName, @NonNull BuildStep buildStep)
    • findSymbolOrDefault

      @NonNull public String findSymbolOrDefault(@NonNull String buildStepName, @Nullable Descriptor<? extends Describable> descriptor)
    • getServiceName

      public String getServiceName()
      See Also:
      • ServiceAttributes.SERVICE_NAME
    • setServiceName

      @DataBoundSetter public void setServiceName(String serviceName)
    • getServiceNamespace

      public String getServiceNamespace()
      See Also:
      • ServiceIncubatingAttributes.SERVICE_NAMESPACE
    • setServiceNamespace

      @DataBoundSetter public void setServiceNamespace(String serviceNamespace)
    • getResource

      @NonNull public io.opentelemetry.sdk.resources.Resource getResource()
    • getResourceAsText

      @NonNull public String getResourceAsText()
      Used in io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/config.jelly because cyrille doesn't know how to format the content with linebreaks in a html teaxtarea
    • getConfigProperties

      @NonNull public io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties getConfigProperties()
    • getNoteworthyConfigPropertiesAsText

      @NonNull public String getNoteworthyConfigPropertiesAsText()
      Used in io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/config.jelly because cyrille doesn't know how to format the content with linebreaks in a html teaxtarea
    • getLogStorageRetriever

      @NonNull public LogStorageRetriever getLogStorageRetriever()
    • get

      @NonNull public static JenkinsOpenTelemetryPluginConfiguration get()
      https://github.com/spotbugs/spotbugs/issues/1175
    • doCheckEndpoint

      public FormValidation doCheckEndpoint(@QueryParameter String endpoint)
      See OpenTelemetry Specification / OpenTelemetry Protocol Exporter

      Target URL to which the exporter is going to send spans or metrics. The endpoint MUST be a valid URL with scheme (http or https) and host, MAY contain a port, SHOULD contain a path and MUST NOT contain other parts (such as query string or fragment). A scheme of https indicates a secure connection.

    • doCheckIgnoredSteps

      public FormValidation doCheckIgnoredSteps(@QueryParameter String ignoredSteps)
      Validates the period duration input.
      Parameters:
      ignoredSteps - the comma-separated list of steps to ignore.
      Returns:
      ok if the form input was valid
    • doCheckExportOtelConfigurationAsEnvironmentVariables

      public FormValidation doCheckExportOtelConfigurationAsEnvironmentVariables(@QueryParameter String value)
      A warning if it's selected.
      Parameters:
      value - the exportOtelConfigurationAsEnvironmentVariables flag
      Returns:
      ok if the form input was valid
    • preDestroy

      @PreDestroy public void preDestroy() throws Exception
      Throws:
      Exception