Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Prometheus to KairosDB remote storage adapter

License

Notifications You must be signed in to change notification settings

proofpoint/prom-to-kairosdb

Repository files navigation

prom-to-kairosdb

Build Status Go Report Card

prom-to-kairosdb is a remote storage adapter for Prometheus that listens for metrics from Prometheus remote write service, and pushes to downstream KairosDB.

It exposes following end points:

Endpoint Details
/write Listens to metrics from Prometheus, reformat them, and push to KairosDB
/metrics exposed the metrics for the prom-to-kairosdb itself

By default the service starts on port 9201.

Relabeling

Like Prometheus, this service also supports a few relabeling features. e.g. if you want to drop an unwanted metric or keep only specific metrics or rename the metric itself etc.

Following are the Action it supports:

Action Details Example
keep drops any metrics for which the provided sourcelabels does not matches the regex.
drop drops any metrics for which the provided sourcelabels matches the regex.
labelkeep drops any label not matching the regex.
labeldrop drops any label matching the regex.
addprefix Adds prefix to the metric name that matches the regex.

Examples

drop the metrics that matches regex

#drop the metric if metricname (identified by __name__) matches regex 'my_too_large_metric'
metric_relabel_configs:
   - source_labels: [ __name__ ]
     regex: 'my_too_large_metric'
     action: drop

keep the metric that matches regex (drop everything else)

#keep the metric if metricname (identified by __name__) matches regex 'my_imp_metric'
metric_relabel_configs:
   - source_labels: [ __name__ ]
     regex: 'my_imp_metric'
     action: keep

drop the labels that matches regex

#drop the label that does match regex 'label-not-needed'
metric_relabel_configs:
   - regex: 'label-not-needed'
     action: labeldrop

keep the labels that match regex

#drop the labels that does not match regex 'label-not-needed'
metric_relabel_configs:
   - regex: 'label-needed'
     action: labelkeep

Add prefix to the metricname where sourcelabels values match regex

#Add the prefix to the metric name if the value of tagName in the metric tags, matches the regex 'tagValue'
metric_relabel_configs:
   - source_labels: [ tagName ]
     regex: 'tagValue'
     action: keep