Map logs and metrics#
What shirudo upatch map --otel and shirudo upatch map --all
export from a upatch’s maps: a log record or the decoder’s metrics per
map, a reference to a snapshot stored in S3, or a line of JSON. The
transport, the endpoint and the resource it shares with the keepalive
are in OTLP documents.
Map snapshot log#
One log record per map:
Field |
Value |
|---|---|
|
Wall clock when shirudo builds the document, nanoseconds since the epoch, decimal string. |
|
|
|
|
|
The value the map’s decoder returns, as an OTLP value. Without a
decoder, a |
Attribute |
The upatch name. |
Attribute |
The upatch’s attach point. |
Attribute |
The map name. |
Attribute |
The map type name. |
Attribute |
Integer. |
Attribute |
Integer, entries read. |
Attribute |
Integer. |
Attribute |
Boolean, the map was read through its serializer. |
Attribute |
Boolean, the read stopped before the last entry. |
A decoded body larger than map_export.log_record_max_bytes (default
1048576, at most map_export.otlp_max_bytes) fails with E2BIG.
Undecoded body#
Key |
Value |
|---|---|
|
The map. |
|
Per-CPU maps only. |
|
Boolean. |
|
Serializer-backed maps. Each page has |
|
The reason, for a map type shirudo cannot read generically. |
|
Other maps. |
|
|
|
Each with |
Map metrics#
A decoder that declares the metric signal returns a list of OTLP
Metric objects. shirudo sends them as
resourceMetrics[0].scopeMetrics[0].metrics under the resource and
scope of Resource and scope and adds no attributes.
Signal selection#
Map |
Export |
|---|---|
Has a decoder |
The signal the decoder declares, log or metric. |
No decoder, unsigned per-CPU integer value |
Classified as a metric. Metrics come only from decoders, so the
export fails with |
No decoder, any other map |
Log record with the undecoded body. |
For an undecoded map upatch map prints the choice on standard
error as otel: selected <signal> for <type> map <name>: <reason>.
S3 snapshots#
When a decoded map’s document fails with E2BIG and an S3 URI is
set (--s3-uri=<uri> or map_export.s3_uri), shirudo uploads the
snapshot to S3 and sends a reference log record instead. Undecoded,
skipped and truncated maps are not uploaded.
map_export.s3_uri requires map_export.otel_endpoint.
Property |
Value |
|---|---|
URI |
|
Object |
The decoder’s JSON output, gzip-compressed, at most 64 MiB before compression. |
Key |
|
URL |
With |
Request |
|
Timeout and retries |
10 seconds per attempt. Retries as for OTLP, also on |
Cleartext |
As for OTLP, for |
Variable |
Value |
|---|---|
|
Required. Missing credentials fail with |
|
Sent as |
|
Region, in this order, default |
|
S3-compatible endpoint, path-style. |
|
CA bundle for the S3 endpoint. |
The reference log record goes to the logs endpoint, whatever signal
the decoder declares, and is not subject to
map_export.otlp_max_bytes:
Field |
Value |
|---|---|
|
|
|
|
|
|
Attributes |
The map snapshot attributes above, and
|
JSON lines#
map_export.json_path or upatch map --json=<path> appends one line
per map to a file, instead of OTLP or besides it. The line is the JSON
value the map’s decoder returns, not an OTLP document. A map without a
decoder fails with ENODATA. map_export.json_path must be an
absolute path. A file or directory that carries shirudo’s seal label is
refused. A new file gets mode 0644.