biggraphite
biggraphite copied to clipboard
Prometheus read/write support
See https://github.com/prometheus/prometheus/blob/HEAD/storage/remote/remote.proto for the protocol
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.
Work ongoing on https://github.com/criteo/graphite-remote-adapter