-
Notifications
You must be signed in to change notification settings - Fork 246
[OTel] Non-string attributes are being sent as an empty string #683
Copy link
Copy link
Closed
Labels
BugIssue typeIssue type
Description
Summary
Non-string attributes are being sent as an empty string.
Steps To Reproduce
- Configure an Open Telemetry TraceProvider using sentry's SpanProcessor
- Start a Span
- Set a non-string Attribute (such as
semconv.HTTPStatusCode) - Verify that in the dashboard this Attribute is an empty string, despite it's value being non-zero
Expected Behavior
- All attributes should reach Sentry's Dashboard with their respective values.
SDK
sentry-goversion: v0.22.0- Go version: 1.19
- Using Go Modules? yes
Sentry
- Using hosted Sentry in sentry.io? yes
- Anything particular to your environment that could be related to this issue? No.
Additional context
The problem seems to be due to these two calls:
sentry-go/otel/span_processor.go
Line 125 in feb3495
| attributes[kv.Key] = kv.Value.AsString() |
sentry-go/otel/span_processor.go
Line 128 in feb3495
| resource[kv.Key] = kv.Value.AsString() |
As stated by Value.AsString method's doc:
// AsString returns the string value. Make sure that the Value's type
// is STRING.
Probably the code's intention was to use Value.Emit(), instead. This method returns the string representation of the Value's data.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugIssue typeIssue type
Fields
Give feedbackNo fields configured for issues without a type.