-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat: Expose sentry conventions in UI #92370
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: Expose sentry conventions in UI #92370
Conversation
return list( | ||
filter( | ||
lambda x: not is_sentry_convention_replacement_attribute( | ||
x["name"], trace_item_type | ||
), | ||
[ | ||
as_attribute_key( | ||
attribute.name, serialized["attribute_type"], trace_item_type | ||
) | ||
for attribute in rpc_response.attributes | ||
if attribute.name and can_expose_attribute(attribute.name, trace_item_type) | ||
], | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filter out all the sentry-conventions attributes
SPAN_ATTRIBUTE_DEFINITIONS[replacement] = replace( | ||
deprecated_attr, public_alias=replacement, internal_name=replacement | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing a replace
here so that I can preserve search_type if it's already defined and added a TODO to introduce units to the schema.
SPAN_ATTRIBUTE_DEFINITIONS[key] = ResolvedAttribute( | ||
public_alias=key, | ||
internal_name=key, | ||
search_type=attr_type, | ||
replacement=replacement, | ||
deprecation_status=status, | ||
) | ||
|
||
SPAN_ATTRIBUTE_DEFINITIONS[replacement] = ResolvedAttribute( | ||
public_alias=replacement, | ||
internal_name=replacement, | ||
search_type=attr_type, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds the deprecated attributes to the definitions if they don't already exist so they get replaced with the new convention correctly.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #92370 +/- ##
==========================================
+ Coverage 87.89% 87.94% +0.05%
==========================================
Files 10226 10216 -10
Lines 586028 585322 -706
Branches 22763 22638 -125
==========================================
- Hits 515112 514790 -322
+ Misses 70487 70076 -411
- Partials 429 456 +27 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments mostly, as discussed in slack:
the json is a short-term solution but long term will be replaced by a package 👍
try: | ||
with open(os.path.join(SENTRY_CONVENTIONS_DIRECTORY, "deprecated_attributes.json"), "rb") as f: | ||
DEPRECATED_ATTRIBUTES = json.loads(f.read())["attributes"] | ||
except Exception: | ||
logger.exception("Failed to load deprecated attributes from 'deprecated_attributes.json'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to this check 🤔 would it help to have a test that would effectively make sure that the json is accessible and valid?
@@ -0,0 +1,938 @@ | |||
{ | |||
"_generated": "This file is generated. Do not modify it directly. See scripts/generate_deprecated_attributes_json.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file being added separately? Should we merge it in first before landing this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping previous comment to explain why; I think we should change the text here so its clearer that its from another Repo
|
||
attribute_keys[attr_key["name"]] = attr_key | ||
|
||
return list(attribute_keys.values()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be worth tagging the two lists & feature flag state?
Adds support to expose sentry conventions for deprecated attributes behind a feature flag.
Adds support to expose sentry conventions for deprecated attributes
behind a feature flag.