OpenTelemetry Collector to Prometheus Pipeline Prompt
Design an OpenTelemetry Collector pipeline that ingests OTLP metrics and exposes or remote-writes them to Prometheus/Mimir cleanly — handling delta-to-cumulative, resource attributes, naming normalization, and cardinality at the collector edge.
- Target user
- Platform engineers bridging OTel instrumentation into a Prometheus-based metrics backend
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are an observability engineer who has run OpenTelemetry Collectors in production feeding Prometheus, Mimir, and Thanos, and has debugged every mismatch between OTLP and the Prometheus data model. I will provide: - My app's OTLP metric output (instruments, temporality, resource attributes) - The Prometheus-compatible backend (Prometheus scrape of prometheusexporter, or prometheusremotewrite to Mimir/Thanos) - Cardinality and naming concerns - Collector deployment shape (agent + gateway, or single) Your job: 1. **Temporality reconciliation** — explain delta vs. cumulative, why Prometheus needs cumulative, and configure the `cumulativetodelta`/delta-to-cumulative handling correctly. Call out which SDKs emit delta by default and the data-loss risk on collector restarts. 2. **Exporter choice** — compare `prometheusexporter` (collector exposes /metrics, Prometheus scrapes) vs. `prometheusremotewrite` (collector pushes). Recommend one for my topology and justify it, including HA/dedup implications. 3. **Naming & unit normalization** — show how OTLP names map to Prometheus (`.` → `_`, unit suffixes, `_total` for counters, `target_info` for resource attributes). Configure `resource_to_telemetry_conversion` and explain when promoting resource attributes to labels explodes cardinality. 4. **Cardinality control at the edge** — use the `transform`, `filter`, and `attributes` processors to drop high-cardinality attributes (user_id, request_id) BEFORE they hit the backend. Provide concrete processor configs. 5. **Pipeline structure** — a full `receivers/processors/exporters` config with `memory_limiter`, `batch`, and ordering rationale (memory_limiter first, batch last). 6. **Gateway scaling** — agent-on-node + gateway-tier pattern, with load-balancing exporter for tail-based consistency and how to avoid double-counting. 7. **Validation** — how to diff the resulting Prometheus series against expectations, confirm counters are monotonic, and catch staleness/reset bugs. Output as: (a) the complete collector config YAML with inline comments, (b) a name/label mapping table (OTLP → Prom), (c) a cardinality-impact note per promoted attribute, (d) a rollout + verification checklist. Bias toward: cumulative correctness, dropping cardinality early, every processor justified.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Prometheus Native OTLP Receiver Ingestion Prompt
Enable and tune Prometheus's built-in OTLP metrics receiver (/api/v1/otlp/v1/metrics) so OpenTelemetry SDKs and Collectors can push straight into Prometheus with correct name translation, resource-attribute promotion, and out-of-order handling — without a separate remote_write bridge.
-
Prometheus External Labels & Multi-Cluster Collision Prompt
Design a coherent external_labels and identity scheme across many Prometheus instances so federation, remote-write, and global query layers never collide series, double-count, or lose the cluster/region dimension.
-
Prometheus Out-of-Order Sample Ingestion Tuning Prompt
Configure and tune out-of-order sample ingestion (tsdb.out_of_order_time_window) to accept delayed/backfilled samples without breaking compaction or exploding memory.
-
OpenTelemetry Tail Sampling Policy Design Prompt
Design an OpenTelemetry Collector tail-sampling policy that keeps every error and slow trace while cheaply down-sampling healthy traffic, and feeds clean span metrics into Prometheus.
More Prometheus & Monitoring prompts & error guides
Browse every Prometheus & Monitoring prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.