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

feat(spans): Convert a Sentry span to the Snuba span schema #2917

Merged

Conversation

phacops
Copy link
Contributor

@phacops phacops commented Jan 5, 2024

We're working on pushing spans directly to Snuba instead of going through a Sentry consumer. This will produce to Kafka the proper schema understood by the Snuba consumer.

The way I did that is a bit convoluted right now. The envelope contains a Sentry span we parse using the Span protocol which needs to then be converted to the Kafka message which will use serde. This can be simplified by parsing the span in the envelope directly into a serde-compatible struct (which means when we modify the span, we now have to modify 2 places). Do you think the trade-off is worth it?

I would have reused the annotated protocol but we then can't pass it nicely to the producer to be serialized.

It will still push to the ingest-spans topic until we change the config so we're going to need this PR merged and deployed before we can deploy this change: getsentry/sentry#62527.

@phacops phacops requested a review from jjbayer January 5, 2024 22:11
@phacops phacops self-assigned this Jan 5, 2024
@phacops phacops requested a review from a team as a code owner January 5, 2024 22:11
@jjbayer jjbayer self-assigned this Jan 8, 2024
Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The integration test will need updating.

phacops and others added 5 commits January 8, 2024 09:00
Co-authored-by: Joris Bayer <joris.bayer@sentry.io>
…t-from-protocol-to-snuba-spans-schema' into pierre/spans-convert-from-protocol-to-snuba-spans-schema
@phacops phacops requested a review from jjbayer January 8, 2024 15:33
@phacops phacops requested a review from jjbayer January 8, 2024 23:52
Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment about organization_id. Rest looks good to me!

) # endpoint might overtake envelope

assert spans == [
{
"organization_id": 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still need the organization ID, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we don't need organization_id anymore.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if the field is described in the schema, the Snuba consumer doesn't need it to insert data: https://github.com/getsentry/snuba/blob/master/rust_snuba/src/processors/spans.rs#L28-L53.

Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments about RawValue, but no blockers!

This definitely needs a Canary deploy, that is

  1. Pause deploy-relay
  2. Deploy deploy-relay-experimental
  3. Let run for ~1h and watch for consumer errors.
  4. If no errors and span volume is the same as before, unpause deploy-relay and deploy there as well.

Canary can also be reverted quickly.

) # endpoint might overtake envelope

assert spans == [
{
"organization_id": 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright.

@phacops phacops merged commit 426e517 into master Jan 9, 2024
21 checks passed
@phacops phacops deleted the pierre/spans-convert-from-protocol-to-snuba-spans-schema branch January 9, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants