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 SDK casts all span data values to string #758

Closed
gggritso opened this issue Jan 8, 2024 · 2 comments · Fixed by #784
Closed

OTel SDK casts all span data values to string #758

gggritso opened this issue Jan 8, 2024 · 2 comments · Fixed by #784

Comments

@gggritso
Copy link
Member

gggritso commented Jan 8, 2024

Summary

Something in the interaction between Go and OTel is casting all span data values to strings, even well-known measurement fields like http.response_content_length

Steps To Reproduce

I found this data in the wild, so I don't have actual repro steps, sorry! I can provide more details if you contact me on Slack

Expected Behavior

data.http.response_content_length is an integer

Screenshots

Screenshot 2024-01-08 at 4 35 49 PM

Environment

SDK

  • sentry-go version: 0.25.0
  • opentelemetry version: 1.18.0

Sentry

  • Using hosted Sentry in sentry.io? yes
@AbhiPrasad
Copy link
Member

We are using https://pkg.go.dev/go.opentelemetry.io/[email protected]/attribute#Value.Emit - this forces everything to be strings

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

We should remove the casting.

See https://opentelemetry.io/docs/concepts/signals/traces/#attributes

Values must be a non-null string, boolean, floating point value, integer, or an array of these values

@AbhiPrasad
Copy link
Member

cc @cleptric

gggritso added a commit to getsentry/sentry that referenced this issue Jan 9, 2024
)

Apparently sometimes size fields like the request size can be strings
like `"77"`. This PR makes sure they're parsed as such. See
getsentry/sentry-go#758

- Add spec
- Treat request size as a size field
- Support string values for size fields

Fixes JAVASCRIPT-2QGM
trillville pushed a commit to getsentry/sentry that referenced this issue Jan 19, 2024
)

Apparently sometimes size fields like the request size can be strings
like `"77"`. This PR makes sure they're parsed as such. See
getsentry/sentry-go#758

- Add spec
- Treat request size as a size field
- Support string values for size fields

Fixes JAVASCRIPT-2QGM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants