Skip to content

Commit e22abb6

Browse files
fix(metrics): Change data_category from statsd to metric_bucket (#2954)
The event category for emitted metrics is metric_bucket and not statsd. --------- Co-authored-by: Anton Pirker <[email protected]>
1 parent fab65e6 commit e22abb6

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

sentry_sdk/_types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
"session",
114114
"internal",
115115
"profile",
116-
"statsd",
116+
"metric_bucket",
117117
"monitor",
118118
]
119119
SessionStatus = Literal["ok", "exited", "crashed", "abnormal"]

sentry_sdk/envelope.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def data_category(self):
261261
elif ty == "profile":
262262
return "profile"
263263
elif ty == "statsd":
264-
return "statsd"
264+
return "metric_bucket"
265265
elif ty == "check_in":
266266
return "monitor"
267267
else:

sentry_sdk/transport.py

-5
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,6 @@ def record_lost_event(
222222
# quantity of 0 is actually 1 as we do not want to count
223223
# empty attachments as actually empty.
224224
quantity = len(item.get_bytes()) or 1
225-
if data_category == "statsd":
226-
# The envelope item type used for metrics is statsd
227-
# whereas the client report category for discarded events
228-
# is metric_bucket
229-
data_category = "metric_bucket"
230225

231226
elif data_category is None:
232227
raise TypeError("data category not provided")

0 commit comments

Comments
 (0)