feat(otel): write OTel environment into sentry.environment#196
Conversation
|
3cd14b0 to
ecee521
Compare
| "pii": { | ||
| "key": "false" | ||
| }, | ||
| "is_in_otel": true, |
There was a problem hiding this comment.
resource.deployment.environment.name isn't in OTel per se, but deployment.environment.name does exist as a resource attribute. 😕
There was a problem hiding this comment.
We can probably treat resource.X attributes as a special case. Maybe worth leaving a note about this in the README.
There was a problem hiding this comment.
Annoyingly, we already have a resource.X attribute that has nothing to do with OTel resources. Still, I tried adding a note to the readme.
| "deprecation": { | ||
| "_status": "backfill", | ||
| "replacement": "sentry.environment" | ||
| } |
There was a problem hiding this comment.
This attribute isn't really deprecated - we've never used it - we just want the backfill (double-write) behaviour.
There was a problem hiding this comment.
Maybe instead of deprecation we introduce a new field for this. I don't want to block this PR though, so we can maybe add a note to the brief and create a follow up issue.
There was a problem hiding this comment.
Makes sense, but I'd prefer to tackle separately from this PR.
AbhiPrasad
left a comment
There was a problem hiding this comment.
approving to unblock, but lets make sure we get the follow ups in as well
Co-authored-by: Abhijeet Prasad <aprasad@sentry.io>
Description
By convention, OTel SDKs sends environment name in the
deployment.environment.nameresource attribute (spec).We would like Sentry's environment filters to work with OTel data. This PR attempts to use sentry-conventions' backfilling to accomplish this, writing the incoming data to our own conventional
sentry.environmentattribute.During ingestion, resource attributes are flattened into our single attributes hash with the keys prefixed with
resource., so during Relay's processing pipeline, the full attribute name of the source attributeresource.deployment.environment.name. That is the attribute name defined in this PR.Mechanically this is exactly what I want, but semantically it feels a little weird. Comments below.
Related to DAIN-1099.
PR Checklist
yarn testand verified that the tests pass.yarn generate && yarn formatto generate and format code and docs.If an attribute was added:
nextjs.function_id, notfunction_id)pii(i.e.maybeortrue. Usefalseonly for values that should never be scrubbed such as IDs)If an attribute was deprecated: