Skip to content

feat: Add default metrics tags to Sentry errors#659

Open
untitaker wants to merge 1 commit into
mainfrom
mu/sentry-default-tags
Open

feat: Add default metrics tags to Sentry errors#659
untitaker wants to merge 1 commit into
mainfrom
mu/sentry-default-tags

Conversation

@untitaker
Copy link
Copy Markdown
Member

Summary

  • Reuse the default metrics tags (e.g. pool name, latency_tier) as Sentry tags so errors can be filtered/correlated with specific taskbroker instances
  • Add a taskbroker::tokio::spawn helper that propagates the main Sentry hub to spawned tasks, ensuring tags are available across all threads

Test plan

  • Deploy and verify tags appear on Sentry errors

🤖 Generated with Claude Code

Apply the same default tags used for metrics (pool name, latency_tier)
to Sentry errors, making it easier to filter and correlate errors with
specific taskbroker instances.

Uses configure_scope on the main thread and propagates the hub to
spawned tasks via a custom spawn helper.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@untitaker untitaker requested a review from a team as a code owner May 29, 2026 21:38
Comment thread src/tokio.rs
F: Future + Send + 'static,
F::Output: Send + 'static,
{
tokio::spawn(future.bind_hub(Hub::new_from_top(Hub::main())))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The compiler will probably inline all of this because it's so simple, but what if this was a macro?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

do you want this to be a macro in order for it to inline better? not sure I understand

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