Skip to content

feat(ourlogs): Add trace items attributes endpoints#87343

Merged
k-fish merged 4 commits intomasterfrom
feat/ourlogs/add-trace-items-endpoints
Mar 19, 2025
Merged

feat(ourlogs): Add trace items attributes endpoints#87343
k-fish merged 4 commits intomasterfrom
feat/ourlogs/add-trace-items-endpoints

Conversation

@k-fish
Copy link
Copy Markdown
Member

@k-fish k-fish commented Mar 18, 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).

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.
@k-fish k-fish requested review from a team as code owners March 18, 2025 21:10
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 18, 2025
Copy link
Copy Markdown
Member

@wmak wmak left a comment

Choose a reason for hiding this comment

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

lgtm

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 75.48638% with 63 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...pi/endpoints/organization_trace_item_attributes.py 69.67% 47 Missing ⚠️
...dpoints/test_organization_trace_item_attributes.py 83.83% 16 Missing ⚠️
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              

@k-fish k-fish merged commit caa841c into master Mar 19, 2025
50 checks passed
@k-fish k-fish deleted the feat/ourlogs/add-trace-items-endpoints branch March 19, 2025 13:27
@sentry
Copy link
Copy Markdown
Contributor

sentry bot commented Mar 26, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ SnubaRPCError: code: 400 /api/0/organizations/{organization_id_or_slug}/... View Issue

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).
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2025
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]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

""

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants