Sources
Prometheus Remote-Write
The Streamfold Prometheus Remote-Write source will act as a receiver for Prometheus Remote-Write requests.
Overview
Prometheus is an open source metrics and alerting tool for system and application monitoring. Prometheus stores all data as time series streams of timestamped values belonging to the same metric and the same set of labeled dimensions (tags).
Configuration
Protocol Buffers over HTTP
Prometheus Remote-Write requests will be accepted at the following endpoint: POST /streamfold/prometheus/write
Response Codes
The source will respond with the follow codes:
204
: status no content on accepted400
: invalid format, may be due to content type or encoding not matching, or malformed payload (see below)401
: invalid or missing authentication404
: wrong path or method429
: too many requests, back pressure in system (TBD)500
: misc server error
Authentication
The following authentication methods will be supported:
Basic auth
- Username:
streamfold
- Password:
<sf-ingress-token>
- Username:
Bearer
Authorization: Bearer <sf-ingress-token>
Streamfold Token Header
X-Streamfold-Token: <sf-ingress-token>
Content Encoding
Must be set to snappy
Content Type:
Must be set to application/x-protobuf
Event Meta
The Prometheus Remote-Write source will use the following meta data:
http
: map to the incoming HTTP path and header datatype
: metricsource->type
: prometheus_remote_write
Example Converted Payload
{
"_timestamp": "2024-06-06T09:39:43.475231000-07:00",
"_ingested_timestamp": "2024-06-06T09:39:43.475231000-07:00",
"_raw": "",
"_partition": "cbf29ce484222325",
"_meta": {
"source": {
"type": "prometheus_remote_write",
"id": "1",
"name": "prometheus_remote_write"
},
"http": {
"path": "/streamfold/prometheus/write",
"method": "POST",
"headers": {
"Content-Type": [
"application/x-protobuf"
],
"Content-Encoding": [
"snappy"
]
}
},
"peer": {
"client_ip": ""
},
"type": "metric"
},
"metadata": [
{
"type": 0,
"metric_family_name": "a",
"help": "b",
"unit": "seconds"
},
{
"unit": "errors",
"type": 1,
"metric_family_name": "c",
"help": "d"
}
],
"timeseries": [
{
"exemplars": [
{
"labels": [
{
"name": "f",
"value": "g"
}
],
"value": 1.000000,
"timestamp": 0
}
],
"histograms": [
{
"positive_spans": [
{
"offset": 0,
"length": 1
}
],
"count": 0.000000,
"negative_spans": [
{
"offset": 0,
"length": 1
}
],
"negative_deltas": [
-1
],
"negative_counts": [],
"count_original_type": 0,
"sum": 20.000000,
"zero_threshold": 0.000000,
"reset_hint": 0,
"positive_deltas": [
1
],
"positive_counts": [],
"timestamp": 0,
"schema": 2,
"zero_count": 0.000000,
"zero_count_original_type": 0
},
{
"zero_count_original_type": 1,
"negative_spans": [
{
"length": 1,
"offset": 0
}
],
"timestamp": 1,
"count": 0.000000,
"sum": 20.000000,
"zero_threshold": 0.000000,
"zero_count": 0.000000,
"count_original_type": 1,
"schema": 2,
"positive_spans": [
{
"offset": 0,
"length": 1
}
],
"positive_deltas": [],
"negative_deltas": [],
"negative_counts": [
-1.000000
],
"positive_counts": [
1.000000
],
"reset_hint": 0
}
],
"labels": [
{
"name": "__name__",
"value": "test_metric1"
},
{
"name": "b",
"value": "c"
}
],
"samples": [
{
"value": 1.000000,
"timestamp": 0
}
]
},
{
"labels": [
{
"name": "__name__",
"value": "test_metric2"
},
{
"name": "foo",
"value": "bar"
}
],
"samples": [
{
"value": 2.000000,
"timestamp": 1
}
],
"exemplars": [
{
"labels": [
{
"name": "h",
"value": "i"
}
],
"value": 2.000000,
"timestamp": 1
}
],
"histograms": [
{
"reset_hint": 0,
"timestamp": 2,
"schema": 2,
"zero_count": 0.000000,
"positive_spans": [
{
"offset": 0,
"length": 1
}
],
"count": 0.000000,
"count_original_type": 0,
"negative_spans": [
{
"length": 1,
"offset": 0
}
],
"positive_counts": [],
"zero_threshold": 0.000000,
"zero_count_original_type": 0,
"negative_counts": [],
"sum": 20.000000,
"negative_deltas": [
-1
],
"positive_deltas": [
1
]
},
{
"count_original_type": 1,
"zero_threshold": 0.000000,
"negative_counts": [
-1.000000
],
"positive_spans": [
{
"offset": 0,
"length": 1
}
],
"positive_counts": [
1.000000
],
"reset_hint": 0,
"schema": 2,
"negative_spans": [
{
"offset": 0,
"length": 1
}
],
"positive_deltas": [],
"count": 0.000000,
"sum": 20.000000,
"zero_count": 0.000000,
"zero_count_original_type": 1,
"negative_deltas": [],
"timestamp": 3
}
]
}
]
}