From 47f34cdeb7e24c1f4e0ce7634649c2879d03a02b Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Sun, 23 Jun 2024 15:42:16 +0000 Subject: [PATCH] improve error message --- instrumentation/runtime/test/runtime_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instrumentation/runtime/test/runtime_test.go b/instrumentation/runtime/test/runtime_test.go index 9d8e6ef91e7..5c235331143 100644 --- a/instrumentation/runtime/test/runtime_test.go +++ b/instrumentation/runtime/test/runtime_test.go @@ -5,6 +5,7 @@ package runtime // import "go.opentelemetry.io/contrib/instrumentation/runtime/t import ( "context" + "fmt" "math" "runtime/debug" "testing" @@ -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)