Skip to content

Conversation

@jasonyuezhang
Copy link
Owner

Group type is a more meaningful distinction than it was in the pre-ACI world; tagging it will make issues easier to diagnose.


Copied from getsentry#102186
Original PR: getsentry#102186

@propel-test-bot
Copy link

Add group_type tag to status-change consumer spans

Introduces a new application-level observability tag so that traces and errors processed by the status-change consumer include a group_type dimension. This helps differentiate issue types when diagnosing ingestion problems.

Key Changes

• Imported sentry_sdk in src/sentry/issues/status_change_consumer.py
• Added sentry_sdk.set_tag("group_type", group.issue_type.slug) immediately after resolving the Group object

Affected Areas

src/sentry/issues/status_change_consumer.py

This summary was automatically generated by @propel-code-bot

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return None
txn.set_tag("group_id", group.id)

sentry_sdk.set_tag("group_type", group.issue_type.slug)

Choose a reason for hiding this comment

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

P1 Badge Avoid setting global Sentry tag in message loop

The new sentry_sdk.set_tag("group_type", …) call writes to the global scope rather than the transaction that is already being passed around and tagged via txn.set_tag. In the Kafka consumer this scope persists across messages, so the last processed group’s type will remain attached to subsequent unrelated events and the tag will not appear on the transaction itself. Use txn.set_tag("group_type", group.issue_type.slug) (like the other tags above) to ensure the tag applies to the current message only.

Useful? React with 👍 / 👎.

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