NAME
Sentry::Envelope::Item - One item of an envelope, e.g. an event
SYNOPSIS
for my $item ($envelope->items->@*) {
next if $item->type ne 'event';
say $item->payload->{event_id};
}
DESCRIPTION
An item of a Sentry::Envelope, see envelope items.
ATTRIBUTES
type
The item type, e.g. event, transaction or client_report.
payload
The content: a data structure, serialized as JSON, or a byte string.
headers
Further item headers, a hash reference (type and length are added on serialization).
METHODS
category
The data category of the item type, e.g. error for event, which rate limits and client reports count by; default for unknown types.
serialize
my $bytes = $item->serialize;
The item headers as JSON line, followed by the payload.
INTERNAL METHODS
Used by the SDK; not part of the public API, may change without notice.
for_event
The item of an error, message, transaction or feedback event.
for_batch
my $item = Sentry::Envelope::Item->for_batch(log => \@logs);
The item of a batch of logs (log) or metrics (trace_metric).
quantities
What a discarded item counts as in client reports: a transaction also counts its spans, a batch its logs or metrics and their size in bytes, an attachment its size in bytes.
INTERNAL_CATEGORY
A constant: the category of SDK-internal items (client reports), which is never rate limited nor reported as discarded.