Skip to content

Latest commit

 

History

History
104 lines (67 loc) · 3.05 KB

prometheus_text_format.md

File metadata and controls

104 lines (67 loc) · 3.05 KB

Module prometheus_text_format

.

Behaviours: prometheus_format.

Description

Serializes 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

Function Index

content_type/0 Returns content type of the latest [text format](http://bit.ly/2cxSuJP).
escape_label_value/1 Escapes the backslash (\), double-quote ("), and line feed (\n) characters.
format/0 Formats default registry using the latest text format.
format/1 Formats Registry using the latest text format.
render_labels/1

Function Details

content_type/0


content_type() -> binary()

Returns content type of the latest text format.

escape_label_value/1


escape_label_value(LValue::binary() | iolist()) -> binary()

Escapes the backslash (), double-quote ("), and line feed (\n) characters

format/0


format() -> binary()

Equivalent to format(default).

Formats default registry using the latest text format.

format/1


format(Registry::prometheus_registry:registry()) -> binary()

Formats Registry using the latest text format.

render_labels/1


render_labels(B::binary() | [prometheus_model:'LabelPair'() | binary()]) -> binary()