Skip to main content

Prometheus Integration

At the front of the TSE, there is a Prometheus-compatible adapter. Without a separate Prometheus server, you can use collection (remote_write) and visualization (PromQL) exactly as in the Prometheus ecosystem.

[Prometheus · Grafana Agent] --remote_write--> TSE --> Cassandra
[Grafana (Prometheus 데이터소스)] --PromQL--> TSE
Not a separate process

The adapter runs as the same process inside the TSE's Jetty. There is nothing to launch and no extra port to open — paths are simply split at /prometheus (the TSE native API is at /api/v1/*). Authentication also uses the TSE's Basic Auth as-is.

1. Pushing data in — remote_write​

Write this in prometheus.yml or in your Grafana Agent configuration.

remote_write:
- url: http://<TSE 호스트>:7800/prometheus/api/v1/write
basic_auth:
username: tse
password: "<PP_TSE_PASSWORD>"

The payload is snappy-compressed + protobuf (remote_write 1.0), and Prometheus and Agent handle it automatically. On success you get 204, on a malformed payload 400 (no retry), and on a temporary failure 500 (with retry). NaN and ±Inf are discarded at the storage stage.

2. Viewing in Grafana​

Choose Prometheus as the datasource type and fill it in like this.

ItemValue
URLhttp://<TSE 호스트>:7800/prometheus
AccessServer (proxy)
AuthBasic auth — tse / <PP_TSE_PASSWORD>
HTTP MethodPOST recommended

When you click "Save & Test", Grafana recognizes it as Prometheus via /prometheus/api/v1/status/buildinfo. From then on, you can use PromQL as-is in panels.

Different path from the bundled PlantPulse Dashboard

TSE also has a bundled PlantPulse Dashboard that uses a dedicated datasource plugin. You can choose either one — if you're comfortable with PromQL, use this one; if you want ready-made dashboards, use the bundled one.

3. How it maps​

PrometheusTSE
__name__ labelMetric name
Other labelsTags
Sample (ts_ms, float64)DataPoint (double, ms)

Prometheus's naming rules ([a-zA-Z_:][a-zA-Z0-9_:]*) are compatible with TSE's, so everything moves over without loss.

4. Endpoints​

All are under /prometheus and follow the Prometheus HTTP API conventions ({"status":"success","data":…}).

Method·PathPurpose
POST /prometheus/api/v1/writeremote_write reception
GET·POST /prometheus/api/v1/queryInstant query
GET·POST /prometheus/api/v1/query_rangeRange query (start·end·step)
GET /prometheus/api/v1/labelsLabel names list
GET /prometheus/api/v1/label/{name}/valuesLabel values list
GET·POST /prometheus/api/v1/seriesSeries matching (match[])
GET /prometheus/api/v1/status/buildinfoGrafana recognition

Time is in Unix seconds (fractional allowed) or RFC3339, and step is 15s·1m·1h·500ms or unitless seconds. Timestamps in responses are in seconds, and values are strings (per the Prometheus convention).

5. Supported PromQL​

CategorySupported
Selectorsbare · matchers (= != =~ !~) · __name__ matcher · range selectors ([5m], unit ms s m h d w y)
Arithmeticnumeric literals · unary - · parentheses · + - * / (scalar∘scalar, vector∘scalar, vector∘vector 1-to-1)
Comparison== != > < >= <= (+ bool)
Functionsrate irate increase delta · abs clamp_min clamp_max · histogram_quantile
Aggregationsum avg min max count + by/without · topk bottomk
rate(errors[5m]) / rate(total[5m])
topk(5, sum(rate(req_total[5m])) by (path))
histogram_quantile(0.95, rate(latency_seconds_bucket[5m]))

6. Not supported — rejected with 400, not silently wrong​

CategoryNot supported
Vector matchingon(…) · ignoring(…) · group_left · group_right
Set operationsand · or · unless
Time functions*_over_time · predict_linear · holt_winters
Transformationssubquery(expr[5m:1m]) · @ modifier · offset
Othersscalar() vector() label_replace() label_join() sort() sort_desc() absent()
Protocolremote_read · remote_write 2.0 · exemplars · native histogram
Unsupported things come as "errors", not "wrong values"

Unsupported syntax is rejected with 400 {"status":"error","errorType":"bad_data",…}. This means it never silently provides plausible-looking numbers, so your dashboards will not lie without a word.

7. Subtle differences​

This is not a full Prometheus, but a compatible adapter. In practice this is usually not an issue, but you should be aware of it when you need to compare values precisely.

WhatHow it differs
rate·increase extrapolationIt linearly extrapolates over the entire observed range (Prometheus's boundary extrapolation cap is not implemented) — slight differences at range boundaries
range window[t-range, t] includes both endpoints (Prometheus uses left-open intervals). The lookback for instant selectors is the same as (t-5m, t], with a default of 5 minutes
/label/<name>/values__name__ is accurate, but other labels are over-approximated with global tag values — sufficient for autocompletion
scalar comparisonAlways evaluates to 0 or 1 (Prometheus requires bool). 3 > 2 maps directly to 1

See also​