Skip to main content

Module metrics_adapter

Module metrics_adapter 

Source
Expand description

Sends the batches of the SentryPolicy through the Sentry SDK.

StructsΒ§

CheckedTransport πŸ”’
Creates the SDK’s default transport, and gives it to a TransportCheck.
Pace πŸ”’
Spaces out the envelopes of a flush, until stop is called.
TransportCheck πŸ”’
Checks whether a Sentry transport has sent every envelope queued before the check, one check at a time, on the thread that calls run.

ConstantsΒ§

ENVELOPE_INTERVAL πŸ”’
How long the flush thread waits between the envelopes of one flush.
TRANSPORT_WAIT πŸ”’
How long a flush waits for the Sentry transport to send what is already in its queue, before it sends nothing instead.
UNIT_OVERRIDES πŸ”’
The Sentry units of metrics whose unit [metrics::Unit] can’t express.

StaticsΒ§

PACE πŸ”’
Spaces out the envelopes of periodic flushes until Zebra shuts down.
POLICY πŸ”’
The policy that every metric goes through once start has created it.
TRANSPORT πŸ”’
Checks the transport that transport_factory creates for the Sentry client.

FunctionsΒ§

flush_at_exit πŸ”’
Makes a periodic flush in progress send the rest of its batch at once, then sends what is due at once, if start has created the policy and the transport has sent what earlier flushes queued. Zebra calls this when it shuts down or panics.
flush_paced πŸ”’
Flushes policy if transport_ready returns true, and sends the batch paced by pace.
lock πŸ”’
log_attribute πŸ”’
send πŸ”’
Captures each metric in batch on the current Sentry hub.
send_paced πŸ”’
Calls send with batch in envelope-sized parts, waiting on pace between parts.
sentry_unit πŸ”’
Returns the Sentry unit for unit, or None for a count or a unit Sentry doesn’t have.
start πŸ”’
Returns the policy, creating it, a thread that flushes it every FLUSH_INTERVAL, and a thread that checks the Sentry transport for those flushes, on the first call. Returns None and logs an error if those threads can’t start.
start_with πŸ”’
Creates the policy in policy only if spawn_flush starts the threads that flush it.
transport_factory πŸ”’
Returns the factory of the Sentry client’s transport: the SDK’s default transport, which metrics flushes check before they send.
transport_ready πŸ”’
Returns whether the Sentry transport has sent everything queued before, waiting up to TRANSPORT_WAIT for it.