$npx -y skills add ollygarden/opentelemetry-agent-skills --skill otel-declarative-configOpenTelemetry declarative YAML configuration for SDK setup. Use when configuring OpenTelemetry SDK providers (tracer, meter, logger), setting up OTLP exporters, defining sampling strategies, or writing otel config files. Triggers on "otel config", "OpenTelemetry YAML", "declarati
| 1 | # OpenTelemetry Declarative Configuration |
| 2 | |
| 3 | Declarative configuration replaces scattered `OTEL_*` environment variables and language-specific |
| 4 | programmatic SDK setup with a single YAML file. One file configures all SDK components: tracer |
| 5 | provider, meter provider, logger provider, propagators, and resource. |
| 6 | |
| 7 | For the current per-language SDK status, fetch the SDK compatibility matrix (see Sources of Truth). |
| 8 | Use it to understand implementation coverage, not as the only source for YAML literals. |
| 9 | |
| 10 | ## Sources of Truth |
| 11 | |
| 12 | This skill teaches concepts. The schema itself, valid `file_format` strings, field names, |
| 13 | and SDK compatibility evolve per release — fetch from upstream rather than relying on |
| 14 | embedded copies. Cache results for the conversation; refetch only on schema-related errors. |
| 15 | |
| 16 | | Fact | Fetch | |
| 17 | |---|---| |
| 18 | | Latest schema release tag | `gh release view --repo open-telemetry/opentelemetry-configuration --json tagName,publishedAt` | |
| 19 | | SDK ↔ schema compatibility matrix (coverage advisory, not authoritative for literal `file_format`) | `WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-configuration/main/language-support-status.md` | |
| 20 | | Field-by-field docs for the latest release | `WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-configuration/<schema-release-tag>/schema-docs.md` | |
| 21 | | Compiled JSON Schema (validate generated YAML against this) | `WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-configuration/<schema-release-tag>/opentelemetry_configuration.json` | |
| 22 | | Canonical full example | `WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-configuration/<schema-release-tag>/examples/otel-sdk-config.yaml` | |
| 23 | | Migration template (every option, with comments) | `WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-configuration/<schema-release-tag>/examples/otel-sdk-migration-config.yaml` | |
| 24 | | Schema CHANGELOG (breaking-change history with migration steps) | `WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-configuration/<schema-release-tag>/CHANGELOG.md` | |
| 25 | |
| 26 | **Workflow when generating YAML:** |
| 27 | |
| 28 | 1. Identify the exact runtime/package/agent version that will parse the file. |
| 29 | 2. Fetch that runtime/package source, docs, or test fixtures and confirm the accepted |
| 30 | `file_format` literal. If this conflicts with `language-support-status.md`, the |
| 31 | runtime/package wins. |
| 32 | 3. Fetch `examples/otel-sdk-config.yaml` → use as the structural template only after |
| 33 | adapting the `file_format` and fields to the selected runtime/package. |
| 34 | 4. Overlay the user's specific values (service name, endpoint, sampling, headers). |
| 35 | 5. If validation matters, fetch `opentelemetry_configuration.json` and validate the result, |
| 36 | then still verify against the selected runtime/package because SDK implementations may |
| 37 | lag or differ from the schema repository. |
| 38 | |
| 39 | Replace `<schema-release-tag>` with the tag returned by the first fetch. Keep the compatibility |
| 40 | matrix on `main`: it tracks language implementation coverage independently of schema releases |
| 41 | and may include work not yet released by an implementation. Do not use schema files or examples |
| 42 | from `main` to generate released-version guidance. |
| 43 | |
| 44 | The "Latest supported file format" values in `language-support-status.md` are schema/version |
| 45 | coverage metadata. Do not mechanically copy them into YAML unless the target SDK parser, |
| 46 | agent docs, or package fixtures prove that exact literal is accepted. |
| 47 | |
| 48 | Terminology trap: schema coverage identifiers and YAML `file_format` literals are related, |
| 49 | but not interchangeable. A matrix entry uses a full semver-shaped coverage value (e.g. |
| 50 | `1.0.0`, or a pre-release such as `1.0.0-rc.3` for implementations still tracking an older |
| 51 | schema), while stable schema examples use a `MAJOR.MINOR` string such as `1.0` or `1.1`. |
| 52 | Older implementations may accept or require a pre-release literal, and released parsers do |
| 53 | not all enforce versions identically. Generated YAML must use the literal verified in the |
| 54 | target runtime. Schema release v1.1.0 examples use `file_format: "1.1"`; treat that as |
| 55 | release-specific, not a permanent default, and confirm the latest release with the `gh release` |
| 56 | fetch above. |
| 57 | |
| 58 | For language-specific package versions and SDK API surface, see the Sources of Truth section |
| 59 | in each language's `otel-<lang>` skill (`otel-go`, `otel-java`, `otel-js`, `otel-python`). |
| 60 | `otel-dotnet` is listed in Cross-References below but does **not** support |