-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
🤖 Enhance Tag Resolution and String Recording in Metrics Query Builder #77988
base: master
Are you sure you want to change the base?
🤖 Enhance Tag Resolution and String Recording in Metrics Query Builder #77988
Conversation
- Attempt to record unknown strings in the indexer - Handle unresolved and invalid tag keys gracefully - Add metrics for monitoring indexer behavior
- Attempt to record unknown strings in the indexer - Handle unresolved and invalid tag keys gracefully - Add metrics for monitoring indexer behavior
- Attempt to record unknown strings in the indexer - Handle unresolved and invalid tag keys gracefully - Add metrics for monitoring indexer behavior
- Attempt to record unknown strings in the indexer - Handle unresolved and invalid tag keys gracefully - Add metrics for monitoring indexer behavior
- Attempt to record unknown strings in the indexer - Handle unresolved and invalid tag keys gracefully - Add metrics for monitoring indexer behavior
- Change return type from `int | None` to `int` - Update docstring to specify exception raising on failure
- Handle unresolved and invalid tags in resolve_tags function - Create NULL columns for problematic tags - Ensure queries with unknown tags can still be executed
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: src/sentry/sentry_metrics/utils.py
📄 File: src/sentry/snuba/metrics/query_builder.py (Click to Expand)
Did you find this useful? React with a 👍 or 👎 |
❌ 4 Tests Failed:
View the top 3 failed tests by shortest run time
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you add the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you add the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
👋 Hi there! This PR was automatically generated by Autofix 🤖
This fix was triggered by [email protected]
Fixes SENTRY-3A6J
This update introduces several improvements and new functionalities to the metrics query builder and related utilities:
Tag Resolution Handling: In
query_builder.py
, theresolve_tag_key
function now checks if the resolved tag starts with 'unresolved_tag[' or 'invalid_tag['. If so, it returns a NULL column representation using the newcreate_null_column
function.String Recording Attempts: In
utils.py
, theresolve
function now attempts to record an unknown string up to a maximum of 3 times (MAX_RECORD_ATTEMPTS
). If recording fails, it raises aMetricIndexNotFound
exception. Metrics are recorded for each attempt and any errors encountered.Unresolved and Invalid Tag Metrics: The
resolve_tag_key
function inutils.py
now increments specific metrics when encountering unresolved or negative tag keys, returning a formatted string indicating the issue.Indexer Interface Update: The
record
method in theIndexer
base class (indexer/base.py
) now specifies that it should raise an exception if the string cannot be recorded, ensuring consistent error handling across implementations.If you have any questions or feedback for the Sentry team about this fix, please email [email protected] with the Run ID (see below).
🤓 Stats for the nerds:
Run ID: 925
Prompt tokens: 452319
Completion tokens: 10918
Total tokens: 463237