getsentry / self-hosted

Sentry, feature-complete and packaged up for low-volume deployments and proofs-of-concept
https://develop.sentry.dev/self-hosted/
Other
7.81k stars 1.76k forks source link

set_tag allows any type of tag to be set #3374

Open vanschelven opened 4 days ago

vanschelven commented 4 days ago

How do you use Sentry?

Self-hosted/on-premise

Version

2.15.0

Steps to Reproduce

I set a non-string tag using set_tag

Expected Result

I expected this to be converted to a string, or raise an error

Actual Result

The actual non-string (an int in this case) was sent to the server, where it cannot be dealt with.

sl0thentr0py commented 4 days ago

In general, in our SaaS offering, non-string tags are supported because relay does this transformation https://github.com/getsentry/relay/blob/aa151d2a6d0893dd98dd389da70ebb8347aaf24a/relay-event-schema/src/protocol/types.rs#L722-L749 https://github.com/getsentry/relay/blob/aa151d2a6d0893dd98dd389da70ebb8347aaf24a/relay-event-schema/src/protocol/tags.rs#L33-L43

I believe what happens in self-hosted is that there is no relay and this int is sent straight to the backend. I will transfer this to getsentry/self-hosted and see what they have to say.

vanschelven commented 4 days ago

Given the Robustness principle ("be conservative in what you do, be liberal in what you accept from others"), the linked code from the relay would implement the "liberal" part. This issue is about the other half of that saying though (and for that reason should IMHO be part of the sentry-python repo)