prometheus_text_format (prometheus v6.1.1)
View SourceSerializes Prometheus registry using the latest text format.
Example output:
# TYPE http_request_duration_milliseconds histogram
# HELP http_request_duration_milliseconds Http Request execution time
http_request_duration_milliseconds_bucket{method=\"post\",le=\"100\"} 0
http_request_duration_milliseconds_bucket{method=\"post\",le=\"300\"} 1
http_request_duration_milliseconds_bucket{method=\"post\",le=\"500\"} 3
http_request_duration_milliseconds_bucket{method=\"post\",le=\"750\"} 4
http_request_duration_milliseconds_bucket{method=\"post\",le=\"1000\"} 5
http_request_duration_milliseconds_bucket{method=\"post\",le=\"+Inf\"} 6
http_request_duration_milliseconds_count{method=\"post\"} 6
http_request_duration_milliseconds_sum{method=\"post\"} 4350
Summary
Functions
Returns content type of the latest [text format](https://bit.ly/2cxSuJP).
Escapes the backslash (\), double-quote (\"), and line feed (\n) characters
Equivalent to format(default).
Formats Registry using the latest text format.
Formats Registry using the latest text format, passing the binary data for
each collector to the format function.
Functions
-spec content_type() -> binary().
Returns content type of the latest [text format](https://bit.ly/2cxSuJP).
Escapes the backslash (\), double-quote (\"), and line feed (\n) characters
-spec format() -> binary().
Equivalent to format(default).
Formats default registry using the latest text format.
-spec format(Registry :: prometheus_registry:registry()) -> binary().
Formats Registry using the latest text format.
-spec format_into(Registry :: prometheus_registry:registry(), fun((term(), binary()) -> term()), term()) -> term().
Formats Registry using the latest text format, passing the binary data for
each collector to the format function.