Skip to content

Commit 43ee3ad

Browse files
committed
feat: add OTel resource attributes persistence per time series
Add end-to-end support for persisting OTel resource and scope attributes from OTLP metrics ingestion through to query-time enrichment via info(). Key changes: - Implement AppenderV2 in MimirAppender for OTLP resource context - Store resource/scope attributes in TSDB head per-series - Persist attributes to series_metadata.parquet on block flush - Upload series_metadata.parquet to object storage - Add distributed query path for resource attributes - Wire store-gateway and ingester to /api/v1/resources endpoint - Implement ResourceQuerier for info() PromQL function - Port block builder to support resource attributes - Use ReadSeriesMetadataFromReaderAt for content-addressed Parquet Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
1 parent 7e20aba commit 43ee3ad

File tree

674 files changed

+351397
-7415
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

674 files changed

+351397
-7415
lines changed

cmd/mimir/config-descriptor.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6793,6 +6793,17 @@
67936793
"fieldType": "boolean",
67946794
"fieldCategory": "advanced"
67956795
},
6796+
{
6797+
"kind": "field",
6798+
"name": "otel_persist_resource_attributes",
6799+
"required": false,
6800+
"desc": "Whether to persist OTel resource attributes per time series as metadata in Prometheus TSDB blocks. Resource attributes are stored in series_metadata.parquet files within blocks and can be queried via the /api/v1/resource_attributes endpoint.",
6801+
"fieldValue": null,
6802+
"fieldDefaultValue": false,
6803+
"fieldFlag": "distributor.otel-persist-resource-attributes",
6804+
"fieldType": "boolean",
6805+
"fieldCategory": "experimental"
6806+
},
67966807
{
67976808
"kind": "field",
67986809
"name": "ingest_storage_read_consistency",

cmd/mimir/help-all.txt.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,8 @@ Usage of ./cmd/mimir/mimir:
13151315
Whether to enable automatic suffixes to names of metrics ingested through OTLP.
13161316
-distributor.otel-native-delta-ingestion
13171317
[experimental] Whether to enable native ingestion of delta OTLP metrics, which will store the raw delta sample values without conversion. If disabled, delta metrics will be rejected. Delta support is in an early stage of development. The ingestion and querying process is likely to change over time.
1318+
-distributor.otel-persist-resource-attributes
1319+
[experimental] Whether to persist OTel resource attributes per time series as metadata in Prometheus TSDB blocks. Resource attributes are stored in series_metadata.parquet files within blocks and can be queried via the /api/v1/resource_attributes endpoint.
13181320
-distributor.otel-promote-resource-attributes comma-separated-list-of-strings
13191321
[experimental] Optionally specify OTel resource attributes to promote to labels.
13201322
-distributor.otel-promote-scope-metadata

development/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ Available profiles:
3939

4040
> **Note**: Compose down will stop all profiles unless specified.
4141
42+
## OTLP Resource Attributes Demo
43+
44+
The monolithic mode includes a demo script that showcases how Mimir persists OTel resource attributes from OTLP metrics. This demonstrates the end-to-end flow from OTLP ingestion through both ingesters and store-gateways.
45+
46+
```bash
47+
cd mimir-monolithic-mode
48+
./compose-up.sh
49+
./scripts/otlp-resource-attrs-demo.sh
50+
```
51+
52+
See [mimir-monolithic-mode/scripts/README.md](./mimir-monolithic-mode/scripts/README.md) for details.
53+
4254
## OTEL collector
4355

4456
Experimental support for running OpenTelemetry collector in the Monolithic mode.

development/mimir-ingest-storage/config/runtime.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ overrides:
33
anonymous:
44
labels_query_optimizer_enabled: true
55
ruler_evaluation_consistency_max_delay: 1m
6+
otel_persist_resource_attributes: true
7+
# Enable experimental PromQL functions for the info() function demo.
8+
enabled_promql_experimental_functions: all

development/mimir-ingest-storage/docker-compose.jsonnet

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ std.manifestYamlDoc({
184184
hostname: 'nginx',
185185
image: 'nginxinc/nginx-unprivileged:1.22-alpine',
186186
depends_on: [
187+
'distributor-1',
187188
'ingester-zone-a-1',
188189
'alertmanager-1',
189190
'ruler-1',
@@ -193,7 +194,7 @@ std.manifestYamlDoc({
193194
],
194195
environment: [
195196
'NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx',
196-
'DISTRIBUTOR_HOST=ingester-zone-a-1:8080',
197+
'DISTRIBUTOR_HOST=distributor-1:8080',
197198
'ALERT_MANAGER_HOST=alertmanager-1:8080',
198199
'RULER_HOST=ruler-1:8080',
199200
'QUERY_FRONTEND_HOST=query-frontend:8080',

development/mimir-ingest-storage/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@
291291
- ".data-minio:/data:delegated"
292292
"nginx":
293293
"depends_on":
294+
- "distributor-1"
294295
- "ingester-zone-a-1"
295296
- "alertmanager-1"
296297
- "ruler-1"
@@ -299,7 +300,7 @@
299300
- "grafana"
300301
"environment":
301302
- "NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx"
302-
- "DISTRIBUTOR_HOST=ingester-zone-a-1:8080"
303+
- "DISTRIBUTOR_HOST=distributor-1:8080"
303304
- "ALERT_MANAGER_HOST=alertmanager-1:8080"
304305
- "RULER_HOST=ruler-1:8080"
305306
- "QUERY_FRONTEND_HOST=query-frontend:8080"

0 commit comments

Comments
 (0)