open-telemetry / opentelemetry-proto-java

Java Bindings for the OpenTelemetry Protocol (OTLP)
https://opentelemetry.io
Apache License 2.0
14 stars 8 forks source link
opentelemetry

OpenTelemetry Icon Java Bindings for the OpenTelemetry Protocol (OTLP)

Maven Central

Java code-generation for the OpenTelemetry Protocol Buffer data model. This repository contains workflows and build scripts that pull releases from opentelemetry-proto to generate and build Java bindings and publish them to the Maven Central Repository.

Published releases

You can use the published releases available on Maven Central. To do so, add the following as dependencies to your build configuration and replace {{version}} with your desired version.

Maven


<dependency>
  <groupId>io.opentelemetry.proto</groupId>
  <artifactId>opentelemetry-proto</artifactId>
  <version>{{version}}</version>
</dependency>

Gradle

implementation("io.opentelemetry.proto:opentelemetry-proto:{{version}}")

Project setup

The build downloads proto definitions from open-telemetry/opentelemetry-proto and generates Java bindings:

./gradlew build

By default protos definitions will be downloaded for the latest published tag of opentelemetry-proto-java. For example, if the latest version is 0.20.0, protos will be downloaded from the v0.20.0 release. This can be overridden for the build or other gradle tasks (e.g. publishToMavenLocal) with -Prelease.version:

./gradlew build -Prelease.version=1.0.0

Support

The generated java bindings published from this repository are provided as-is.

For generic documentation on how to use protobuf bindings, see gRPC documentation and protobuf java documentation.

We have no intention of eventually publishing stable artifacts. If you need guarantees, please generate your own bindings, consulting grpc codegen and possibly build.gradle.kts

Releasing

See RELEASING.md