Skip to content

Commit

Permalink
db client metrics only makes sense with stable semconv
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitlinger committed Nov 28, 2024
1 parent 1c71575 commit 6b06ef2
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

package io.opentelemetry.instrumentation.api.incubator.semconv.db;

import static io.opentelemetry.instrumentation.api.internal.SemconvStability.emitStableDatabaseSemconv;
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo;
import static org.junit.jupiter.api.Assumptions.assumeTrue;

import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.trace.Span;
Expand All @@ -30,6 +32,8 @@ class DbClientMetricsTest {

@Test
void collectsMetrics() {
assumeTrue(emitStableDatabaseSemconv());

InMemoryMetricReader metricReader = InMemoryMetricReader.create();
SdkMeterProvider meterProvider =
SdkMeterProvider.builder().registerMetricReader(metricReader).build();
Expand Down

0 comments on commit 6b06ef2

Please sign in to comment.