Tenzir keeps track of metrics about node resource usage, pipeline state, and runtime performance.
Metrics are stored as internal events in the node’s storage engine, allowing you
to work with metrics just like regular data. Use the
metrics input operator to access the
metrics. The operator documentation lists all available
metrics in detail.
The metrics operator provides a copy of existing metrics. You can use it
multiple time to reference the same metrics feed.
Write metrics to a file
Section titled “Write metrics to a file”Export metrics continuously to a file via metrics --live:
metrics live=truewrite_ndjsonsave_file "metrics.json", append=trueThis attaches to incoming metrics feed, renders them as NDJSON, and then writes
the output to a file. Without the live option, the metrics operator returns
the snapshot of all historical metrics.
Summarize metrics
Section titled “Summarize metrics”You can shape metrics like ordinary data, e.g., write aggregations over metrics to compute runtime statistics suitable for reporting or dashboarding:
metrics "operator"where sink == truesummarize runtime=sum(duration), pipeline_idsort -runtimeThe above example computes the total runtime over all pipelines grouped by their unique ID.