TimelessMetrics.PrometheusNif (timeless_metrics v6.2.2)

Copy Markdown View Source

NIF-based Prometheus text format parser.

Parses the entire Prometheus exposition body in a single NIF call, returning {entries, error_count} where entries is a list of {metric_name, labels_proplist, value, timestamp} tuples.

Lines without timestamps use 0 as sentinel.

Backed by the Rust parser in native/tms_engine (it replaced an earlier C++ NIF). Entry binaries are zero-copy sub-binaries of body: they keep the whole body alive until garbage collected, so anything storing them long-term must :binary.copy/1 them first.

Summary

Functions

Check if the NIF is loaded and available.

Parse Prometheus text format body.

Functions

available?()

Check if the NIF is loaded and available.

parse(body)

Parse Prometheus text format body.

Returns {entries, error_count} where entries is a list of {metric_name, labels_proplist, value, timestamp} tuples.