Skip to content
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(spans): Record resource spans for clustering #58689

Merged
merged 5 commits into from
Nov 15, 2023

Conversation

jjbayer
Copy link
Member

@jjbayer jjbayer commented Oct 24, 2023

We previously only recorded span description for URL clustering if the span op was http. For those spans, the clustering results are not used anymore because we scrub HTTP spans more radically these days.

Record & cluster resource spans instead, because for those, we still keep URL segments under specific circumstances.

Update 2023-11-14: This PR now also removes the clustering rules from project configs entirely, and as an experiment sets the span clustering threshold to 50.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 24, 2023
)
assert len(mocked_record.mock_calls) == expected


Copy link
Member Author

Choose a reason for hiding this comment

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

We only look at the scrubbed description for resource spans, so this test case seemed redundant (there is already a test_record_span_desc_url).

if len(tokens) != 2:
return None
url = tokens[1]
return urlparse(url).path
Copy link
Member Author

Choose a reason for hiding this comment

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

Resource spans do not have a GET prefix, so this helper can be removed.

@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Merging #58689 (3a87589) into master (42a9604) will decrease coverage by 0.01%.
Report is 8 commits behind head on master.
The diff coverage is 66.66%.

❗ Current head 3a87589 differs from pull request most recent head 8c21df6. Consider uploading reports for the commit 8c21df6 to get more accurate results

@@            Coverage Diff             @@
##           master   #58689      +/-   ##
==========================================
- Coverage   80.59%   80.58%   -0.01%     
==========================================
  Files        5151     5151              
  Lines      225411   225405       -6     
  Branches    37983    37982       -1     
==========================================
- Hits       181667   181648      -19     
- Misses      38192    38203      +11     
- Partials     5552     5554       +2     
Files Coverage Δ
...y/ingest/transaction_clusterer/datasource/redis.py 91.59% <66.66%> (-1.21%) ⬇️

... and 8 files with indirect coverage changes

@jjbayer jjbayer marked this pull request as ready for review October 24, 2023 14:14
@jjbayer jjbayer requested review from a team, phacops and iker-barriocanal October 24, 2023 14:14
@@ -201,37 +199,28 @@ def record_span_descriptions(


def _get_span_description_to_store(span: Mapping[str, Any]) -> Optional[str]:
if not span.get("op", "").startswith("http"):
if not span.get("op") in ("resource.css", "resource.js"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is resource.js an op? I don't see it documented in dev docs. Related -- should we include more resource.* spans?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for catching this:

/// A list of patterns for resource span ops we'd like to ingest.
const RESOURCE_SPAN_OPS: &[&str] = &["resource.script", "resource.css"];

@@ -201,37 +199,28 @@ def record_span_descriptions(


def _get_span_description_to_store(span: Mapping[str, Any]) -> Optional[str]:
if not span.get("op", "").startswith("http"):
if not span.get("op") in ("resource.css", "resource.js"):
Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for catching this:

/// A list of patterns for resource span ops we'd like to ingest.
const RESOURCE_SPAN_OPS: &[&str] = &["resource.script", "resource.css"];

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@jjbayer
Copy link
Member Author

jjbayer commented Oct 27, 2023

After some discussion we decided to go with a deterministic approach for now. See getsentry/relay#2654.

@jjbayer jjbayer closed this Oct 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Nov 11, 2023
@jjbayer
Copy link
Member Author

jjbayer commented Nov 14, 2023

Update: We will not enforce discovered rules in relay, but will use the clusterer to collect patterns that might be converted to manual rules.

@jjbayer jjbayer reopened this Nov 14, 2023
@jjbayer jjbayer marked this pull request as draft November 14, 2023 18:18
@jjbayer jjbayer marked this pull request as ready for review November 14, 2023 21:06
@jjbayer jjbayer merged commit 413aa0f into master Nov 15, 2023
@jjbayer jjbayer deleted the feat/spans-record-resource-spans branch November 15, 2023 15:06
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.

None yet

3 participants