biggraphite icon indicating copy to clipboard operation
biggraphite copied to clipboard

Prometheus read/write support

Open iksaif opened this issue 7 years ago • 2 comments

See https://github.com/prometheus/prometheus/blob/HEAD/storage/remote/remote.proto for the protocol

iksaif avatar Mar 28 '17 06:03 iksaif

https://github.com/criteo/graphite-remote-adapter for the go part, which may have a biggraphite specific client.

First step: native Graphite implementation

Prefix all prometheus metrics by prometheus (or something configurable). Always call /find first to get the list of metric, then call render. We call render once per metric (or maybe batch). Only get data older than x amount of time (configurable)

  • metric => prometheus.metric
  • metric{label="value"} => prometheus.metric.** (check if we can stuf)
  • `metric{environment=~"staging|testing|development",method!="GET"} (metrics.**)

We will probably want to heavilly cache the results.

Second step: BigGraphite implementation

On the write path:

  • store the schema of the metric (how many labels, names of the labels). Put that in metrics_metadata.
  • in the metrics table, store the value of the labels as components.
  • cache the schema in carbon, if we receive a metric that doesn't match the current schema, discard it
  • add a tool to change the schema (probably duplicating part of what bgutil copy does).

For the read path:

  • =: easy
  • !=, =~, !~: wildcard plus post-filtering. Might do some prefix matching in some cases.

First, use the Graphite read path and chose some special characters to do {label=value}. Later, have our own fast-path for prometheus.

iksaif avatar Jun 03 '17 16:06 iksaif

Work ongoing on https://github.com/criteo/graphite-remote-adapter

iksaif avatar Jun 14 '17 08:06 iksaif