Lauri Tulmin a3a572540e Add instrumentation for graphql 20 that does not use deprecated methods (#10779) 1 ano atrás
..
src a3a572540e Add instrumentation for graphql 20 that does not use deprecated methods (#10779) 1 ano atrás
README.md a3a572540e Add instrumentation for graphql 20 that does not use deprecated methods (#10779) 1 ano atrás
build.gradle.kts a3a572540e Add instrumentation for graphql 20 that does not use deprecated methods (#10779) 1 ano atrás

README.md

Library Instrumentation for GraphQL Java version 12.0 to 20.0

Provides OpenTelemetry instrumentation for GraphQL Java.

Quickstart

Add these dependencies to your project

Replace OPENTELEMETRY_VERSION with the latest release.

For Maven, add to your pom.xml dependencies:

<dependencies>
  <dependency>
    <groupId>io.opentelemetry.instrumentation</groupId>
    <artifactId>opentelemetry-graphql-java-12.0</artifactId>
    <version>OPENTELEMETRY_VERSION</version>
  </dependency>
</dependencies>

For Gradle, add to your dependencies:

implementation("io.opentelemetry.instrumentation:opentelemetry-graphql-java-12.0:OPENTELEMETRY_VERSION")

Usage

The instrumentation library provides a GraphQL Java Instrumentation implementation that can be added to an instance of the GraphQL to provide OpenTelemetry-based spans.

void configure(OpenTelemetry openTelemetry, GraphQL.Builder builder) {
  GraphQLTelemetry telemetry = GraphQLTelemetry.builder(openTelemetry).build();
  builder.instrumentation(telemetry.newInstrumentation());
}