Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OTel] Non-string attributes are being sent as an empty string #683

Closed
vtfr opened this issue Aug 1, 2023 · 0 comments · Fixed by #684
Closed

[OTel] Non-string attributes are being sent as an empty string #683

vtfr opened this issue Aug 1, 2023 · 0 comments · Fixed by #684

Comments

@vtfr
Copy link
Contributor

vtfr commented Aug 1, 2023

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-go version: 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:

attributes[kv.Key] = kv.Value.AsString()

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant