Skip to content

Commit

Permalink
ref(crons): Reduce metric cardinality on monitor consumer (#54296)
Browse files Browse the repository at this point in the history
Reduces metric cardinality on monitor consumer by stripping out version
number & retaining only language + platform
  • Loading branch information
rjo100 authored Aug 8, 2023
1 parent 3daf1ed commit fa60cef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sentry/monitors/consumers/monitor_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,12 @@ def _process_message(ts: datetime, wrapper: CheckinMessage) -> None:

ratelimit_key = f"{project.organization_id}:{monitor_slug}:{environment}"

# Strip sdk version to reduce metric cardinality
sdk_platform = source_sdk.split("/")[0] if source_sdk else "none"

metric_kwargs = {
"source": "consumer",
"source_sdk": source_sdk,
"sdk_platform": sdk_platform,
}

if killswitch_matches_context(
Expand Down

0 comments on commit fa60cef

Please sign in to comment.