Skip to content

Commit

Permalink
fix(metrics): Change data_category from statsd to metric_bucket (
Browse files Browse the repository at this point in the history
…#2954)

The event category for emitted metrics is metric_bucket and not statsd.

---------

Co-authored-by: Anton Pirker <anton.pirker@sentry.io>
  • Loading branch information
cleptric and antonpirker committed Apr 10, 2024
1 parent fab65e6 commit e22abb6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sentry_sdk/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
"session",
"internal",
"profile",
"statsd",
"metric_bucket",
"monitor",
]
SessionStatus = Literal["ok", "exited", "crashed", "abnormal"]
Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def data_category(self):
elif ty == "profile":
return "profile"
elif ty == "statsd":
return "statsd"
return "metric_bucket"
elif ty == "check_in":
return "monitor"
else:
Expand Down
5 changes: 0 additions & 5 deletions sentry_sdk/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,6 @@ def record_lost_event(
# quantity of 0 is actually 1 as we do not want to count
# empty attachments as actually empty.
quantity = len(item.get_bytes()) or 1
if data_category == "statsd":
# The envelope item type used for metrics is statsd
# whereas the client report category for discarded events
# is metric_bucket
data_category = "metric_bucket"

elif data_category is None:
raise TypeError("data category not provided")
Expand Down

0 comments on commit e22abb6

Please sign in to comment.