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): Parse supabase span descriptions #3153

Merged
merged 3 commits into from
Feb 23, 2024
Merged

Conversation

jjbayer
Copy link
Member

@jjbayer jjbayer commented Feb 22, 2024

The description only contains the table name, e.g. "from(users)".
In the future, we might want to parse data.query as well.

See https://github.com/supabase-community/sentry-integration-js/blob/bae59de7e86c916d9396e2e2de55e6ac17e646d6/index.js#L259

@jjbayer jjbayer self-assigned this Feb 23, 2024
@jjbayer jjbayer marked this pull request as ready for review February 23, 2024 10:18
@jjbayer jjbayer requested a review from a team as a code owner February 23, 2024 10:18
@jjbayer jjbayer requested review from phacops and gggritso February 23, 2024 10:18
@@ -365,6 +365,12 @@ pub fn extract_tags(
} else {
None
}
} else if span.origin.as_str() == Some("auto.db.supabase") {
scrubbed_description.as_deref().map(|s| {
s.trim_start_matches("from(")
Copy link
Member

Choose a reason for hiding this comment

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

Should we enforce that this description always starts with from(?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, this actually surfaced a bug, see follow-up here: #3156

@jjbayer jjbayer merged commit dbfd1b3 into master Feb 23, 2024
23 checks passed
@jjbayer jjbayer deleted the feat/spans-db-supabase branch February 23, 2024 12:48
jjbayer added a commit that referenced this pull request Feb 23, 2024
jjbayer added a commit that referenced this pull request Feb 23, 2024
Follow-up for #3153:

* Only accept `from(...)`
* Accept table names without scrubbed identifiers.
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.

3 participants