shirudo upatch map#
List the pinned maps of the loaded upatches, print one map’s contents, or export maps as JSON lines, OTLP or S3 objects.
Runs on: target, as root with the runtime binary. Requires: loaded upatches with pinned maps. Changes measured state: no.
Usage#
shirudo upatch map [<upatch>] [--json | --json=<path>]
shirudo upatch map <upatch> <map> [--json | --json=<path>] [--show-full] [--peek]
[--otel [--otel-endpoint=<url>] [--tenant-id=<id>]
[--otel-insecure] [--otel-retries=<retries>]
[--s3-uri=<uri>]]
shirudo upatch map --all [--json | --json=<path>] [--show-full] [--peek]
[--otel [<otlp-options>]]
--json takes its path after = only. The other options with a
value take it after = or as the next argument.
Description#
Listing#
Without arguments, map lists every pinned map of every loaded upatch
with its type and maximum number of entries. With <upatch>, it lists the maps of that
upatch. --json prints the list as {"schema":1,"maps":[...]} with
upatch, name, type, max_entries and, for a per-CPU map,
n_cpus per map.
One map#
With <upatch> <map>, map reads the map:
A map is decoded through its BTF types when the build kept them (
shirudo buildcompiles with-g).When the upatch pins a serializer program for the map,
mapruns it and prints the pages it returns. Such a read drains the serializer: records it returns are gone for the next reader, the export timer included.--peekreads the interval being collected without taking it.The human output shows at most 256 entries unless
--show-full. JSON and OTLP output have no limit.--jsonprints one JSON line to standard output.--json=<path>appends it to<path>.--otelsends the map to an OTLP collector. A map with a signed Lua decoder is sent as the log or metric the decoder declares. A map without one is classified by shirudo (see Map logs and metrics).
Every map#
--all handles every map of every loaded upatch as above and loads the
map_export settings (Configuration):
map_export.json_path turns on JSON output to that file and
map_export.otel_endpoint turns on OTLP, together with the tenant,
TLS, retry, size and S3 settings. Options on the command line take
precedence.
With neither a JSON nor an OTLP destination, --all prints every map in
full detail on standard output, draining every serializer-backed map
unless --peek. shirudo-map-export.timer runs upatch map --all
every five seconds, so without a configured destination it drains the
maps into the journal.
Options#
Option |
Argument |
Default |
Description |
|---|---|---|---|
|
none |
off |
Handle every map of every loaded upatch. Takes no positional argument. |
|
optional |
off |
Print JSON, or append it to |
|
none |
off |
Lift the 256-entry limit of the human output. |
|
none |
off |
Read serializer-backed maps without draining them. |
|
none |
off |
Export through OTLP. Without |
|
|
|
OTLP base URL. The signal path is appended. |
|
|
|
Send an |
|
none |
|
Allow cleartext OTLP to a remote host, or turn off HTTPS certificate verification. |
|
|
3 |
Retries after the first attempt. |
|
|
|
Where to store an OTLP payload that is too large to send. |
The OTLP options require --otel. --all, --json, --otel and
each OTLP option may appear once.
Exit status#
Status |
Meaning |
|---|---|
0 |
Every map was read and exported. |
1 |
A map could not be read, written as JSON or sent. With |
2 |
A usage error: an unknown or repeated option, a value missing,
empty or invalid, positional arguments with
|
Files and environment#
Reads the pinned maps under
/run/shirudo/bpffs/upatches/Appends to the
--jsonormap_export.json_pathfileOTLP and S3: the
OTEL_EXPORTER_OTLP_*andAWS_*variables (see Environment variables).shirudo-map-export.servicereads them from/etc/shirudo/map-export.env
Examples#
List the pinned maps of a target without any:
target# shirudo upatch map
Pinned maps (0):
none
Look at a serializer-backed map without taking its records from the exporter:
target# shirudo upatch map kernel-obs exec --json --peek
Send one map to a collector:
target# shirudo upatch map kernel-obs exec --otel --otel-endpoint=https://collector.example:4318 --tenant-id=fleet-eu-1