Skip to content

Commit

Permalink
prevent prom remote write test from testing underlying library instru…
Browse files Browse the repository at this point in the history
…mentation

Signed-off-by: Alex Boten <[email protected]>
  • Loading branch information
codeboten committed Aug 30, 2024
1 parent 1155c57 commit 91bbe8c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions exporter/prometheusremotewriteexporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ import (
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/config/confighttp"
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/config/configtelemetry"
"go.opentelemetry.io/collector/config/configtls"
"go.opentelemetry.io/collector/consumer/consumererror"
"go.opentelemetry.io/collector/exporter"
"go.opentelemetry.io/collector/exporter/exporterhelper"
"go.opentelemetry.io/collector/exporter/exportertest"
"go.opentelemetry.io/collector/pdata/pmetric"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/metric/noop"
"go.opentelemetry.io/otel/sdk/metric/metricdata"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata"
Expand Down Expand Up @@ -734,6 +737,15 @@ func Test_PushMetrics(t *testing.T) {
}
tel := setupTestTelemetry()
set := tel.NewSettings()
mp := set.LeveledMeterProvider(configtelemetry.LevelBasic)
set.LeveledMeterProvider = func(level configtelemetry.Level) metric.MeterProvider {
// detailed level enables otelhttp client instrumentation which we
// dont want to test here
if level == configtelemetry.LevelDetailed {
return noop.MeterProvider{}
}
return mp
}
set.BuildInfo = buildInfo

prwe, nErr := newPRWExporter(cfg, set)
Expand Down

0 comments on commit 91bbe8c

Please sign in to comment.