Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ public void transform(TypeTransformer transformer) {
public static class ConstructorAdvice {

@Advice.OnMethodEnter(suppress = Throwable.class)
public static void trackCallDepth(@Advice.Local("otelCallDepth") CallDepth callDepth) {
callDepth = CallDepth.forClass(Scheduler.class);
public static CallDepth trackCallDepth() {
CallDepth callDepth = CallDepth.forClass(Scheduler.class);
callDepth.getAndIncrement();

return callDepth;
}

@Advice.OnMethodExit(suppress = Throwable.class)
public static void addTracingInterceptor(
@Advice.This Scheduler scheduler, @Advice.Local("otelCallDepth") CallDepth callDepth) {
@Advice.This Scheduler scheduler, @Advice.Enter CallDepth callDepth) {
// No-args constructor is automatically called by constructors with args, but we only want to
// run once from the constructor with args because that is where the dedupe needs to happen.
if (callDepth.decrementAndGet() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
import com.google.auto.service.AutoService;
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;
import io.opentelemetry.javaagent.extension.instrumentation.internal.ExperimentalInstrumentationModule;
import java.util.Collections;
import java.util.List;

@AutoService(InstrumentationModule.class)
public class QuartzInstrumentationModule extends InstrumentationModule {
public class QuartzInstrumentationModule extends InstrumentationModule
implements ExperimentalInstrumentationModule {

public QuartzInstrumentationModule() {
super("quartz", "quartz-2.0");
Expand All @@ -22,4 +24,9 @@ public QuartzInstrumentationModule() {
public List<TypeInstrumentation> typeInstrumentations() {
return Collections.singletonList(new QuartzInstrumentation());
}

@Override
public boolean isIndyReady() {
return true;
}
}
Loading