View Source Sentry.Metric (Sentry v13.0.1)
Represents a metric that can be sent to Sentry.
Metrics follow the Sentry Metrics Protocol as defined in: https://develop.sentry.dev/sdk/telemetry/metrics/
This module is used by Sentry.Metrics to create and send metric data to Sentry.
Summary
Functions
Attaches default attributes to a metric.
Converts a metric to a map suitable for JSON encoding.
Types
Functions
Attaches default attributes to a metric.
This adds Sentry-specific attributes like environment, release, SDK info, and server name.
Per the Sentry Metrics spec, default attributes should be attached before the
before_send_metric callback is applied (step 5 before step 6).
Converts a metric to a map suitable for JSON encoding.
The output matches the Sentry metrics schema with top-level fields: timestamp, type, name, value, unit, trace_id, span_id, and attributes. The attributes are formatted with type information as required by the protocol.