Skip to content

Commit

Permalink
improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed Jun 28, 2024
1 parent 43dec65 commit aa155ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion instrumentation/runtime/test/runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package runtime // import "go.opentelemetry.io/contrib/instrumentation/runtime/t

import (
"context"
"fmt"
"math"
"runtime/debug"
"testing"
Expand Down Expand Up @@ -140,7 +141,7 @@ func assertNonZeroValues(t *testing.T, sm metricdata.ScopeMetrics) {
switch a := m.Data.(type) {
case metricdata.Sum[int64]:
for _, dp := range a.DataPoints {
assert.True(t, dp.Value > 0)
assert.True(t, dp.Value > 0, fmt.Sprintf("Metric %q should have a non-zero value for point with attributes %+v", m.Name, dp.Attributes))
}
default:
t.Fatalf("unexpected data type %v", a)
Expand Down

0 comments on commit aa155ea

Please sign in to comment.