opentelemetry-java-contrib/maven-extension
dependabot[bot] 7f1576fddb
Bump com.uber.nullaway:nullaway from 0.10.8 to 0.10.9 (#724)
Bumps [com.uber.nullaway:nullaway](https://github.com/uber/NullAway)
from 0.10.8 to 0.10.9.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/uber/NullAway/blob/master/CHANGELOG.md">com.uber.nullaway:nullaway's
changelog</a>.</em></p>
<blockquote>
<h2>Version 0.10.9</h2>
<ul>
<li>Add support for external init annotations in constructors (<a
href="https://github-redirect.dependabot.com/uber/NullAway/issues/725">#725</a>)</li>
<li>Ignore incompatibly annotated var args from Kotlin code. (<a
href="https://github-redirect.dependabot.com/uber/NullAway/issues/721">#721</a>)</li>
<li>Support for specific libraries/APIs:
<ul>
<li>Add Throwable.getCause and getLocalizedMessage() library models (<a
href="https://github-redirect.dependabot.com/uber/NullAway/issues/717">#717</a>)</li>
<li>Support more test assertions in OptionalEmptinessHandler (<a
href="https://github-redirect.dependabot.com/uber/NullAway/issues/718">#718</a>)</li>
<li>Support isInstanceOf(...) as implying non-null in assertion
libraries (<a
href="https://github-redirect.dependabot.com/uber/NullAway/issues/726">#726</a>)</li>
</ul>
</li>
<li>[Refactor] Avoid redundant Map lookups (<a
href="https://github-redirect.dependabot.com/uber/NullAway/issues/722">#722</a>)</li>
<li>Build / CI tooling for NullAway itself:
<ul>
<li>Update to Error Prone 2.18.0 (<a
href="https://github-redirect.dependabot.com/uber/NullAway/issues/707">#707</a>)</li>
</ul>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7591b03ae0"><code>7591b03</code></a>
Prepare for release 0.10.9.</li>
<li><a
href="fc151dcaae"><code>fc151dc</code></a>
Support isInstanceOf(...) as implying non-null in assertion libraries.
(<a
href="https://github-redirect.dependabot.com/uber/NullAway/issues/726">#726</a>)</li>
<li><a
href="d2e4a491ff"><code>d2e4a49</code></a>
Add support for external init annotations in constructors (<a
href="https://github-redirect.dependabot.com/uber/NullAway/issues/725">#725</a>)</li>
<li><a
href="4cabc3dc17"><code>4cabc3d</code></a>
Avoid redundant Map lookups (<a
href="https://github-redirect.dependabot.com/uber/NullAway/issues/722">#722</a>)</li>
<li><a
href="0a78a82df7"><code>0a78a82</code></a>
Ignore incompatibly annotated var args from Kotlin code. (<a
href="https://github-redirect.dependabot.com/uber/NullAway/issues/721">#721</a>)</li>
<li><a
href="57a89e857b"><code>57a89e8</code></a>
Update to Error Prone 2.18.0 (<a
href="https://github-redirect.dependabot.com/uber/NullAway/issues/707">#707</a>)</li>
<li><a
href="d809795b92"><code>d809795</code></a>
Support more test assertions in OptionalEmptinessHandler (<a
href="https://github-redirect.dependabot.com/uber/NullAway/issues/718">#718</a>)</li>
<li><a
href="c4c7c4bbb0"><code>c4c7c4b</code></a>
Add Throwable.getCause and getLocalizedMessage() library models (<a
href="https://github-redirect.dependabot.com/uber/NullAway/issues/717">#717</a>)</li>
<li><a
href="d190853d73"><code>d190853</code></a>
Prepare next development version.</li>
<li>See full diff in <a
href="https://github.com/uber/NullAway/compare/v0.10.8...v0.10.9">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=com.uber.nullaway:nullaway&package-manager=gradle&previous-version=0.10.8&new-version=0.10.9)](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: Mateusz Rzeszutek <mrzeszutek@splunk.com>
2023-02-03 15:31:44 +00:00
..
docs/images Reduce the cardinality of mojo span names (#192) 2022-01-14 14:20:36 -08:00
src Bump com.uber.nullaway:nullaway from 0.10.8 to 0.10.9 (#724) 2023-02-03 15:31:44 +00:00
README.md Add more linting (#611) 2022-11-22 08:44:28 -08:00
build.gradle.kts Jfr streaming version (#721) 2023-02-02 08:27:25 -06:00

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.

Execution 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

Execution trace of a Jenkins/Maven build

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

Learn more about component owners in component_owners.yml.