Skip to content

Commit

Permalink
disable exemplars for otelgrpc and otelhttp test
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed Oct 11, 2024
1 parent bb89d63 commit ac9c562
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func TestStatsHandler(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Setenv("OTEL_METRICS_EXEMPLAR_FILTER", "always_off")
clientSR := tracetest.NewSpanRecorder()
clientTP := trace.NewTracerProvider(trace.WithSpanProcessor(clientSR))
clientMetricReader := metric.NewManualReader()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func doCalls(ctx context.Context, client pb.TestServiceClient) {
}

func TestInterceptors(t *testing.T) {
t.Setenv("OTEL_METRICS_EXEMPLAR_FILTER", "always_off")
clientUnarySR := tracetest.NewSpanRecorder()
clientUnaryTP := trace.NewTracerProvider(trace.WithSpanProcessor(clientUnarySR))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,7 @@ func TestUnaryServerInterceptor(t *testing.T) {
for _, check := range serverChecks {
name := check.grpcCode.String()
t.Run(name, func(t *testing.T) {
t.Setenv("OTEL_METRICS_EXEMPLAR_FILTER", "always_off")
sr := tracetest.NewSpanRecorder()
tp := trace.NewTracerProvider(trace.WithSpanProcessor(sr))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func TestStatsHandlerHandleRPCServerErrors(t *testing.T) {
for _, check := range serverChecks {
name := check.grpcCode.String()
t.Run(name, func(t *testing.T) {
t.Setenv("OTEL_METRICS_EXEMPLAR_FILTER", "always_off")
sr := tracetest.NewSpanRecorder()
tp := trace.NewTracerProvider(trace.WithSpanProcessor(sr))

Expand Down
2 changes: 2 additions & 0 deletions instrumentation/net/http/otelhttp/test/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func assertScopeMetrics(t *testing.T, sm metricdata.ScopeMetrics, attrs attribut
}

func TestHandlerBasics(t *testing.T) {
t.Setenv("OTEL_METRICS_EXEMPLAR_FILTER", "always_off")
rr := httptest.NewRecorder()

spanRecorder := tracetest.NewSpanRecorder()
Expand Down Expand Up @@ -501,6 +502,7 @@ func TestSpanStatus(t *testing.T) {
}

func TestWithRouteTag(t *testing.T) {
t.Setenv("OTEL_METRICS_EXEMPLAR_FILTER", "always_off")
route := "/some/route"

spanRecorder := tracetest.NewSpanRecorder()
Expand Down

0 comments on commit ac9c562

Please sign in to comment.