Bumps [io.opentelemetry:opentelemetry-bom-alpha](https://github.com/open-telemetry/opentelemetry-java) from 1.22.0-alpha to 1.23.0-alpha. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/open-telemetry/opentelemetry-java/releases">io.opentelemetry:opentelemetry-bom-alpha's releases</a>.</em></p> <blockquote> <h2>Version 1.22.0</h2> <h3>API</h3> <ul> <li>WARNING: GlobalOpenTelemetry trigger of autoconfiguration is now opt-in. Previously, <code>GlobalOpenTelemetry.get</code> triggered autoconfiguration if <code>opentelemetry-sdk-extension-autoconfigure</code> was detected on the classpath. That behavior is now opt-in by setting environment variable <code>OTEL_JAVA_GLOBAL_AUTOCONFIGURE_ENABLED=true</code>. (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5010">#5010</a>)</li> <li>Update LoggerBuilder, MeterBuilder, TracerBuilder javadoc (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5050">#5050</a>)</li> </ul> <h4>Context</h4> <ul> <li>Make closing scope idempotent and non-operational when corresponding context is not current. [(<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/issues/5061">#5061</a>)](<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5061">open-telemetry/opentelemetry-java#5061</a>)</li> </ul> <h3>SDK</h3> <ul> <li>Standardize internal usage of <code>ConfigUtil</code> for reading environment variables and system properties (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5048">#5048</a>)</li> </ul> <h4>Metrics</h4> <ul> <li>Lazily initialize exponential histogram buckets (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5023">#5023</a>)</li> <li>Delete MapCounter alternative exponential histogram implementation (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5047">#5047</a>)</li> <li>Add toString to SdkMeter, SdkObservableInstrument, AbstractInstrumentBuilder (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5072">#5072</a>)</li> </ul> <h4>Exporter</h4> <ul> <li><code>OtlpGrpcSpanExporter</code>, <code>OtlpHttpSpanExporter</code>, <code>OtlpGrpcLogRecordExporter</code>, <code>OtlpHttpLogRecordExporter</code>, <code>ZipkinSpanExporter</code>, and <code>JaegerGrpcSpanExporter</code> are now instrumented with <code>GlobalOpenTelemetry</code> by default. Instrumentation initializes lazily to prevent ordering issue of accessing <code>GlobalOpenTelemetry.get</code> before <code>GlobalOpenTelemetry.set</code> is called. (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/4993">#4993</a>)</li> <li>Add <code>ConfigurableSpanExporterProvider</code> implementation for <code>JaegerGrpcSpanExporter</code> (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5002">#5002</a>)</li> <li>Add <code>ConfigurableSpanExporterProvider</code>, <code>ConfigurableMetricExporterProvider</code>, <code>ConfigurableLogRecordExporterProvider</code> for <code>OtlpGrpc{Signal}Exporter</code>s and <code>OtlpHttp{SignalExporter</code>s (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5003">#5003</a>)</li> <li>Replace OTLP User-Agent spaces with dashes (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5080">#5080</a>)</li> <li>Add <code>AutoConfigurationCustomizerProvider</code> implementation for <code>PrometheusHttpServer</code> (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5053">#5053</a>)</li> <li>Add resource <code>target_info</code> and scope <code>target_info</code> metrics to <code>PrometheusHttpServer</code> in compliance with spec (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5039">#5039</a>)</li> <li>Drop delta metrics in <code>PrometheusHttpServer</code> (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5062">#5062</a>)</li> <li>PrometheusHttpServer drops metrics with same name and different type (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5078">#5078</a>)</li> </ul> <h4>SDK Extensions</h4> <ul> <li>DEPRECATION: Align autoconfigure exemplar filter names with spec. Previous names <code>none</code>, <code>all</code>, <code>with_sampled_trace</code> are deprecated. Use <code>always_off</code>, <code>always_on</code>, <code>trace_based</code> instead. (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5063">#5063</a>)</li> </ul> <h3>OpenTracing Shim</h3> <ul> <li>Add createTracerShim function (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/4988">#4988</a>)</li> </ul> <h3>🙇 Thank you</h3> <p>This release was possible thanks to the following contributors who shared their brilliant ideas and awesome pull requests:</p> <p><a href="https://github.com/amouhadi"><code>@amouhadi</code></a> <a href="https://github.com/brunobat"><code>@brunobat</code></a> <a href="https://github.com/carlosalberto"><code>@carlosalberto</code></a> <a href="https://github.com/cuichenli"><code>@cuichenli</code></a> <a href="https://github.com/dashpole"><code>@dashpole</code></a> <a href="https://github.com/deejgregor"><code>@deejgregor</code></a> <a href="https://github.com/jack-berg"><code>@jack-berg</code></a></p> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md">io.opentelemetry:opentelemetry-bom-alpha's changelog</a>.</em></p> <blockquote> <h1>Changelog</h1> <h2>Unreleased</h2> <h2>Version 1.23.0 (2023-02-10)</h2> <p>This release is a notable release for metrics:</p> <ul> <li>The base2 exponential histogram aggregation has been marked as stable. To use, configure your <code>MetricExporter</code> with a default aggregation of <code>Aggregation.base2ExponentialBucketHistogram()</code> for histogram instruments. If using OTLP exporter with autoconfigure, set <code>OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION=BASE2_EXPONENTIAL_BUCKET_HISTOGRAM</code>. If using configuring OTLP programatically, use <code>Otlp*MetricExporterBuilder#setDefaultAggregationSelector(DefaultAggregationSelector)</code>.</li> <li>The metrics SDK undergone significant internal refactoring which results in reduced complexity and significantly reduced memory allocation during metric collection / export.</li> </ul> <h3>API</h3> <h4>Logs</h4> <ul> <li>WARNING: Split out Event API from Log API. Event API is now published in <code>opentelemetry-api-events</code>. API / SDK usage has also changed - see PR for details. (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5049">#5049</a>)</li> </ul> <h3>SDK</h3> <ul> <li>Add shutdown / close to <code>OpenTelemetrySdk</code> (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5100">#5100</a>)</li> </ul> <h4>Metrics</h4> <ul> <li>Base2 exponential histogram aggregations are now stable. Add <code>base2ExponentialBucketHistogram()</code> to <code>Aggregation</code>. (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5143">#5143</a>)</li> <li>Promote exponential histogram data interfaces to stable package (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5120">#5120</a>)</li> <li>Add Base2 prefix to internal exponential histogram classes (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5179">#5179</a>)</li> <li>Add MaxScale config parameter to <code>Base2ExponentialBucketHistogram</code> (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5044">#5044</a>)</li> <li>Add close method to <code>MetricReader</code> (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5109">#5109</a>)</li> <li>Reuse <code>AggregatorHandle</code> with cumulative temporality to reduce allocations (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5142">#5142</a>)</li> <li>Delete notion of accumulation to reduce allocations (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5154">#5154</a>)</li> <li>Delete bound instruments (<a href="https://github-redirect.dependabot.com/open-telemetry/opentelemetry-java/pull/5157">#5157</a>)</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/open-telemetry/opentelemetry-java/commits">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jack Berg <jberg@newrelic.com> |
||
|---|---|---|
| .. | ||
| docs/images | ||
| src | ||
| README.md | ||
| build.gradle.kts | ||
README.md
Maven OpenTelemetry extension
Maven extension to observe Maven builds as distributed traces.
Getting Started
The Maven OpenTelemetry Extension is configured using environment variables or JVM system properties and can be added to a build using one of the following ways:
- adding the extension jar to
${maven.home}/lib/ext - adding the path to the extension jar to
-Dmaven.ext.class.path, - adding the extension as a build extension in the
pom.xml, - (since Maven 3.3.1) configuring the extension in
.mvn/extensions.xml.
Adding the extension to the classpath
Add the Maven OpenTelemetry Extension to ${maven.home}/lib/ext or to the classpath using -Dmaven.ext.class.path=.
mvn dependency:copy -Dartifact=io.opentelemetry.contrib:opentelemetry-maven-extension:1.10.0-alpha
export OTEL_TRACES_EXPORTER="otlp"
export OTEL_EXPORTER_OTLP_ENDPOINT="http://otel.example.com:4317"
mvn -Dmaven.ext.class.path=target/dependency/opentelemetry-maven-extension-1.10.0-alpha.jar verify
Declaring the extension in the pom.xml file
Add the Maven OpenTelemetry Extension in the pom.xml file:
<project>
...
<build>
<extensions>
<extension>
<groupId>io.opentelemetry.contrib</groupId>
<artifactId>opentelemetry-maven-extension</artifactId>
<version>1.10.0-alpha</version>
</extension>
</extensions>
</build>
</project>
export OTEL_TRACES_EXPORTER="otlp"
export OTEL_EXPORTER_OTLP_ENDPOINT="http://otel.example.com:4317"
mvn verify
Configuration
❕ The setting -Dotel.traces.exporter / OTEL_TRACES_EXPORTER MUST be defined for the Maven OpenTelemetry Extension to export traces.
Without this setting, the traces won't be exported and the OpenTelemetry Maven Extension will behave as a NoOp extension. otlp is currently the only supported exporter.
The Maven OpenTelemetry Extension supports a subset of the OpenTelemetry autoconfiguration environment variables and JVM system properties.
| System property Environment variable |
Default value | Description |
|---|---|---|
otel.traces.exporter OTEL_TRACES_EXPORTER |
none |
Select the OpenTelemetry exporter for tracing, the currently only supported values are none and otlp. none makes the instrumentation NoOp |
otel.exporter.otlp.endpoint OTEL_EXPORTER_OTLP_ENDPOINT |
http://localhost:4317 |
The OTLP traces and metrics endpoint to connect to. Must be a URL with a scheme of either http or https based on the use of TLS. |
otel.exporter.otlp.headers OTEL_EXPORTER_OTLP_HEADERS |
Key-value pairs separated by commas to pass as request headers on OTLP trace and metrics requests. | |
otel.exporter.otlp.timeout OTEL_EXPORTER_OTLP_TIMEOUT |
10000 |
The maximum waiting time, in milliseconds, allowed to send each OTLP trace and metric batch. |
otel.resource.attributes OTEL_RESOURCE_ATTRIBUTES |
Specify resource attributes in the following format: key1=val1,key2=val2,key3=val3 | |
otel.instrumentation.maven.mojo.enabled OTEL_INSTRUMENTATION_MAVEN_MOJO_ENABLED |
true |
Whether to create spans for mojo goal executions, true or false. Can be configured to reduce the number of spans created for large builds. |
ℹ️ The service.name is set to maven and the service.version to the version of the Maven runtime in use.
Examples
Example of a trace of a Maven build.
Example of a distributed trace of a Jenkins pipeline executing a Maven build
Distributed trace of a Jenkins pipeline invoking a Maven build instrumented with the Jenkins OpenTelemetry plugin and the OpenTelemetry Maven Extension and visualized with Jaeger Tracing
Span attributes per Maven plugin goal execution
Span attributes captured for every Maven plugin goal execution
| Span attribute | Type | Description |
|---|---|---|
maven.project.groupId |
string | Group ID of the Maven project on which the Maven goal is executed |
maven.project.artifactId |
string | Artifact ID of the Maven project on which the Maven goal is executed |
maven.project.version |
string | Version of the Maven project on which the Maven goal is executed |
maven.plugin.groupId |
string | Group ID of the Maven plugin on which the Maven goal is executed |
maven.plugin.artifactId |
string | Artifact ID of the Maven plugin on which the Maven goal is executed |
maven.plugin.version |
string | Version of the Maven plugin on which the Maven goal is executed |
maven.execution.goal |
string | Goal that is being executed |
maven.execution.id |
string | ID of the execution |
maven.execution.lifecyclePhase |
string | Lifecycle phase to which belong the execution |
deploy:deploy
In addition to the span attributes captured on every Maven plugin goal execution as described above:
| Span attribute | Type | Description |
|---|---|---|
http.method |
string | POST |
http.url |
string | Base URL of the uploaded artifact ${maven.build.repository.url}/${groupId}/${artifactId}/${version} where the . of ${groupId} are replaced by / |
maven.build.repository.id |
string | ID of the Maven repository to which the artifact is deployed. See Maven POM reference / Repository |
maven.build.repository.url |
string | URL of the Maven repository to which the artifact is deployed. See Maven POM reference / Repository |
peer.service |
string | Maven repository hostname deduced from the Repository URL |
The span.kind is set to client
jib:build
| Span attribute | Type | Description |
|---|---|---|
http.method |
string | POST |
http.url |
string | URL on the Docker registry deduced from the Docker image specified in the build goal configuration. |
maven.build.container.image.name |
string | Name of the produced Docker image |
maven.build.container.image.tags |
string[] | Tags of the produced Docker image |
maven.build.container.registry.url |
string | URL of the container registry to which this image is uploaded. |
peer.service |
string | Docker Registry hostname. |
The span.kind is set to client
snyk:monitor
See https://github.com/snyk/snyk-maven-plugin.
| Span attribute | Type | Description |
|---|---|---|
http.method |
string | POST |
http.url |
string | https://snyk.io/api/v1/monitor/maven the underlying Snyk API URL invoked by the Maven plugin. |
rpc.method |
string | monitor, the underlying Snyk CLI command invoked by the Maven plugin. |
peer.service |
string | snyk.io |
The span.kind is set to client
snyk:test
See https://github.com/snyk/snyk-maven-plugin.
| Span attribute | Type | Description |
|---|---|---|
http.method |
string | POST |
http.url |
string | https://snyk.io/api/v1/test-dep-graph |
rpc.method |
string | test, the underlying Snyk CLI command invoked by the Maven plugin. |
peer.service |
string | snyk.io |
The span.kind is set to client
spring-boot:build-image
| Span attribute | Type | Description |
|---|---|---|
http.method |
string | POST. Attribute only added when the build-image goal publishes the Docker image. |
http.url |
string | URL on the Docker registry, deduced from the Docker image. Attribute only added when the build-image goal publishes the Docker image. |
maven.build.container.image.name |
string | Name of the produced Docker image. Attribute only added when the build-image goal publishes the Docker image. |
maven.build.container.image.tags |
string[] | Tags of the produced Docker image. Attribute only added when the build-image goal publishes the Docker image. |
maven.build.container.registry.url |
string | URL of the container registry to which this image is uploaded. Attribute only added when the build-image goal publishes the Docker image. |
peer.service |
string | Docker Registry hostname. Attribute only added when the build-image goal publishes the Docker image. |
The span.kind is set to client
Other CI/CD Tools supporting OpenTelemetry traces
List of other CI/CD tools that support OpenTelemetry traces and integrate with the Maven OpenTelemetry Extension creating a distributed traces providing end to end visibility.
Jenkins OpenTelemetry Plugin
The Jenkins OpenTelemetry Plugin exposes Jenkins pipelines & jobs as OpenTelemetry traces and exposes Jenkins health indicators as OpenTelemetry metrics.
Otel CLI
The otel-cli is a command line wrapper to observe the execution of a shell command as an OpenTelemetry trace.
Component owners
- Cyrille Le Clerc, Elastic
- Ken Finnigan, Workday
Learn more about component owners in component_owners.yml.

