From 23e541c0fcb4f1c474edae131fefd8441aa191cf Mon Sep 17 00:00:00 2001 From: Cyrille Le Clerc <cyrille.leclerc@grafana.com> Date: Tue, 14 Jan 2025 19:27:17 +0100 Subject: [PATCH] Use `otel.metric.export.interval` instead of the no longer used `otel.imr.export.interval` (#1021) Use `otel.metric.export.interval` instead of the no longer used `otel.imr.export.interval` + replace static config entries by the usage of the generic properties text field --- ...nkinsOpenTelemetryPluginConfiguration.java | 35 ++++++++++++++++--- .../OpenTelemetryConfiguration.java | 30 +++------------- .../OtelEnvironmentContributorService.java | 2 +- .../semconv/ConfigurationKey.java | 9 ++++- .../config.jelly | 20 ++++------- .../help-configurationProperties.html | 4 +-- .../help-disabledResourceProviders.html | 2 +- .../help-exportIntervalMillis.html | 3 -- .../help-exporterIntervalMillis.html | 3 -- .../help-exporterTimeoutMillis.html | 3 -- .../opentelemetry/BaseIntegrationTest.java | 1 - .../JenkinsControllerOpenTelemetryTest.java | 3 +- .../OpenTelemetryConfigurationTest.java | 2 -- .../jcasc/ConfigurationAsCodeDefaultTest.java | 3 -- ...AsCodeElasticLogsBackendExclusiveTest.java | 3 -- ...igurationAsCodeElasticLogsBackendTest.java | 3 -- .../jcasc/ConfigurationAsCodeElasticTest.java | 3 -- .../jcasc/ConfigurationAsCodeJaegerTest.java | 3 -- .../jcasc/ConfigurationAsCodeTest.java | 3 -- .../jcasc/ConfigurationAsCodeZipkinTest.java | 3 -- .../job/log/OtelLocaLogMirroringTest.java | 4 +-- .../opentelemetry/jcasc-elastic-backend.yml | 1 - .../jcasc/configuration-as-code-expected.yml | 2 -- .../jcasc/configuration-as-code.yml | 2 -- .../opentelemetry/jcasc/elastic-expected.yml | 2 -- .../plugins/opentelemetry/jcasc/elastic.yml | 2 -- .../opentelemetry/jcasc/jaeger-expected.yml | 2 -- .../plugins/opentelemetry/jcasc/jaeger.yml | 2 -- .../opentelemetry/jcasc/zipkin-expected.yml | 2 -- .../plugins/opentelemetry/jcasc/zipkin.yml | 2 -- .../job/step/jcasc-elastic-backend.yml | 1 - .../remotespan/jcasc-elastic-backend.yml | 1 - .../remotespan/remote-span-disabled.yml | 1 - 33 files changed, 57 insertions(+), 105 deletions(-) delete mode 100644 src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-exportIntervalMillis.html delete mode 100644 src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-exporterIntervalMillis.html delete mode 100644 src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-exporterTimeoutMillis.html diff --git a/src/main/java/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration.java b/src/main/java/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration.java index 73701928d..f9a58c701 100644 --- a/src/main/java/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration.java +++ b/src/main/java/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration.java @@ -81,7 +81,7 @@ import static io.jenkins.plugins.opentelemetry.OtelUtils.UNKNOWN; import static io.jenkins.plugins.opentelemetry.backend.ObservabilityBackend.ICONS_PREFIX; -@Extension(ordinal = Integer.MAX_VALUE-1 /* initialize OTel ASAP, just after loading JenkinsControllerOpenTelemetry as GlobalOpenTelemetry */) +@Extension(ordinal = Integer.MAX_VALUE - 1 /* initialize OTel ASAP, just after loading JenkinsControllerOpenTelemetry as GlobalOpenTelemetry */) @Symbol("openTelemetry") public class JenkinsOpenTelemetryPluginConfiguration extends GlobalConfiguration { private final static Logger LOGGER = Logger.getLogger(JenkinsOpenTelemetryPluginConfiguration.class.getName()); @@ -121,8 +121,10 @@ public class JenkinsOpenTelemetryPluginConfiguration extends GlobalConfiguration private List<ObservabilityBackend> observabilityBackends = new ArrayList<>(); + @Deprecated private Integer exporterTimeoutMillis = null; + @Deprecated private Integer exporterIntervalMillis = null; private String ignoredSteps = "dir,echo,isUnix,pwd,properties"; @@ -188,8 +190,33 @@ public boolean configure(StaplerRequest2 req, JSONObject json) throws FormExcept protected Object readResolve() { LOGGER.log(Level.FINE, "readResolve()"); + boolean configModified = false; if (this.disabledResourceProviders == null) { this.disabledResourceProviders = JenkinsControllerOpenTelemetry.DEFAULT_OTEL_JAVA_DISABLED_RESOURCE_PROVIDERS; + LOGGER.log(Level.INFO, "Migration of the 'disabledResourceProviders' config param"); + configModified = true; + } + if (this.exporterTimeoutMillis != null) { + this.configurationProperties = + this.configurationProperties + "\n" + + "# Migration of the 'exporterTimeoutMillis' config param to 'otel.exporter.otlp.timeout' property\n" + + OTEL_EXPORTER_OTLP_TIMEOUT.asProperty() + "=" + this.exporterTimeoutMillis; + this.exporterTimeoutMillis = null; + LOGGER.log(Level.INFO, "Migration of the 'exporterTimeoutMillis' config param to 'otel.exporter.otlp.timeout' property"); + configModified = true; + } + if (this.exporterIntervalMillis != null) { + this.configurationProperties = + this.configurationProperties + "\n" + + "# Migration of the 'exporterIntervalMillis' config param to 'otel.metric.export.interval' property\n" + + OTEL_METRIC_EXPORT_INTERVAL.asProperty() + "=" + this.exporterIntervalMillis; + this.exporterIntervalMillis = null; + LOGGER.log(Level.INFO, "Migration of the 'exporterIntervalMillis' config param to 'otel.metric.export.interval' property"); + configModified = true; + } + + if (configModified) { + save(); } return this; } @@ -218,8 +245,6 @@ public OpenTelemetryConfiguration toOpenTelemetryConfiguration() { Optional.ofNullable(this.getEndpoint()), Optional.ofNullable(this.getTrustedCertificatesPem()), Optional.of(this.getAuthentication()), - Optional.ofNullable(this.getExporterTimeoutMillis()), - Optional.ofNullable(this.getExporterIntervalMillis()), Optional.ofNullable(this.getServiceName()), Optional.ofNullable(this.getServiceNamespace()), Optional.ofNullable(this.getDisabledResourceProviders()), @@ -318,16 +343,19 @@ public List<ObservabilityBackend> getObservabilityBackends() { return observabilityBackends; } + @Deprecated public Integer getExporterTimeoutMillis() { return exporterTimeoutMillis; } + @Deprecated @DataBoundSetter public void setExporterTimeoutMillis(Integer exporterTimeoutMillis) { this.exporterTimeoutMillis = exporterTimeoutMillis; } + @Deprecated public Integer getExporterIntervalMillis() { return exporterIntervalMillis; } @@ -335,7 +363,6 @@ public Integer getExporterIntervalMillis() { @DataBoundSetter public void setExporterIntervalMillis(Integer exporterIntervalMillis) { this.exporterIntervalMillis = exporterIntervalMillis; - } public String getIgnoredSteps() { diff --git a/src/main/java/io/jenkins/plugins/opentelemetry/OpenTelemetryConfiguration.java b/src/main/java/io/jenkins/plugins/opentelemetry/OpenTelemetryConfiguration.java index 9e544c7b9..1e06a84b7 100644 --- a/src/main/java/io/jenkins/plugins/opentelemetry/OpenTelemetryConfiguration.java +++ b/src/main/java/io/jenkins/plugins/opentelemetry/OpenTelemetryConfiguration.java @@ -34,21 +34,16 @@ public class OpenTelemetryConfiguration { private final Optional<String> endpoint; private final Optional<String> trustedCertificatesPem; private final Optional<OtlpAuthentication> authentication; - private final Optional<Integer> exporterTimeoutMillis; - private final Optional<Integer> exporterIntervalMillis; private final Optional<String> serviceName; private final Optional<String> serviceNamespace; private final Optional<String> disabledResourceProviders; private final Map<String, String> configurationProperties; public OpenTelemetryConfiguration(Optional<String> endpoint, Optional<String> trustedCertificatesPem, Optional<OtlpAuthentication> authentication, - Optional<Integer> exporterTimeoutMillis, Optional<Integer> exporterIntervalMillis, Optional<String> serviceName, Optional<String> serviceNamespace, Optional<String> disabledResourceProviders, Map<String, String> configurationProperties) { this.endpoint = endpoint.filter(StringUtils::isNotBlank); this.trustedCertificatesPem = trustedCertificatesPem.filter(StringUtils::isNotBlank); this.authentication = authentication; - this.exporterTimeoutMillis = exporterTimeoutMillis; - this.exporterIntervalMillis = exporterIntervalMillis; this.serviceName = serviceName.filter(StringUtils::isNotBlank); this.serviceNamespace = serviceNamespace.filter(StringUtils::isNotBlank); this.disabledResourceProviders = disabledResourceProviders.filter(StringUtils::isNotBlank); @@ -81,14 +76,6 @@ public Optional<String> getTrustedCertificatesPem() { return trustedCertificatesPem; } - public Optional<Integer> getExporterTimeoutMillis() { - return exporterTimeoutMillis; - } - - public Optional<Integer> getExporterIntervalMillis() { - return exporterIntervalMillis; - } - public Optional<String> getDisabledResourceProviders() { return disabledResourceProviders; } @@ -102,7 +89,7 @@ public Map<String, String> toOpenTelemetryProperties() { if (TESTING_INMEMORY_MODE) { properties.put(OTEL_TRACES_EXPORTER.asProperty(), "testing"); properties.put(OTEL_METRICS_EXPORTER.asProperty(), "testing"); - properties.put(OTEL_IMR_EXPORT_INTERVAL.asProperty(), "10ms"); + properties.put(OTEL_METRIC_EXPORT_INTERVAL.asProperty(), "10ms"); } else if (this.getEndpoint().isPresent()) { this.getEndpoint().ifPresent(endpoint -> { // prepare of Optional.ifPResentOrElse() properties.compute(OTEL_TRACES_EXPORTER.asProperty(), (key, oldValue) -> { @@ -142,14 +129,8 @@ public Map<String, String> toOpenTelemetryProperties() { this.getAuthentication().ifPresent(authentication -> authentication.enrichOpenTelemetryAutoConfigureConfigProperties(properties)); - this.getExporterTimeoutMillis().map(Object::toString).ifPresent(exporterTimeoutMillis -> - properties.put(OTEL_EXPORTER_OTLP_TIMEOUT.asProperty(), exporterTimeoutMillis)); - - this.getExporterIntervalMillis().map(Object::toString).ifPresent(exporterIntervalMillis -> - properties.put(OTEL_IMR_EXPORT_INTERVAL.asProperty(), exporterIntervalMillis)); - this.getDisabledResourceProviders().ifPresent(disabledResourceProviders -> - properties.put("otel.java.disabled.resource.providers", disabledResourceProviders)); + properties.put(OTEL_JAVA_DISABLED_RESOURCE_PROVIDERS.asProperty(), disabledResourceProviders)); return properties; } @@ -193,8 +174,7 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) return false; OpenTelemetryConfiguration that = (OpenTelemetryConfiguration) o; return Objects.equals(endpoint, that.endpoint) && Objects.equals(authentication, that.authentication) && - Objects.equals(trustedCertificatesPem, that.trustedCertificatesPem) && Objects.equals(exporterTimeoutMillis, that.exporterTimeoutMillis) && - Objects.equals(exporterIntervalMillis, that.exporterIntervalMillis) && + Objects.equals(trustedCertificatesPem, that.trustedCertificatesPem) && Objects.equals(serviceName, that.serviceName) && Objects.equals(serviceNamespace, that.serviceNamespace) && Objects.equals(disabledResourceProviders, that.disabledResourceProviders) && Objects.equals(configurationProperties, that.configurationProperties); @@ -202,7 +182,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(endpoint, authentication, trustedCertificatesPem, exporterTimeoutMillis, exporterIntervalMillis, serviceName, serviceNamespace, disabledResourceProviders, configurationProperties); + return Objects.hash(endpoint, authentication, trustedCertificatesPem, serviceName, serviceNamespace, disabledResourceProviders, configurationProperties); } @Override @@ -211,8 +191,6 @@ public String toString() { "endpoint='" + endpoint + '\'' + ", trustedCertificatesPem.defined=" + trustedCertificatesPem.isPresent() + ", authentication=" + authentication + - ", exporterTimeoutMillis=" + exporterTimeoutMillis + - ", exporterIntervalMillis=" + exporterIntervalMillis + ", serviceName=" + serviceName + ", serviceNamespace=" + serviceNamespace + ", disabledResourceProviders=" + disabledResourceProviders + diff --git a/src/main/java/io/jenkins/plugins/opentelemetry/job/OtelEnvironmentContributorService.java b/src/main/java/io/jenkins/plugins/opentelemetry/job/OtelEnvironmentContributorService.java index 1b37d76d6..1703804f2 100644 --- a/src/main/java/io/jenkins/plugins/opentelemetry/job/OtelEnvironmentContributorService.java +++ b/src/main/java/io/jenkins/plugins/opentelemetry/job/OtelEnvironmentContributorService.java @@ -41,7 +41,7 @@ public class OtelEnvironmentContributorService { OTEL_EXPORTER_OTLP_INSECURE, OTEL_EXPORTER_OTLP_PROTOCOL, OTEL_EXPORTER_OTLP_TIMEOUT, - OTEL_IMR_EXPORT_INTERVAL, + OTEL_METRIC_EXPORT_INTERVAL, OTEL_LOGS_EXPORTER, OTEL_METRICS_EXPORTER, OTEL_TRACES_EXPORTER diff --git a/src/main/java/io/jenkins/plugins/opentelemetry/semconv/ConfigurationKey.java b/src/main/java/io/jenkins/plugins/opentelemetry/semconv/ConfigurationKey.java index 647452b4d..bb7961853 100644 --- a/src/main/java/io/jenkins/plugins/opentelemetry/semconv/ConfigurationKey.java +++ b/src/main/java/io/jenkins/plugins/opentelemetry/semconv/ConfigurationKey.java @@ -17,12 +17,19 @@ public final class ConfigurationKey { public static final ConfigurationKey OTEL_EXPORTER_OTLP_TIMEOUT = new ConfigurationKey("otel.exporter.otlp.timeout"); public static final ConfigurationKey OTEL_EXPORTER_OTLP_TRACES_ENDPOINT = new ConfigurationKey("otel.exporter.otlp.traces.endpoint"); public static final ConfigurationKey OTEL_EXPORTER_PROMETHEUS_PORT = new ConfigurationKey("otel.exporter.prometheus.port"); - public static final ConfigurationKey OTEL_IMR_EXPORT_INTERVAL = new ConfigurationKey("otel.imr.export.interval"); + + public static final ConfigurationKey OTEL_JAVA_DISABLED_RESOURCE_PROVIDERS = new ConfigurationKey("otel.java.disabled.resource.providers"); + public static final ConfigurationKey OTEL_LOGS_EXPORTER = new ConfigurationKey("otel.logs.exporter"); public static final ConfigurationKey OTEL_LOGS_MIRROR_TO_DISK = new ConfigurationKey("otel.logs.mirror_to_disk"); + + public static final ConfigurationKey OTEL_METRIC_EXPORT_INTERVAL = new ConfigurationKey("otel.metric.export.interval"); public static final ConfigurationKey OTEL_METRICS_EXPORTER = new ConfigurationKey("otel.metrics.exporter"); + public static final ConfigurationKey OTEL_RESOURCE_ATTRIBUTES = new ConfigurationKey("otel.resource.attributes"); + public static final ConfigurationKey OTEL_SERVICE_NAME = new ConfigurationKey("otel.service.name"); + public static final ConfigurationKey OTEL_TRACES_EXPORTER = new ConfigurationKey("otel.traces.exporter"); public static final ConfigurationKey OTEL_INSTRUMENTATION_JENKINS_WEB_ENABLED = new ConfigurationKey("otel.instrumentation.jenkins.web.enabled"); diff --git a/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/config.jelly b/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/config.jelly index 028f60fd8..77bfc2711 100644 --- a/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/config.jelly +++ b/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/config.jelly @@ -1,5 +1,5 @@ <?jelly escape-by-default='true'?> -<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:c="/lib/credentials"> +<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form"> <f:section title="OpenTelemetry"> <f:entry title="OTLP Endpoint" field="endpoint" description="e.g. 'http://otel.example.com:4317', aka OTEL_EXPORTER_OTLP_ENDPOINT"> <f:textbox /> @@ -27,7 +27,10 @@ /> </f:entry> <f:advanced> - <f:entry title="Service name" field="serviceName" description="e.g. 'my-jenkins.example.com', the Logical name of the service. Aka OTEL_SERVICE_NAME"> + <f:entry title="Service name" field="serviceName" description="e.g. 'my-jenkins.example.com', the Logical name of the service. Aka 'OTEL_SERVICE_NAME'"> + <f:textbox /> + </f:entry> + <f:entry title="Service namespace" field="serviceNamespace" description="e.g. 'ci', a namespace for service name. Aka 'OTEL_SERVICE_NAMESPACE'"> <f:textbox /> </f:entry> <f:entry field="disabledResourceProviders" title="Disabled resource providers" description="Coma separated list of class names. Aka 'OTEL_JAVA_DISABLED_RESOURCE_PROVIDERS'"> @@ -39,16 +42,7 @@ <f:entry title="Configuration properties" field="configurationProperties" description="Additional OpenTelemetry SDK configuration properties."> <f:textarea /> </f:entry> - <f:entry title="Service namespace" field="serviceNamespace" description="e.g. 'ci', a namespace for service name"> - <f:textbox /> - </f:entry> - <f:entry field="exporterTimeoutMillis" title="Exporter Timeout (ms)" description="e.g. '30000'. Aka OTEL_EXPORTER_OTLP_TIMEOUT"> - <f:number clazz="required positive number" min="1" default="${exporterTimeoutMillis}"/> - </f:entry> - <f:entry field="exporterIntervalMillis" title="Metrics Exporter Interval (ms)" description="e.g. '60000'. Aka OTEL_IMR_EXPORT_INTERVAL"> - <f:number clazz="required positive number" min="1" default="${exporterIntervalMillis}"/> - </f:entry> - <f:entry title="OTLP Endpoint Certificates" field="trustedCertificatesPem" description="OTLP endpoint certificates (PEM format)"> + <f:entry title="OTLP Endpoint Certificates" field="trustedCertificatesPem" description="OTLP endpoint certificates (PEM format). Aka 'OTEL_EXPORTER_OTLP_CERTIFICATE'"> <f:textarea /> </f:entry> <f:entry title="Noteworthy active configuration properties" description="Noteworthy config properties of the active OpenTelemetry SDK."> @@ -57,7 +51,7 @@ </textarea> </f:entry> - <f:entry title="Active resource attributes" description="Resource attributes of the active OpenTelemetry SDK. See 'OTEL_RESOURCE_ATTRIBUTES'."> + <f:entry title="Active resource attributes" description="Resource attributes of the active OpenTelemetry SDK. Aka 'OTEL_RESOURCE_ATTRIBUTES'."> <textarea rows="10" cols="100" wrap="off" readonly="readonly" style="overflow:scroll;background-color:lightgrey"> ${instance.resourceAsText} </textarea> diff --git a/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-configurationProperties.html b/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-configurationProperties.html index e3a3bed81..23aa8781a 100644 --- a/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-configurationProperties.html +++ b/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-configurationProperties.html @@ -39,7 +39,7 @@ </table> <p>The configuration properties of the OpenTelemetry SDK are also supported. See: <a - href="https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md"> - OpenTelemetry SDK Autoconfigure</a> + href="https://opentelemetry.io/docs/languages/java/configuration/"> + OpenTelemetry Docs / Java / Configure the SDK</a> </p> </div> \ No newline at end of file diff --git a/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-disabledResourceProviders.html b/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-disabledResourceProviders.html index 6b1117c76..3a1578e8a 100644 --- a/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-disabledResourceProviders.html +++ b/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-disabledResourceProviders.html @@ -4,7 +4,7 @@ </p> <p>See <a href="https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md#resource-provider-spi"> - OpenTelemetry SDK Autoconfigure / OpenTelemetry Resource / Disabling Automatic ResourceProviders</a> + OpenTelemetry SDK Autoconfigure / OpenTelemetry Resource / Disabling Automatic ResourceProviders <code>otel.java.disabled.resource.providers</code></a> </p> </div> diff --git a/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-exportIntervalMillis.html b/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-exportIntervalMillis.html deleted file mode 100644 index 65436200a..000000000 --- a/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-exportIntervalMillis.html +++ /dev/null @@ -1,3 +0,0 @@ -<div> - Sets the maximum time to wait for the collector to process an exported batch of metrics. Default: 60000 milliseconds -</div> diff --git a/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-exporterIntervalMillis.html b/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-exporterIntervalMillis.html deleted file mode 100644 index 501206442..000000000 --- a/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-exporterIntervalMillis.html +++ /dev/null @@ -1,3 +0,0 @@ -<div> - Sets the export interval. Default: 60000 milliseconds -</div> diff --git a/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-exporterTimeoutMillis.html b/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-exporterTimeoutMillis.html deleted file mode 100644 index 7fcd7ed00..000000000 --- a/src/main/resources/io/jenkins/plugins/opentelemetry/JenkinsOpenTelemetryPluginConfiguration/help-exporterTimeoutMillis.html +++ /dev/null @@ -1,3 +0,0 @@ -<div> - Sets the maximum time to wait for the collector to process an exported batch of spans or metrics in milliseconds. Default: 30000 milliseconds -</div> diff --git a/src/test/java/io/jenkins/plugins/opentelemetry/BaseIntegrationTest.java b/src/test/java/io/jenkins/plugins/opentelemetry/BaseIntegrationTest.java index ae7c8c681..3a3569a93 100644 --- a/src/test/java/io/jenkins/plugins/opentelemetry/BaseIntegrationTest.java +++ b/src/test/java/io/jenkins/plugins/opentelemetry/BaseIntegrationTest.java @@ -115,7 +115,6 @@ public static void beforeClass() throws Exception { OpenTelemetryConfiguration configuration = new OpenTelemetryConfiguration( of("http://localhost:4317"), empty(), empty(), - empty(), empty(), empty(), empty(), empty(), Collections.emptyMap()); diff --git a/src/test/java/io/jenkins/plugins/opentelemetry/JenkinsControllerOpenTelemetryTest.java b/src/test/java/io/jenkins/plugins/opentelemetry/JenkinsControllerOpenTelemetryTest.java index 19aa863ec..7719e517f 100644 --- a/src/test/java/io/jenkins/plugins/opentelemetry/JenkinsControllerOpenTelemetryTest.java +++ b/src/test/java/io/jenkins/plugins/opentelemetry/JenkinsControllerOpenTelemetryTest.java @@ -50,8 +50,7 @@ private void testDefaultConfigurationOverwrite(String serviceNameDefinedInConfig OpenTelemetryConfiguration openTelemetryConfiguration = new OpenTelemetryConfiguration( Optional.of("http://localhost:4317/"), Optional.empty(), - Optional.empty(), - Optional.empty(), + Optional.empty(), Optional.ofNullable(serviceNameDefinedInConfig), Optional.ofNullable(serviceNamespaceDefinedInConfig), diff --git a/src/test/java/io/jenkins/plugins/opentelemetry/OpenTelemetryConfigurationTest.java b/src/test/java/io/jenkins/plugins/opentelemetry/OpenTelemetryConfigurationTest.java index ca40a4e5d..5461f562b 100644 --- a/src/test/java/io/jenkins/plugins/opentelemetry/OpenTelemetryConfigurationTest.java +++ b/src/test/java/io/jenkins/plugins/opentelemetry/OpenTelemetryConfigurationTest.java @@ -93,8 +93,6 @@ private static void testOpenTelemetryExportersConfiguration(String expectedTrace Optional.ofNullable(otlpEndpoint), Optional.empty(), Optional.empty(), - Optional.empty(), - Optional.empty(), Optional.of("my-jenkins"), Optional.empty(), Optional.empty(), diff --git a/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeDefaultTest.java b/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeDefaultTest.java index aa80ca7e5..ddc61b0e6 100644 --- a/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeDefaultTest.java +++ b/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeDefaultTest.java @@ -48,9 +48,6 @@ public void should_support_configuration_as_code() { OtlpAuthentication authentication = configuration.getAuthentication(); MatcherAssert.assertThat(authentication, CoreMatchers.is(instanceOf(NoAuthentication.class))); - MatcherAssert.assertThat(configuration.getExporterTimeoutMillis(), CoreMatchers.nullValue()); - MatcherAssert.assertThat(configuration.getExporterIntervalMillis(), CoreMatchers.nullValue()); - MatcherAssert.assertThat(configuration.getIgnoredSteps(), CoreMatchers.is("dir,echo,isUnix,pwd,properties")); MatcherAssert.assertThat(configuration.getServiceName(), CoreMatchers.is("jenkins")); diff --git a/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeElasticLogsBackendExclusiveTest.java b/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeElasticLogsBackendExclusiveTest.java index 8299bc607..ef167048e 100644 --- a/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeElasticLogsBackendExclusiveTest.java +++ b/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeElasticLogsBackendExclusiveTest.java @@ -51,9 +51,6 @@ public void should_support_configuration_as_code() { OtlpAuthentication authentication = configuration.getAuthentication(); MatcherAssert.assertThat(authentication, CoreMatchers.is(instanceOf(NoAuthentication.class))); - MatcherAssert.assertThat(configuration.getExporterTimeoutMillis(), CoreMatchers.nullValue()); - MatcherAssert.assertThat(configuration.getExporterIntervalMillis(), CoreMatchers.nullValue()); - MatcherAssert.assertThat(configuration.getIgnoredSteps(), CoreMatchers.is("dir,echo,isUnix,pwd,properties")); MatcherAssert.assertThat(configuration.getServiceName(), CoreMatchers.is("jenkins")); diff --git a/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeElasticLogsBackendTest.java b/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeElasticLogsBackendTest.java index 9399cef78..d6f2b807c 100644 --- a/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeElasticLogsBackendTest.java +++ b/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeElasticLogsBackendTest.java @@ -52,9 +52,6 @@ public void should_support_configuration_as_code() { OtlpAuthentication authentication = configuration.getAuthentication(); MatcherAssert.assertThat(authentication, CoreMatchers.is(instanceOf(NoAuthentication.class))); - MatcherAssert.assertThat(configuration.getExporterTimeoutMillis(), CoreMatchers.nullValue()); - MatcherAssert.assertThat(configuration.getExporterIntervalMillis(), CoreMatchers.nullValue()); - MatcherAssert.assertThat(configuration.getIgnoredSteps(), CoreMatchers.is("dir,echo,isUnix,pwd,properties")); MatcherAssert.assertThat(configuration.getServiceName(), CoreMatchers.is("jenkins")); diff --git a/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeElasticTest.java b/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeElasticTest.java index 9f7a2cd35..fecbf8962 100644 --- a/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeElasticTest.java +++ b/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeElasticTest.java @@ -45,9 +45,6 @@ public void should_support_configuration_as_code() { MatcherAssert.assertThat(configuration.getServiceName(), CoreMatchers.is("my-jenkins")); MatcherAssert.assertThat(configuration.getServiceNamespace(), CoreMatchers.is("ci")); - - MatcherAssert.assertThat(configuration.getExporterIntervalMillis(), CoreMatchers.is(Integer.valueOf(60_000))); - MatcherAssert.assertThat(configuration.getExporterTimeoutMillis(), CoreMatchers.is(Integer.valueOf(30_000))); } @Test diff --git a/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeJaegerTest.java b/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeJaegerTest.java index 2fa444ef0..8be08ca6c 100644 --- a/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeJaegerTest.java +++ b/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeJaegerTest.java @@ -47,9 +47,6 @@ public void should_support_configuration_as_code() { MatcherAssert.assertThat(configuration.getServiceName(), CoreMatchers.is("my-jenkins")); MatcherAssert.assertThat(configuration.getServiceNamespace(), CoreMatchers.is("ci")); - - MatcherAssert.assertThat(configuration.getExporterIntervalMillis(), CoreMatchers.is(Integer.valueOf(60_000))); - MatcherAssert.assertThat(configuration.getExporterTimeoutMillis(), CoreMatchers.is(Integer.valueOf(30_000))); } @Test diff --git a/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeTest.java b/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeTest.java index e4bf84035..f21771785 100644 --- a/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeTest.java +++ b/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeTest.java @@ -63,9 +63,6 @@ public void should_support_configuration_as_code() { MatcherAssert.assertThat(configuration.getServiceName(), CoreMatchers.is("my-jenkins")); MatcherAssert.assertThat(configuration.getServiceNamespace(), CoreMatchers.is("ci")); - - MatcherAssert.assertThat(configuration.getExporterIntervalMillis(), CoreMatchers.is(Integer.valueOf(60_000))); - MatcherAssert.assertThat(configuration.getExporterTimeoutMillis(), CoreMatchers.is(Integer.valueOf(30_000))); } @Test diff --git a/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeZipkinTest.java b/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeZipkinTest.java index 7b0149972..e3255ade2 100644 --- a/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeZipkinTest.java +++ b/src/test/java/io/jenkins/plugins/opentelemetry/jcasc/ConfigurationAsCodeZipkinTest.java @@ -47,9 +47,6 @@ public void should_support_configuration_as_code() { MatcherAssert.assertThat(configuration.getServiceName(), CoreMatchers.is("my-jenkins")); MatcherAssert.assertThat(configuration.getServiceNamespace(), CoreMatchers.is("ci")); - - MatcherAssert.assertThat(configuration.getExporterIntervalMillis(), CoreMatchers.is(Integer.valueOf(60_000))); - MatcherAssert.assertThat(configuration.getExporterTimeoutMillis(), CoreMatchers.is(Integer.valueOf(30_000))); } @Test diff --git a/src/test/java/io/jenkins/plugins/opentelemetry/job/log/OtelLocaLogMirroringTest.java b/src/test/java/io/jenkins/plugins/opentelemetry/job/log/OtelLocaLogMirroringTest.java index b2fb2de2d..7241e0c3f 100644 --- a/src/test/java/io/jenkins/plugins/opentelemetry/job/log/OtelLocaLogMirroringTest.java +++ b/src/test/java/io/jenkins/plugins/opentelemetry/job/log/OtelLocaLogMirroringTest.java @@ -59,7 +59,7 @@ public static void beforeClass() throws Exception { openTelemetry = ExtensionList.lookup(ReconfigurableOpenTelemetry.class).get(0); jenkinsControllerOpenTelemetry = jenkinsOpenTelemetries.get(0); - jenkinsControllerOpenTelemetry.initialize(new OpenTelemetryConfiguration(of("http://localhost:4317"), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Collections.emptyMap())); + jenkinsControllerOpenTelemetry.initialize(new OpenTelemetryConfiguration(of("http://localhost:4317"), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Collections.emptyMap())); } @AfterClass public static void afterClass() throws Exception { @@ -99,7 +99,7 @@ private WorkflowRun runBuild() throws Exception { } private void reInitProvider(Map<String, String> configuration) { - jenkinsControllerOpenTelemetry.initialize(new OpenTelemetryConfiguration(of("http://localhost:4317"), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), configuration)); + jenkinsControllerOpenTelemetry.initialize(new OpenTelemetryConfiguration(of("http://localhost:4317"), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), configuration)); } diff --git a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc-elastic-backend.yml b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc-elastic-backend.yml index a5b8e31b9..83b7cfdce 100644 --- a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc-elastic-backend.yml +++ b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc-elastic-backend.yml @@ -2,7 +2,6 @@ unclassified: openTelemetry: authentication: "noAuthentication" endpoint: "http://otel-collector-contrib:4317" - exporterTimeoutMillis: 3000 exportOtelConfigurationAsEnvironmentVariables: true observabilityBackends: - elasticBackend: diff --git a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/configuration-as-code-expected.yml b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/configuration-as-code-expected.yml index c045a8fdc..24e97f8f1 100644 --- a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/configuration-as-code-expected.yml +++ b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/configuration-as-code-expected.yml @@ -3,8 +3,6 @@ configurationProperties: "otel.exporter.otlp.protocol=grpc" disabledResourceProviders: "io.opentelemetry.instrumentation.resources.ProcessResourceProvider" endpoint: "http://otel-collector-contrib:4317" exportOtelConfigurationAsEnvironmentVariables: false -exporterIntervalMillis: 60000 -exporterTimeoutMillis: 30000 ignoredSteps: "dir,echo,isUnix,pwd,properties" observabilityBackends: - elastic: diff --git a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/configuration-as-code.yml b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/configuration-as-code.yml index 1a44fb104..240b9a637 100644 --- a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/configuration-as-code.yml +++ b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/configuration-as-code.yml @@ -3,8 +3,6 @@ unclassified: configurationProperties: "otel.exporter.otlp.protocol=grpc" endpoint: "http://otel-collector-contrib:4317" exportOtelConfigurationAsEnvironmentVariables: false - exporterIntervalMillis: 60000 - exporterTimeoutMillis: 30000 observabilityBackends: - elastic: name: "My Elastic" diff --git a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/elastic-expected.yml b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/elastic-expected.yml index 5aef41e90..07ec2116e 100644 --- a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/elastic-expected.yml +++ b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/elastic-expected.yml @@ -5,8 +5,6 @@ configurationProperties: "otel.exporter.otlp.protocol=grpc" disabledResourceProviders: "io.opentelemetry.instrumentation.resources.ProcessResourceProvider" endpoint: "https://my-deployment.otel.example.com" exportOtelConfigurationAsEnvironmentVariables: false -exporterIntervalMillis: 60000 -exporterTimeoutMillis: 30000 ignoredSteps: "dir,echo,isUnix,pwd,properties" observabilityBackends: - elastic: diff --git a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/elastic.yml b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/elastic.yml index 1b4ea06e5..77f7d57c9 100644 --- a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/elastic.yml +++ b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/elastic.yml @@ -16,8 +16,6 @@ unclassified: endpoint: "https://my-deployment.otel.example.com" configurationProperties: "otel.exporter.otlp.protocol=grpc" exportOtelConfigurationAsEnvironmentVariables: false - exporterIntervalMillis: 60000 - exporterTimeoutMillis: 30000 observabilityBackends: - elastic: name: "My Elastic" diff --git a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/jaeger-expected.yml b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/jaeger-expected.yml index b495156ae..ea075eaff 100644 --- a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/jaeger-expected.yml +++ b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/jaeger-expected.yml @@ -3,8 +3,6 @@ configurationProperties: "otel.exporter.otlp.protocol=grpc" disabledResourceProviders: "io.opentelemetry.instrumentation.resources.ProcessResourceProvider" endpoint: "http://otel-collector-contrib:4317" exportOtelConfigurationAsEnvironmentVariables: false -exporterIntervalMillis: 60000 -exporterTimeoutMillis: 30000 ignoredSteps: "dir,echo,isUnix,pwd,properties" observabilityBackends: - jaeger: diff --git a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/jaeger.yml b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/jaeger.yml index facd23ea9..cd3576c4e 100644 --- a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/jaeger.yml +++ b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/jaeger.yml @@ -3,8 +3,6 @@ unclassified: configurationProperties: "otel.exporter.otlp.protocol=grpc" endpoint: "http://otel-collector-contrib:4317" exportOtelConfigurationAsEnvironmentVariables: false - exporterIntervalMillis: 60000 - exporterTimeoutMillis: 30000 observabilityBackends: - jaeger: jaegerBaseUrl: "http://my-jaeger.acme.com:16686" diff --git a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/zipkin-expected.yml b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/zipkin-expected.yml index d99b9cbe4..6d2f49ea2 100644 --- a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/zipkin-expected.yml +++ b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/zipkin-expected.yml @@ -3,8 +3,6 @@ configurationProperties: "otel.exporter.otlp.protocol=grpc" disabledResourceProviders: "io.opentelemetry.instrumentation.resources.ProcessResourceProvider" endpoint: "http://otel-collector-contrib:4317" exportOtelConfigurationAsEnvironmentVariables: false -exporterIntervalMillis: 60000 -exporterTimeoutMillis: 30000 ignoredSteps: "dir,echo,isUnix,pwd,properties" observabilityBackends: - zipkin: diff --git a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/zipkin.yml b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/zipkin.yml index b4dac3fd6..9101e0978 100644 --- a/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/zipkin.yml +++ b/src/test/resources/io/jenkins/plugins/opentelemetry/jcasc/zipkin.yml @@ -3,8 +3,6 @@ unclassified: configurationProperties: "otel.exporter.otlp.protocol=grpc" endpoint: "http://otel-collector-contrib:4317" exportOtelConfigurationAsEnvironmentVariables: false - exporterIntervalMillis: 60000 - exporterTimeoutMillis: 30000 observabilityBackends: - zipkin: name: "My Zipkin" diff --git a/src/test/resources/io/jenkins/plugins/opentelemetry/job/step/jcasc-elastic-backend.yml b/src/test/resources/io/jenkins/plugins/opentelemetry/job/step/jcasc-elastic-backend.yml index a5b8e31b9..83b7cfdce 100644 --- a/src/test/resources/io/jenkins/plugins/opentelemetry/job/step/jcasc-elastic-backend.yml +++ b/src/test/resources/io/jenkins/plugins/opentelemetry/job/step/jcasc-elastic-backend.yml @@ -2,7 +2,6 @@ unclassified: openTelemetry: authentication: "noAuthentication" endpoint: "http://otel-collector-contrib:4317" - exporterTimeoutMillis: 3000 exportOtelConfigurationAsEnvironmentVariables: true observabilityBackends: - elasticBackend: diff --git a/src/test/resources/io/jenkins/plugins/opentelemetry/remotespan/jcasc-elastic-backend.yml b/src/test/resources/io/jenkins/plugins/opentelemetry/remotespan/jcasc-elastic-backend.yml index a5b8e31b9..83b7cfdce 100644 --- a/src/test/resources/io/jenkins/plugins/opentelemetry/remotespan/jcasc-elastic-backend.yml +++ b/src/test/resources/io/jenkins/plugins/opentelemetry/remotespan/jcasc-elastic-backend.yml @@ -2,7 +2,6 @@ unclassified: openTelemetry: authentication: "noAuthentication" endpoint: "http://otel-collector-contrib:4317" - exporterTimeoutMillis: 3000 exportOtelConfigurationAsEnvironmentVariables: true observabilityBackends: - elasticBackend: diff --git a/src/test/resources/io/jenkins/plugins/opentelemetry/remotespan/remote-span-disabled.yml b/src/test/resources/io/jenkins/plugins/opentelemetry/remotespan/remote-span-disabled.yml index 625ba07ef..e21acbf95 100644 --- a/src/test/resources/io/jenkins/plugins/opentelemetry/remotespan/remote-span-disabled.yml +++ b/src/test/resources/io/jenkins/plugins/opentelemetry/remotespan/remote-span-disabled.yml @@ -2,7 +2,6 @@ unclassified: openTelemetry: authentication: "noAuthentication" endpoint: "http://otel-collector-contrib:4317" - exporterTimeoutMillis: 3000 exportOtelConfigurationAsEnvironmentVariables: true configurationProperties: |- otel.instrumentation.jenkins.remote.span.enabled=false