Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instrumentation for graphql 20 that does not use deprecated methods #10779

Merged
merged 4 commits into from
Mar 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix muzzle
  • Loading branch information
laurit committed Mar 8, 2024
commit 2ffde7ce134c80a0c70a1eabfa80bcf77a755452
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@

package io.opentelemetry.javaagent.instrumentation.graphql.v20_0;

import static io.opentelemetry.javaagent.extension.matcher.AgentElementMatchers.hasClassesNamed;

import com.google.auto.service.AutoService;
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import java.util.Collections;
import java.util.List;
import net.bytebuddy.matcher.ElementMatcher;

@SuppressWarnings("unused")
@AutoService(InstrumentationModule.class)
Expand All @@ -19,6 +22,12 @@ public GraphqlInstrumentationModule() {
super("graphql-java", "graphql-java-20.0");
}

@Override
public ElementMatcher.Junction<ClassLoader> classLoaderMatcher() {
// added in 20.0
return hasClassesNamed("graphql.execution.instrumentation.SimplePerformantInstrumentation");
}

@Override
public List<TypeInstrumentation> typeInstrumentations() {
return Collections.singletonList(new GraphqlInstrumentation());
Expand Down
Loading