Skip to content

Commit

Permalink
feat(derived_code_mappings): Increase sample rate of creation metric (#…
Browse files Browse the repository at this point in the history
…86327)

It is a very low volume metric, thus, the base line value is useless.
I'm expecting that increasing the sampling rate will give us a more
accurate picture.

The screenshot shows what I mean by a useless baseline (it stats at nine
rather than zero):
<img width="494" alt="image"
src="https://github.com/user-attachments/assets/9560cccb-6100-46a0-ba30-82abf51c1ebd"
/>
  • Loading branch information
armenzg authored Mar 5, 2025
1 parent f15d287 commit 3750c7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/sentry/issues/auto_source_code_config/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,5 @@ def set_project_codemappings(
},
)
if created:
metrics.incr("code_mappings.created", tags={"platform": platform})
# Since it is a low volume event, we can sample at 100%
metrics.incr(key="code_mappings.created", tags={"platform": platform}, sample_rate=1.0)
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ def _process_and_assert_code_mapping(
code_mapping = code_mappings[0]
assert code_mapping.stack_root == expected_stack_root
assert code_mapping.source_root == expected_source_root
mock_incr.assert_called_with("code_mappings.created", tags={"platform": event.platform})
mock_incr.assert_called_with(
key="code_mappings.created", tags={"platform": event.platform}, sample_rate=1.0
)

def _process_and_assert_no_code_mapping(
self,
Expand Down

0 comments on commit 3750c7a

Please sign in to comment.