Platform engineers and SREs should use this prompt when they need a complete, standards-compliant first draft of an OpenTelemetry Collector configuration. The job-to-be-done is translating a set of high-level observability requirements—such as signal types, sampling rules, PII redaction policies, and export destinations—into a valid YAML pipeline definition. The ideal user is someone who understands the Collector's component model (receivers, processors, exporters, connectors, and service pipelines) but wants to accelerate the configuration authoring process and reduce the risk of misconfigurations that violate data governance or signal integrity constraints.
Prompt
OpenTelemetry Collector Configuration Prompt

When to Use This Prompt
Defines the job-to-be-done, the ideal user, required context, and the boundaries where this prompt should not be applied.
This prompt is most effective when you provide concrete constraints. For example, specify that the pipeline must accept OTLP and Prometheus receiver inputs, apply tail-based sampling for traces, redact email and ip_address attributes with a redaction processor, and export to both a vendor SaaS backend and a local Jaeger instance. The prompt will generate the corresponding receivers, processors, exporters, and service.pipelines stanzas, ensuring the data flow respects the order of operations you defined. It also validates the output against vendor-agnostic standards, such as ensuring the batch processor is placed before the exporter queue and that PII redaction occurs before any export.
Do not use this prompt for runtime debugging of an already-deployed Collector instance, as it is designed for greenfield configuration generation, not log analysis or metric interpretation. It is also not a substitute for generating application-level instrumentation code; it focuses exclusively on the Collector's configuration surface. If your goal is to troubleshoot a broken pipeline, investigate dropped spans, or write OpenTelemetry SDK code in a specific language, you need a different workflow. After generating the configuration, always review the output for environment-specific details like TLS certificate paths, authentication headers, and endpoint URLs, and test it in a staging Collector instance before production deployment.
Use Case Fit
Where this prompt works, where it fails, and the operational preconditions required before you rely on it in a production pipeline.
Good Fit: Greenfield Collector Design
Use when: you are designing a new OpenTelemetry Collector pipeline from scratch with clear signal requirements. The prompt excels at generating a complete, vendor-agnostic configuration with receivers, processors, exporters, and pipelines that follow community conventions. Guardrail: always review the generated pipeline topology against your actual network topology and security boundaries before deployment.
Bad Fit: Live Debugging of Broken Pipelines
Avoid when: you need to diagnose why an existing collector is dropping spans or consuming excessive memory. The prompt generates static configuration, not runtime diagnostics. It cannot inspect metrics, logs, or traces from a running collector. Guardrail: pair this prompt with a separate observability validation prompt or use collector health check endpoints and zpages for live debugging instead.
Required Input: Signal Inventory and Backend Targets
Risk: without a clear inventory of required signals (traces, metrics, logs) and target backends (vendor, OSS, or storage), the prompt will produce a generic configuration that may not match your stack. Guardrail: provide explicit lists of signal types per service, required sampling rates, and exporter destinations. The prompt output is only as specific as the input constraints you supply.
Required Input: Data Governance and PII Requirements
Risk: the prompt may generate a configuration that passes sensitive data through processors without redaction if governance rules are not specified. Attributes like user IDs, IPs, or request bodies can leak into exported telemetry. Guardrail: explicitly state PII redaction rules, attribute allow/deny lists, and compliance requirements (GDPR, SOC2, HIPAA) in the input context so the prompt includes appropriate processors.
Operational Risk: Untested Processor Chains
Risk: a generated configuration with multiple processors (batch, memory limiter, tail sampling, attributes) can interact in unexpected ways, causing data loss, OOM kills, or silent drops under load. Guardrail: always load-test the generated configuration with realistic telemetry volume before production deployment. Validate that the processor ordering does not create bottlenecks or drop critical data.
Operational Risk: Vendor-Specific Exporter Drift
Risk: the prompt may generate exporter configurations that do not match the latest vendor SDK versions, authentication methods, or endpoint URLs. Vendor APIs change, and the model's training data may be stale. Guardrail: cross-reference every exporter block against the vendor's current documentation. Treat generated exporter configs as a starting point, not a final integration contract.
Copy-Ready Prompt Template
A copy-ready prompt for generating a validated OpenTelemetry Collector configuration from your specific requirements.
The following prompt template is designed to be pasted directly into your AI workflow. It instructs the model to act as a platform engineering architect and produce a complete, vendor-agnostic OpenTelemetry Collector configuration. The output is not just YAML; it includes a validation rationale, a data flow explanation, and a governance checklist. Before using it, gather your specific requirements for receivers, processors, exporters, and any data governance constraints. The more precise your input in the placeholders, the more production-ready the generated configuration will be.
markdownYou are a senior platform engineer specializing in observability infrastructure. Your task is to generate a production-grade OpenTelemetry Collector configuration in YAML based on the specific requirements provided. # INPUT REQUIREMENTS - **Telemetry Sources:** [LIST_RECEIVERS, e.g., OTLP gRPC on port 4317, Prometheus scraping on port 8888, filelog receiver for /var/log/app/*.log] - **Processing Needs:** [LIST_PROCESSORS, e.g., batch, memory_limiter, attributes for adding 'environment: production', filter to drop health-check spans] - **Data Destinations:** [LIST_EXPORTERS, e.g., otlp to https://my-otlp-backend:4318, debug for local testing, prometheusremotewrite to https://my-metrics-backend/api/v1/write] - **Pipeline Structure:** [DESCRIBE_PIPELINES, e.g., a traces pipeline with OTLP input, a metrics pipeline with Prometheus input, and a logs pipeline with filelog input] - **Governance Constraints:** [LIST_CONSTRAINTS, e.g., must redact all PII from log bodies, must not export to any non-approved endpoint, must enforce a 10-second timeout on all exports] # OUTPUT SCHEMA Your response must be a JSON object with the following structure: { "collector_config_yaml": "The complete, valid YAML configuration as a single string.", "data_flow_summary": "A paragraph explaining how data moves through the configured pipelines.", "validation_rationale": "A list of checks you performed against the governance constraints and best practices.", "governance_checklist": "A list of boolean pass/fail items confirming each constraint from the input is met." } # CONSTRAINTS - The YAML must be syntactically valid and follow the official OpenTelemetry Collector configuration schema. - Do not use any deprecated components. - If a governance constraint cannot be met with the specified components, explicitly state the failure in the `governance_checklist` and suggest an alternative. - Assume a standard `contrib` distribution of the collector.
To adapt this template, replace each square-bracket placeholder with your concrete requirements. For example, instead of [LIST_RECEIVERS], provide a specific list like otlp receiver on port 4317, hostmetrics receiver for CPU and memory. The model's performance is directly tied to the specificity of these inputs. After generating the configuration, always run it through a YAML validator and test it in a non-production environment. The governance_checklist in the output is your first line of defense against misconfigurations that could lead to data leaks or pipeline failures. For high-risk environments, treat this generated configuration as a first draft that requires human review and a security sign-off before deployment.
Prompt Variables
Each placeholder must be replaced with concrete details for the prompt to produce a reliable OpenTelemetry Collector configuration.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[SIGNAL_TYPES] | Defines which telemetry signals the pipeline must handle | traces, metrics, logs | Must be a comma-separated subset of: traces, metrics, logs. Empty set is invalid. |
[RECEIVER_PROTOCOLS] | Specifies the ingestion protocols the collector must accept | OTLP/gRPC, OTLP/HTTP, Jaeger/Thrift | Each entry must match a known OTel receiver name. Validate against the OpenTelemetry receiver registry. |
[EXPORTER_BACKENDS] | Declares the target observability platforms or storage backends | Prometheus remote write, AWS X-Ray, Datadog | Each entry must map to a supported OTel exporter. Check for vendor-specific configuration requirements. |
[PROCESSING_RULES] | Describes the transformation, filtering, or batching logic required | Drop health-check spans, batch with 5s timeout, redact PII from span attributes | Each rule must be expressible as an OTel processor. If a rule cannot be mapped to a known processor, flag for custom extension. |
[ENVIRONMENT] | Sets the deployment context for the collector | Kubernetes DaemonSet with host network, AWS ECS sidecar | Must resolve to a concrete deployment mode. Validate that chosen receivers and exporters are compatible with the environment's network and auth constraints. |
[DATA_GOVERNANCE_CONSTRAINTS] | Lists regulatory or organizational data handling requirements | GDPR: mask user_id in logs, SOC2: retain metrics for 13 months | Each constraint must include a verifiable action. If a constraint lacks a technical enforcement mechanism, flag for human review. |
[PIPELINE_LAYOUT] | Defines how signals flow through receivers, processors, and exporters | Single pipeline for all signals, separate pipelines for traces and metrics | Must result in a valid OTel pipeline DAG. Validate that every receiver and exporter is referenced in at least one pipeline definition. |
[EXTENSIONS_REQUIRED] | Lists any collector extensions needed beyond the core pipeline | health_check, pprof, zpages, oauth2client | Each extension must be a known OTel extension. Verify that extensions do not expose debug endpoints in production unless explicitly approved. |
Implementation Harness Notes
How to wire the OpenTelemetry Collector Configuration Prompt into a CI/CD pipeline or platform engineering workflow with validation, retries, and review gates.
This prompt is designed to be called programmatically as part of a GitOps-managed observability stack. The typical integration point is a pull request workflow: a platform engineer proposes a new collector configuration or a change to an existing one, and the prompt generates a validated, vendor-agnostic configuration that is then committed to the observability-as-code repository. The prompt expects structured inputs—service topology, signal requirements, data governance constraints—and produces a YAML collector configuration. Because collector misconfiguration can cause silent telemetry loss or cost overruns, the harness must enforce validation before the output reaches production.
Wire the prompt into a CI job that runs on PR creation or update. The job should: (1) assemble the input context from repository files (service manifests, existing collector configs, data classification tags) and PR description; (2) call the prompt with the assembled [SERVICE_TOPOLOGY], [SIGNAL_REQUIREMENTS], [DATA_GOVERNANCE_CONSTRAINTS], and [EXISTING_COLLECTOR_CONFIG] placeholders; (3) parse the YAML output and validate it structurally using otelcol validate or a schema check against the OpenTelemetry Collector configuration schema; (4) run a semantic validation pass that checks for common failure modes—missing pipelines, undefined exporters, processors applied to wrong signal types, and PII leaking into attributes; (5) if validation fails, retry once with the validation errors injected into the [CONSTRAINTS] placeholder as explicit prohibitions; (6) post the generated config and validation report as a PR comment for human review. Use a model with strong YAML generation and instruction-following, such as claude-3-5-sonnet or gpt-4o. Set temperature=0 for deterministic output. Log the full prompt, response, validation results, and reviewer decision for auditability.
Do not auto-merge collector configuration changes without human approval. The review gate should require a platform engineer to confirm that the generated pipelines match the intended signal flow, that sampling and redaction rules are correct, and that the configuration does not introduce cardinality explosions or cost regressions. For high-risk environments, add a canary deployment step: apply the generated config to a staging collector, run synthetic traffic through it, and verify that expected metrics, traces, and logs appear in the observability backend before promoting to production. Avoid wiring this prompt into a fully automated pipeline that pushes configs directly to running collectors without review—the blast radius of a bad collector config includes data loss, runaway costs, and compliance violations.
Expected Output Contract
Validate the generated OpenTelemetry Collector configuration against these structural and semantic checks before integrating into a pipeline or committing to version control.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
receivers | map | At least one receiver must be defined. Validate that each receiver key matches a supported OTel receiver name and includes required fields (e.g., endpoint for otlp). | |
processors | map | If present, each processor key must reference a valid processor type. Check that batch processor includes send_batch_size and timeout fields. Validate memory_limiter includes check_interval and limit_mib. | |
exporters | map | At least one exporter must be defined. Validate that each exporter key matches a supported exporter type. For otlp exporters, endpoint must be a valid URL. For logging exporters, verbosity must be one of basic, normal, detailed. | |
service.pipelines | map | At least one pipeline must be defined under service.pipelines. Each pipeline must include receivers, processors, and exporters arrays. Validate that every referenced receiver, processor, and exporter is defined in the corresponding top-level section. | |
service.pipelines.[name].receivers | array of strings | Every receiver name in the array must resolve to a key in the top-level receivers map. Empty array is invalid. | |
service.pipelines.[name].exporters | array of strings | Every exporter name in the array must resolve to a key in the top-level exporters map. Empty array is invalid. | |
extensions | map | If present, each extension key must match a supported extension type. Validate that health_check extension includes endpoint field. Validate that pprof extension does not expose sensitive endpoints in production. | |
connectors | map | If present, each connector key must match a supported connector type. Validate that spanmetrics connector includes histogram configuration. Validate that forward connector preserves context propagation. |
Common Failure Modes
What breaks first when generating OpenTelemetry Collector configurations and how to guard against it.
Hallucinated Exporter Endpoints
What to watch: The model invents plausible but non-existent endpoint URLs, authentication headers, or TLS settings for exporters like otlphttp or prometheusremotewrite. Guardrail: Provide a strict allowlist of known endpoints and required Authorization headers in the prompt context. Validate all generated endpoints against a configuration registry before deployment.
Broken Pipeline Topology
What to watch: The model creates pipelines that reference undefined receivers, processors, or exporters, or creates circular dependencies between components. Guardrail: Parse the generated YAML with a schema validator that checks component references exist. Use a structural diff against a minimal working configuration to catch orphaned components.
Processor Ordering Errors
What to watch: Processors are placed in the wrong order, causing data loss. For example, a filter processor dropping spans before the attributes processor can enrich them with routing keys. Guardrail: Include a processor ordering checklist in the prompt. Validate the generated pipeline sequence against known dependency rules (e.g., memory_limiter must be first, batch must be last).
Default Port and Protocol Collisions
What to watch: The model assigns the same default port (e.g., 4317 for gRPC, 4318 for HTTP) to multiple receivers or exporters, causing startup failures. Guardrail: Explicitly require unique port assignments in the prompt constraints. Validate the generated configuration with a port uniqueness check before applying.
Missing or Misconfigured TLS
What to watch: The model omits TLS configuration for production exporters or uses insecure insecure: true without explicit justification, violating data governance requirements. Guardrail: Include a mandatory TLS policy in the prompt context. Validate the generated configuration against a security policy that flags any exporter without TLS settings unless explicitly approved.
Unbounded Memory and Batch Settings
What to watch: The model omits memory_limiter or sets batch processor timeouts and sizes too high, causing out-of-memory crashes under load. Guardrail: Require explicit memory_limiter configuration with check_interval and limit_mib in the prompt. Validate that every pipeline includes resource protection processors with reasonable upper bounds.
Evaluation Rubric
Score each generated OpenTelemetry Collector configuration against these criteria before accepting it for deployment. Each row represents a pass/fail gate. A configuration that fails any criterion should be sent back for revision or flagged for human review.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Pipeline Completeness | All declared receivers, processors, and exporters are referenced in at least one service pipeline definition | Orphaned component declared in config but not wired into any pipeline | Parse YAML, extract component names from top-level sections, verify each appears in service.pipelines |
Receiver-Exporter Compatibility | Each pipeline's exporter supports the data type produced by its receiver (traces, metrics, logs) | Pipeline routes traces to a metrics-only exporter or similar type mismatch | Cross-reference receiver output type against exporter input type using OTel component registry metadata |
Processor Order Validity | Processors appear in logical order: batching after sampling, tail sampling before batching, attributes before filtering | Batch processor placed before tail sampling processor in a traces pipeline | Static rule check against known processor ordering constraints for the declared pipeline type |
Endpoint Connectivity | All exporter and receiver endpoints use valid URL schemes and non-placeholder host:port values | Endpoint contains 'localhost', '0.0.0.0', or unresolved template variable in production config | Regex validation for URL scheme, host, port; flag any non-production placeholder patterns |
Resource Attribute Coverage | service.name and service.namespace attributes are set via resource detection or static attributes processor | Missing service.name attribute in all pipelines, preventing service-level correlation in backends | Parse config for resourcedetection processor with service.name or static attributes setting service.name |
Authentication Configuration | Exporters to SaaS backends include valid auth extension reference or environment variable for API key | OTLP exporter to vendor backend has no auth extension and no headers block with API key | Check exporter config for 'auth:' block or 'headers:' with non-empty values; flag missing both |
Memory Limit Safety | Batch processor max batch size and queue size are within safe bounds for declared memory limits | Batch processor send_batch_max_size set to 10000 with no memory_limiter processor configured | Parse batch processor settings, compare against memory_limiter config if present, flag unbounded or extreme values |
TLS Configuration | All gRPC/HTTP exporters to external endpoints use TLS or explicitly document insecure exception | OTLP exporter to remote endpoint has insecure: true without comment justifying exception | Check exporter config for insecure_skip_verify, insecure, or tls block; flag insecure without justification comment |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a single receiver, processor, and exporter. Remove strict validation constraints. Accept YAML or JSON output without schema enforcement. Focus on generating a working collector config for a local dev environment.
Prompt modification
- Replace [CONSTRAINTS] with: "Output a minimal working configuration. Prefer defaults. Skip advanced batching and retry settings."
- Set [OUTPUT_SCHEMA] to: "Return valid YAML. No schema validation required."
- Add: "If unsure about a setting, use the default value and add a comment noting the assumption."
Watch for
- Missing pipeline wiring between receiver and exporter
- Hardcoded localhost endpoints that break in staging
- No signal type specified in the pipeline (traces vs metrics vs logs)

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us