Module prometheus_model_helpers

Helpers for working with Prometheus data model.

Description

Helpers for working with Prometheus data model. For advanced users. Probably will be used with prometheus_collector.

Data Types

label()

label() = {label_name(), label_value()}

label_name()

label_name() = term()

label_value()

label_value() = term()

prometheus_boolean()

prometheus_boolean() = boolean() | number() | list() | undefined

value()

value() = float() | integer() | undefined | infinity

Function Index

boolean_metric/1 Equivalent to boolean_metric(Labels, Value).
boolean_metric/2 Creates boolean metric with Labels and Value.
boolean_metrics/1Equivalent to lists:map(fun boolean_metric/1, Values).
counter_metric/1 Equivalent to counter_metric(Labels, Value).
counter_metric/2 Creates counter metric with Labels and Value.
counter_metrics/1Equivalent to lists:map(fun counter_metric/1, Specs).
create_mf/5 Create Metric Family of Type, Name and Help.
gauge_metric/1 Equivalent to gauge_metric(Labels, Value).
gauge_metric/2 Creates gauge metric with Labels and Value.
gauge_metrics/1Equivalent to lists:map(fun gauge_metric/1, Values).
histogram_metric/1 Equivalent to histogram_metric(Labels, Buckets, Count, Sum).
histogram_metric/3Equivalent to histogram_metric([], Buckets, Count, Sum).
histogram_metric/4 Creates histogram metric with Labels, Buckets, Count and Sum.
histogram_metrics/1Equivalent to lists:map(fun histogram_metric/1, Specs).
label_pair/1 Creates prometheus_model:LabelPair'()' from {Name, Value} tuple.
label_pairs/1Equivalent to lists:map(fun label_pair/1, Labels).
summary_metric/1 Equivalent to summary_metric(Labels, Count, Sum).
summary_metric/2Equivalent to summary_metric([], Count, Sum).
summary_metric/3 Creates summary metric with Labels, Count and Sum.
summary_metrics/1Equivalent to lists:map(fun summary_metric/1, Specs).
untyped_metric/1 Equivalent to untyped_metric(Labels, Value).
untyped_metric/2 Creates untyped metric with Labels and Value.
untyped_metrics/1Equivalent to lists:map(fun untyped_metric/1, Values).

Function Details

boolean_metric/1

boolean_metric(Spec) -> prometheus_model:'Metric'()

Equivalent to boolean_metric(Labels, Value).

boolean_metric/2

boolean_metric(Labels, Value) -> prometheus_model:'Metric'()

Creates boolean metric with Labels and Value.

boolean_metrics/1

boolean_metrics(Values) -> any()

Equivalent to lists:map(fun boolean_metric/1, Values).

counter_metric/1

counter_metric(Spec) -> prometheus_model:'Metric'()

Equivalent to counter_metric(Labels, Value).

counter_metric/2

counter_metric(Labels, Value) -> prometheus_model:'Metric'()

Creates counter metric with Labels and Value.

counter_metrics/1

counter_metrics(Specs) -> any()

Equivalent to lists:map(fun counter_metric/1, Specs).

create_mf/5

create_mf(Name, Help, Type, Collector, CollectorData) -> MetricFamily

Create Metric Family of Type, Name and Help. Collector:collect_metrics/2 callback will be called and expected to return individual metrics list.

gauge_metric/1

gauge_metric(Spec) -> prometheus_model:'Metric'()

Equivalent to gauge_metric(Labels, Value).

gauge_metric/2

gauge_metric(Labels, Value) -> prometheus_model:'Metric'()

Creates gauge metric with Labels and Value.

gauge_metrics/1

gauge_metrics(Values) -> any()

Equivalent to lists:map(fun gauge_metric/1, Values).

histogram_metric/1

histogram_metric(Spec) -> prometheus_model:'Metric'()

Equivalent to histogram_metric(Labels, Buckets, Count, Sum).

histogram_metric/3

histogram_metric(Buckets, Count, Sum) -> any()

Equivalent to histogram_metric([], Buckets, Count, Sum).

histogram_metric/4

histogram_metric(Labels, Buckets, Count, Sum) -> Metric

Creates histogram metric with Labels, Buckets, Count and Sum.

histogram_metrics/1

histogram_metrics(Specs) -> any()

Equivalent to lists:map(fun histogram_metric/1, Specs).

label_pair/1

label_pair(X1::label()) -> prometheus_model:'LabelPair'()

Creates prometheus_model:LabelPair'()' from {Name, Value} tuple.

label_pairs/1

label_pairs(Labels) -> any()

Equivalent to lists:map(fun label_pair/1, Labels).

summary_metric/1

summary_metric(Spec) -> prometheus_model:'Metric'()

Equivalent to summary_metric(Labels, Count, Sum).

summary_metric/2

summary_metric(Count, Sum) -> any()

Equivalent to summary_metric([], Count, Sum).

summary_metric/3

summary_metric(Labels, Count, Sum) -> prometheus_model:'Metric'()

Creates summary metric with Labels, Count and Sum.

summary_metrics/1

summary_metrics(Specs) -> any()

Equivalent to lists:map(fun summary_metric/1, Specs).

untyped_metric/1

untyped_metric(Spec) -> prometheus_model:'Metric'()

Equivalent to untyped_metric(Labels, Value).

untyped_metric/2

untyped_metric(Labels, Value) -> prometheus_model:'Metric'()

Creates untyped metric with Labels and Value.

untyped_metrics/1

untyped_metrics(Values) -> any()

Equivalent to lists:map(fun untyped_metric/1, Values).


Generated by EDoc