1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-27 22:49:15 +02:00

Use semconv creation functions (#3683)

This commit is contained in:
Tyler Yahn
2023-02-07 13:42:47 -08:00
committed by GitHub
parent a4f646d054
commit ddf393886c
26 changed files with 84 additions and 84 deletions

View File

@@ -1235,8 +1235,8 @@ func TestRecordError(t *testing.T) {
Name: semconv.ExceptionEventName,
Time: errTime,
Attributes: []attribute.KeyValue{
semconv.ExceptionTypeKey.String(s.typ),
semconv.ExceptionMessageKey.String(s.msg),
semconv.ExceptionType(s.typ),
semconv.ExceptionMessage(s.msg),
},
},
},
@@ -1279,8 +1279,8 @@ func TestRecordErrorWithStackTrace(t *testing.T) {
Name: semconv.ExceptionEventName,
Time: errTime,
Attributes: []attribute.KeyValue{
semconv.ExceptionTypeKey.String(typ),
semconv.ExceptionMessageKey.String(msg),
semconv.ExceptionType(typ),
semconv.ExceptionMessage(msg),
},
},
},
@@ -1502,8 +1502,8 @@ func TestSpanCapturesPanic(t *testing.T) {
require.Len(t, spans[0].Events(), 1)
assert.Equal(t, spans[0].Events()[0].Name, semconv.ExceptionEventName)
assert.Equal(t, spans[0].Events()[0].Attributes, []attribute.KeyValue{
semconv.ExceptionTypeKey.String("*errors.errorString"),
semconv.ExceptionMessageKey.String("error message"),
semconv.ExceptionType("*errors.errorString"),
semconv.ExceptionMessage("error message"),
})
}