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

fix: Normalize route path in trace context data #3104

Merged
merged 5 commits into from
Feb 15, 2024

Conversation

olksdr
Copy link
Contributor

@olksdr olksdr commented Feb 13, 2024

Relay expects for contexts.trace.data.route to be a route, but some SDKs sent the string (for route names) in route and we want to handle this and normalize the data into the know types structure.

This PR introduces the customer FromValue trait implementation for Route to handle:

  • incoming object
  • incoming string for contexts.trace.data.route field

fix: #3000

@olksdr olksdr self-assigned this Feb 13, 2024
@olksdr olksdr requested a review from a team as a code owner February 13, 2024 17:05
@olksdr
Copy link
Contributor Author

olksdr commented Feb 13, 2024

/cc @cleptric

Copy link
Contributor

@iker-barriocanal iker-barriocanal left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

I wonder if we should document this in the trace context to avoid similar issues in the future.

}
Annotated(None, meta) => Annotated(None, meta),
Annotated(Some(value), mut meta) => {
meta.add_error(Error::expected("route"));
Copy link
Contributor

Choose a reason for hiding this comment

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

nit (not sure if the message is the most helpful one):

Suggested change
meta.add_error(Error::expected("route"));
meta.add_error(Error::expected("route expected to be an object"));

@olksdr
Copy link
Contributor Author

olksdr commented Feb 14, 2024

Thanks for the fix!

I wonder if we should document this in the trace context to avoid similar issues in the future.

added docs getsentry/develop#1157

@olksdr olksdr requested a review from a team February 14, 2024 13:12
@olksdr olksdr merged commit a9baace into master Feb 15, 2024
20 checks passed
@olksdr olksdr deleted the fix/data-route-in-trace-context branch February 15, 2024 08:22
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.

contexts.trace.data.route getting rejected by Sentry
3 participants