opentelemetry-java-instrume.../instrumentation/graphql-java-12.0/library
Trask Stalnaker 71b3e3e027
Library doc cleanup (#6948)
Related to #6947, but just cleans up the library module doc that already
existed (mostly for uniformity). Does not introduce any new doc.
2022-10-24 10:26:21 -07:00
..
src Update error prone (#6646) 2022-09-23 11:24:40 -07:00
README.md Library doc cleanup (#6948) 2022-10-24 10:26:21 -07:00
build.gradle.kts GraphQL java instrumentation (#5583) 2022-03-17 08:55:45 -07:00

README.md

Library Instrumentation for GraphQL Java version 12.0 and higher

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());
}