Skip to content

Commit

Permalink
OpenTelemetry metrics exporter instrumentation should be enabled even…
Browse files Browse the repository at this point in the history
… with instrument=false
  • Loading branch information
JonasKunz committed Sep 20, 2023
1 parent e968cf3 commit e8bba81
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
package co.elastic.apm.agent.otelmetricsdk;

import co.elastic.apm.agent.impl.ElasticApmTracer;
import co.elastic.apm.agent.tracer.GlobalTracer;
import co.elastic.apm.agent.sdk.ElasticApmInstrumentation;
import co.elastic.apm.agent.sdk.internal.util.LoggerUtils;
import co.elastic.apm.agent.sdk.logging.Logger;
import co.elastic.apm.agent.sdk.logging.LoggerFactory;
import co.elastic.apm.agent.sdk.weakconcurrent.WeakConcurrent;
import co.elastic.apm.agent.sdk.weakconcurrent.WeakSet;
import co.elastic.apm.agent.sdk.internal.util.LoggerUtils;
import co.elastic.apm.agent.tracer.GlobalTracer;
import io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder;
import io.opentelemetry.sdk.metrics.export.MetricExporter;
import net.bytebuddy.asm.Advice;
Expand Down Expand Up @@ -55,6 +55,11 @@ public Collection<String> getInstrumentationGroupNames() {
return Arrays.asList("opentelemetry", "opentelemetry-metrics", "experimental");
}

@Override
public final boolean includeWhenInstrumentationIsDisabled() {
return true;
}

@Override
public String getAdviceClassName() {
return getClass().getName() + "$SdkMeterProviderBuilderAdvice";
Expand Down

0 comments on commit e8bba81

Please sign in to comment.