Skip to main content

scout config validate

Validate an OpenTelemetry Collector YAML configuration file without needing a running collector or Scout backend. Checks structure, component names, pipeline references, and best practices.

scout config validate demo

Usage

scout config validate [flags]

You can also pipe a config via stdin:

cat otel-collector.yaml | scout config validate

Flags

FlagTypeDefaultDescription
--filepathPath to the YAML config file. Reads from stdin if omitted
--rawboolfalseOutput structured JSON instead of human-readable text

Examples

Validate a config file:

scout config validate --file otel-collector-config.yaml

Validate from stdin:

cat otel-collector-config.yaml | scout config validate

Output structured JSON for CI integration:

scout config validate --file otel-collector-config.yaml --raw

Validation Stages

The validator checks your configuration in five stages:

  1. YAML parsing — syntax correctness
  2. Top-level structure — required sections (service, pipelines, components)
  3. Component names — checked against the otelcol-contrib registry (v0.111.0)
  4. Cross-reference integrity — pipeline references match defined components
  5. Best practices — unused components, missing health check extensions

Errors fail validation. Warnings are reported but don't affect the exit code.

Exit Codes

CodeMeaning
0Valid configuration (warnings allowed)
1Validation errors found
2I/O or usage error (file not found, no input)
tip

Use exit codes in CI pipelines to gate deployments on valid configurations:

scout config validate --file otel-collector-config.yaml || exit 1

See Also

Was this page helpful?