OpenTelemetry SDK Configuration Standardization Prompt
Standardize OpenTelemetry SDK configuration across a polyglot fleet using OTEL_ environment variables and declarative config: consistent endpoints, resource attributes, samplers, and propagators so every service reports the same way with no per-language drift.
- Target user
- Platform teams rolling OTel across many languages and services
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a senior platform engineer who standardizes OpenTelemetry configuration across a polyglot service fleet. I will provide: - The languages/runtimes and OTel SDK/distro versions in use - Deployment platform (Kubernetes, VMs, serverless) and how config is injected - The Collector endpoint(s) per environment and desired sampler/propagators - Current inconsistencies (different service.name schemes, missing attributes, wrong endpoints) Your job: 1. **Canonical variable set** — define the standard OTEL_ variables every service must set: OTEL_SERVICE_NAME, OTEL_RESOURCE_ATTRIBUTES, OTEL_EXPORTER_OTLP_ENDPOINT/PROTOCOL, OTEL_TRACES_SAMPLER(+ARG), OTEL_PROPAGATORS, and signal toggles. Give the exact values per environment. 2. **Protocol/port correctness** — pin protocol to port (grpc:4317 vs http/protobuf:4318) and include required paths; explain the failure mode of mismatches. 3. **Resource attributes** — standardize service.name, service.namespace, service.version, deployment.environment, and how they are populated (Downward API, build args) consistently across languages. 4. **Per-language gaps** — note where a language ignores or renames a variable and give the code fallback for those cases. 5. **Injection mechanism** — show how to inject the config uniformly (ConfigMap/env, Operator auto-instrumentation, base image) so services can't drift. 6. **Declarative config** — where supported, move to file-based declarative configuration and reference it, to reduce env sprawl. 7. **Validation & guardrails** — provide a startup check that fails fast if required variables are missing or malformed, plus a lint for CI. Output as: (a) the canonical variable table with per-env values, (b) the protocol/port matrix, (c) the injection manifest/base-image snippet, (d) per-language exceptions, (e) a startup validation check and CI lint. Flag any variable a target SDK does not honor and any endpoint/protocol mismatch that would fail silently.
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
-
OpenTelemetry Collector Gateway Scaling & HA Prompt
Design a horizontally scalable, highly available OpenTelemetry Collector gateway tier — autoscaling, load balancing, queue persistence, and zero-loss rolling upgrades — so telemetry survives replica churn and traffic spikes.
-
OpenTelemetry Collector Routing & Multi-Backend Fan-out Prompt
Design a routing-connector-based OpenTelemetry Collector topology that fans telemetry out to multiple backends or tenants by attribute — with per-route processors, failover, and cost tiers — without duplicating data or dropping unmatched signals.
-
OpenTelemetry OTTL Transform & PII Redaction Prompt
Design OTTL-based transform, redaction, and filter processors in the OpenTelemetry Collector to scrub PII, drop noisy telemetry, and reshape attributes fleet-wide — safely, without breaking correlation or silently deleting signal.
-
OpenTelemetry Auto-Instrumentation Rollout Prompt
Plan a safe, incremental rollout of OpenTelemetry auto-instrumentation across polyglot services, including the Operator injection model, version pinning, and where manual spans must supplement the agents.
More OpenTelemetry prompts & error guides
Browse every OpenTelemetry 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.