sentry-python icon indicating copy to clipboard operation
sentry-python copied to clipboard

Cannot send performance data with rediscluster

Open sl0thentr0py opened this issue 3 years ago • 1 comments

Discussed in https://github.com/getsentry/sentry-python/discussions/1563

Originally posted by georgkrause August 13, 2022 Whenever the sentry sdk tries to send performance data, I get the following:

demo-api-1  |  [sentry] ERROR: Unexpected status code: 400 (body: b'{"spans":{"6":{"tags":{"redis.is_cluster":["Not a valid string."]}},"15":{"tags":{"redis.is_cluster":["Not a valid string."]}},"16":{"tags":{"redis.is_cluster":["Not a valid string."]}},"17":{"tags":{"redis.is_cluster":["Not a valid string."]}}}}')

Where can I start to find the cause for this? Any help is appreciated! :)

sl0thentr0py avatar Aug 13 '22 17:08 sl0thentr0py

A user reported this bug to GlitchTip which I believe is what's responsible for the 400 error attached. However it may be a bug in sentry-python. A Span interface tag field is documented as "A map or list of tags for this event. Each tag must be less than 200 characters." It's not exactly clear if this is intended to explicitly be a string. One could interpret "characters" as implying it needs to be a string, in which case sentry-python should probably convert it to a string. If it is intended to be a non-string or you feel the server should be responsible for coercing it as a string, then this issue should be closed.

Related issue

bufke avatar Aug 14 '22 18:08 bufke

hmm ok I wasn't able to reproduce this. I tried the sample here and all kinds of tags - strings/ints/booleans go through so I'm not sure how to see your error. Please help with me reproduction steps so I can investigate further.

sl0thentr0py avatar Aug 16 '22 10:08 sl0thentr0py

@bufke @georgkrause are you using self-hosted Sentry?

sl0thentr0py avatar Aug 16 '22 10:08 sl0thentr0py

@bufke I just saw what GlitchTip is, our backends are supposed to be flexible in ingesting, so I believe you just need to fix the deserialization on your backend, closing.

sl0thentr0py avatar Aug 16 '22 10:08 sl0thentr0py