streaming_metrics v2.1.7 StreamingMetrics.PrometheusMetricCollector View Source
Prometheus backend.
It is the client's responsibility to expose the metrics to prometheus via a scrape endpoint or the Pushgateway. This module simply creates and increments the counters.
Link to this section Summary
Functions
Formats info into a format record_metrics
understands.
timestamp
is ignored because Prometheus handles timestamps
Callback implementation for StreamingMetrics.MetricCollector.init/0
Declares Prometheus counter metrics, if it doesn't exist, and increments them.
Metrics are recorded in Prometheus in the following format.
{namespace}_{metric.name}
Spaces are replaced with underscores for compatibility with Prometheus
Link to this section Functions
count_metric(count, name, dimensions \\ [], timestamp \\ []) View Source
Formats info into a format record_metrics
understands.
timestamp
is ignored because Prometheus handles timestamps.
init() View Source
Callback implementation for StreamingMetrics.MetricCollector.init/0
.
record_metrics(metrics, namespace) View Source
Declares Prometheus counter metrics, if it doesn't exist, and increments them.
Metrics are recorded in Prometheus in the following format.
{namespace}_{metric.name}
Spaces are replaced with underscores for compatibility with Prometheus.