open-telemetry/semantic-conventions-java

ReleaseFOSSA License StatusFOSSA Security StatusOpenSSF ScorecardSlack

Java code-generation for the OpenTelemetry Semantic Conventions.

Published releases are available on maven central. Replace {{version}} with the latest released version:

Artifact {group}:{artifactId}:{version}Latest VersionDescription
io.opentelemetry.semconv:opentelemetry-semconv:{{version}}Maven CentralGenerated code for stable semantic conventions.
io.opentelemetry.semconv:opentelemetry-semconv-incubating:{{version}}-alphaMaven CentralGenerated code for experimental semantic conventions.
NOTE: This artifact has the -alpha and comes with no compatibility guarantees. Libraries can use this for testing, but should make copies of the attributes to avoid possible runtime errors from version conflicts.
<project>
  <dependencies>
    <dependency>
      <groupId>io.opentelemetry.semconv</groupId>
      <artifactId>opentelemetry-semconv</artifactId>
      <version>{{version}}</version>
    </dependency>
    <!-- Incubating semantic conventions. Breaking changes expected. Library instrumentation SHOULD NOT depend on this. -->
    <dependency>
      <groupId>io.opentelemetry.semconv</groupId>
      <artifactId>opentelemetry-semconv-incubating</artifactId>
      <version>{{version}}-alpha</version>
    </dependency>
  </dependencies>
</project>
dependencies {
  implementation "io.opentelemetry.semconv:opentelemetry-semconv:{{version}}"
  // Incubating semantic conventions. Breaking changes expected. Library instrumentation SHOULD NOT depend on this.
  implementation "io.opentelemetry.semconv:opentelemetry-semconv-incubating:{{version}}-alpha"
}

Java 17 or higher is required to build the projects in this repository. The built artifacts can be used on Java 8 or higher.

To use these artifacts, you must also depend on io.opentelemetry:opentelemetry-api:{{version}}. See opentelemetry-java releases for more information.

An additional requirement for apps supporting older versions of Android on top of desugaring is the need to set the Gradle property android.useFullClasspathForDexingTransform for debug builds. Please see this pull request on the OpenTelemetry Android Extension for details.

Artifacts from this repository follow semantic versioning, mirroring the versions of the upstream semantic-conventions repository. If a release is needed for logic in this repository, a release will be published with a fourth version component (i.e. 1.30.0.1 to an issue with 1.30.0).

Stable artifacts (i.e. artifacts without -alpha version suffix) come with strong backwards compatibility guarantees for public APIs.

Compatibility guarantees are inherited from opentelemetry-java.

Requires docker.

In a shell, execute the following gradle tasks:

./gradlew clean generateSemanticConventions --console=plain
./gradlew spotlessApply

This will download the version of open-telemetry/semantic-conventions defined in the semanticConventionsVersion variable of build.gradle.kts and generate semantic conventions classes from the release contents.

Before you start - see OpenTelemetry general contributing requirements and recommendations.

Make sure to review the projects license and sign the CNCF CLA. A signed CLA will be enforced by an automatic check once you submit a PR, but you can also sign it after opening your PR.

This repository is an extension of open-telemetry/opentelemetry-java. See opentelemetry-java contributors for code owners.

TODO(jack-berg): add code coverage badge?

About

Java generated classes for semantic conventions

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks