@@ -18,23 +18,23 @@ class MetricsBatcher(Batcher["Metric"]):
1818 CONTENT_TYPE = "application/vnd.sentry.items.trace-metric+json"
1919
2020 @staticmethod
21- def _to_transport_format (metric : "Metric" ) -> "Any" :
21+ def _to_transport_format (item : "Metric" ) -> "Any" :
2222 res = {
23- "timestamp" : metric ["timestamp" ],
24- "trace_id" : metric ["trace_id" ],
25- "name" : metric ["name" ],
26- "type" : metric ["type" ],
27- "value" : metric ["value" ],
23+ "timestamp" : item ["timestamp" ],
24+ "trace_id" : item ["trace_id" ],
25+ "name" : item ["name" ],
26+ "type" : item ["type" ],
27+ "value" : item ["value" ],
2828 "attributes" : {
29- k : serialize_attribute (v ) for (k , v ) in metric ["attributes" ].items ()
29+ k : serialize_attribute (v ) for (k , v ) in item ["attributes" ].items ()
3030 },
3131 }
3232
33- if metric .get ("span_id" ) is not None :
34- res ["span_id" ] = metric ["span_id" ]
33+ if item .get ("span_id" ) is not None :
34+ res ["span_id" ] = item ["span_id" ]
3535
36- if metric .get ("unit" ) is not None :
37- res ["unit" ] = metric ["unit" ]
36+ if item .get ("unit" ) is not None :
37+ res ["unit" ] = item ["unit" ]
3838
3939 return res
4040
0 commit comments