feat(ourlogs): Add trace items attributes endpoints#87343
Merged
Conversation
Since logs and spans (etc.) are moving towards the generic trace items, this adds an endpoint for use with search autocomplete on the frontend. This ports the EAP side of /spans/fields and makes both sides accept an item_type in lieu of dataset. Attribute values are not yet supported for EAP trace items.
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #87343 +/- ##
==========================================
+ Coverage 87.73% 87.80% +0.06%
==========================================
Files 9865 9872 +7
Lines 558997 559548 +551
Branches 22041 22041
==========================================
+ Hits 490453 491302 +849
+ Misses 68113 67815 -298
Partials 431 431 |
Contributor
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
andrewshie-sentry
pushed a commit
that referenced
this pull request
Mar 27, 2025
### Summary Since logs and spans (etc.) are moving towards the generic trace items, this adds an endpoint for use with search autocomplete on the frontend, which we can eventually use for any search relating to eap items. This mostly ports the EAP side of the `/spans/fields/` endpoints (organization_spans_fields.py) and makes both endpoints accept an item_type in lieu of dataset. Returning all attr keys and fetching attr values are not yet supported for EAP trace items (see skipped tests).
Comment on lines
+68
to
+69
| def is_valid_item_type(item_type: str) -> bool: | ||
| return item_type in [e.value for e in TraceItemType] |
Contributor
There was a problem hiding this comment.
this function is never called -- intentional?
Comment on lines
+80
to
+85
| def resolve_attribute_values_referrer(item_type: str) -> Referrer: | ||
| return ( | ||
| Referrer.API_SPANS_TAG_VALUES_RPC | ||
| if item_type == TraceItemType.SPANS.value | ||
| else Referrer.API_LOGS_TAG_VALUES_RPC | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Since logs and spans (etc.) are moving towards the generic trace items, this adds an endpoint for use with search autocomplete on the frontend, which we can eventually use for any search relating to eap items.
This mostly ports the EAP side of the
/spans/fields/endpoints (organization_spans_fields.py) and makes both endpoints accept an item_type in lieu of dataset. Returning all attr keys and fetching attr values are not yet supported for EAP trace items (see skipped tests).