-
Notifications
You must be signed in to change notification settings - Fork 873
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport graphql-java-22.0 support to 1.33.x (#11171)
- Loading branch information
Showing
37 changed files
with
741 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
instrumentation/graphql-java-12.0/javaagent/build.gradle.kts
This file was deleted.
Oops, something went wrong.
65 changes: 0 additions & 65 deletions
65
...ibrary/src/main/java/io/opentelemetry/instrumentation/graphql/v12_0/GraphQLTelemetry.java
This file was deleted.
Oops, something went wrong.
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
instrumentation/graphql-java/graphql-java-12.0/javaagent/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
plugins { | ||
id("otel.javaagent-instrumentation") | ||
} | ||
|
||
muzzle { | ||
pass { | ||
group.set("com.graphql-java") | ||
module.set("graphql-java") | ||
versions.set("[12,20)") | ||
skip("230521-nf-execution") | ||
assertInverse.set(true) | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(project(":instrumentation:graphql-java:graphql-java-12.0:library")) | ||
implementation(project(":instrumentation:graphql-java:graphql-java-common:library")) | ||
|
||
library("com.graphql-java:graphql-java:12.0") | ||
|
||
testInstrumentation(project(":instrumentation:graphql-java:graphql-java-20.0:javaagent")) | ||
|
||
testImplementation(project(":instrumentation:graphql-java:graphql-java-common:testing")) | ||
|
||
latestDepTestLibrary("com.graphql-java:graphql-java:19.+") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...main/java/io/opentelemetry/javaagent/instrumentation/graphql/v12_0/GraphqlSingletons.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.javaagent.instrumentation.graphql.v12_0; | ||
|
||
import graphql.execution.instrumentation.Instrumentation; | ||
import io.opentelemetry.api.GlobalOpenTelemetry; | ||
import io.opentelemetry.instrumentation.graphql.internal.InstrumentationUtil; | ||
import io.opentelemetry.instrumentation.graphql.v12_0.GraphQLTelemetry; | ||
import io.opentelemetry.javaagent.bootstrap.internal.InstrumentationConfig; | ||
|
||
public final class GraphqlSingletons { | ||
|
||
private static final boolean QUERY_SANITIZATION_ENABLED = | ||
InstrumentationConfig.get() | ||
.getBoolean("otel.instrumentation.graphql.query-sanitizer.enabled", true); | ||
|
||
private static final GraphQLTelemetry TELEMETRY = | ||
GraphQLTelemetry.builder(GlobalOpenTelemetry.get()) | ||
.setSanitizeQuery(QUERY_SANITIZATION_ENABLED) | ||
.build(); | ||
|
||
private GraphqlSingletons() {} | ||
|
||
public static Instrumentation addInstrumentation(Instrumentation instrumentation) { | ||
Instrumentation ourInstrumentation = TELEMETRY.newInstrumentation(); | ||
return InstrumentationUtil.addInstrumentation(instrumentation, ourInstrumentation); | ||
} | ||
} |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ation/graphql-java-12.0/library/README.md → ...-java/graphql-java-12.0/library/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
instrumentation/graphql-java/graphql-java-12.0/library/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
plugins { | ||
id("otel.library-instrumentation") | ||
} | ||
|
||
dependencies { | ||
library("com.graphql-java:graphql-java:12.0") | ||
implementation(project(":instrumentation:graphql-java:graphql-java-common:library")) | ||
|
||
testImplementation(project(":instrumentation:graphql-java:graphql-java-common:testing")) | ||
|
||
latestDepTestLibrary("com.graphql-java:graphql-java:19.+") | ||
} |
Oops, something went wrong.