本文へ移動
cccskills
無料GitHub で公開

otel-collector-config-tester

Validates OpenTelemetry Collector pipeline configurations and verifies spans flow end-to-end through the collector: runs `otelcol validate --config`, wires the `debug`/`file` exporter for span-output assertions, and integrates the full cycle into CI. Use when a collector config change (new receiver, processor swap, exporter wiring) needs correctness verification before deployment.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qaスター 13(GitHub 13 + cccskills 0)
連携ツールDocker

実行スコア 未検証

インストール方法を見る

含まれるファイル(3)

  • SKILL.md10.2 KB
  • .tessl-plugin/plugin.json528 B
  • references/ci-integration.md1.6 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

otel-collector-config-tester

A misconfigured Collector pipeline silently drops or misroutes spans - no error at deploy time, only missing data at query time. This skill tests two distinct failure modes:

  1. Static config errors - invalid YAML, undefined component references, missing required fields. Caught by otelcol validate before the process starts.
  2. Dynamic pipeline errors - a syntactically valid config that doesn't actually forward spans (wrong pipeline wiring, processor ordering, filter that drops everything). Caught only by sending real spans and asserting on the output.

When to use

  • A new receiver, processor, or exporter is added to a Collector config and the team needs to confirm the pipeline is wired correctly before deploying.
  • A processor chain (batch, filter, transform/OTTL) was reordered and span loss or attribute mutation must be ruled out.
  • CI should gate on "collector config is valid and spans reach the exporter" rather than relying on post-deploy observation.

Step 1 - Validate config syntax with otelcol validate

Run:

otelcol validate --config=collector-config.yaml

This checks that all components referenced in service.pipelines are defined in their respective top-level sections, required fields are present, and the YAML parses cleanly. It does not start the collector process.

The config structure the validator checks:

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: "0.0.0.0:4317"

processors:
  batch: {}

exporters:
  otlp/backend:
    endpoint: "https://backend.example.com:4317"

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp/backend]

Components follow type[/name] naming (otlp/backend above), which allows multiple instances of the same type in one config. Every component referenced in service.pipelines must be declared in its top-level section - validate reports undefined references as errors.

In CI:

- name: Validate collector config
  run: otelcol validate --config=collector-config.yaml

Exit code is non-zero on any validation error, so a failing step blocks the pipeline.

Step 2 - Wire the debug exporter to observe span flow

Add the debug exporter to a test pipeline alongside (or instead of) the production exporter. This exporter writes span data to the collector process stdout without requiring a backend.

Three verbosity levels are available:

LevelOutput per batch
basic (default)Single-line count summary: "resource spans": 1, "spans": 2
normalOne line per span record
detailedFull multi-line dump: TraceID, ParentID, timestamps, status, all attributes

Config to route a test pipeline through the debug exporter:

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: "0.0.0.0:4317"

exporters:
  debug:
    verbosity: detailed

service:
  pipelines:
    traces/test:
      receivers: [otlp]
      processors: []
      exporters: [debug]

Multiple pipelines of the same signal type use type/name syntax (traces/test above), so the test pipeline does not conflict with the production traces pipeline in the same config.

Send a span to the collector and grep stdout for the trace ID or a known attribute to assert receipt:

# Send a test span via grpcurl or the OTel SDK
grpcurl -plaintext -d @ localhost:4317 \
  opentelemetry.proto.collector.trace.v1.TraceService/Export \
  < test-span.json

# Assert the debug exporter emitted the span
docker logs <container> 2>&1 | grep "my.attribute"

Step 3 - Wire the file exporter for machine-readable assertions

The debug exporter writes to stdout, which is inconvenient for assertion scripts. The file exporter writes each exported batch as a JSON object per line, making it grep- and jq-parseable:

exporters:
  file:
    path: /tmp/collector-spans.jsonl

service:
  pipelines:
    traces/test:
      receivers: [otlp]
      processors: []
      exporters: [file]

After sending spans, assert on the output file:

# Check at least one span was exported
[ $(wc -l < /tmp/collector-spans.jsonl) -gt 0 ] || { echo "No spans exported"; exit 1; }

# Assert a specific attribute value was preserved through processors
jq -e '
  .resourceSpans[].scopeSpans[].spans[]
  | select(.name == "order.create")
  | .attributes[]
  | select(.key == "order.item_count")
  | .value.intValue == 1
' /tmp/collector-spans.jsonl

Each line in the file is a JSON object, which matches the OTLP/JSON protobuf encoding. The default flush_interval is 1 second - wait at least 2 seconds after the last span before asserting on the file in a test script.

Step 4 - Test processor behavior end-to-end

Processors modify spans in transit. A common failure mode: a filter or transform processor was added but its OTTL condition is wrong, silently dropping all spans.

Test pattern using the file exporter as the oracle:

processors:
  # Filter keeps only spans with http.response.status_code >= 400
  filter/errors_only:
    error_mode: ignore
    traces:
      span:
        - 'attributes["http.response.status_code"] < 400'

service:
  pipelines:
    traces/test:
      receivers: [otlp]
      processors: [filter/errors_only]
      exporters: [file]

Send two spans - one with http.response.status_code = 200, one with http.response.status_code = 500 - then assert the file contains exactly one span with the 500 status code and zero spans with 200.

The Transform processor uses OTTL (OpenTelemetry Transformation Language) for advanced mutations. Test attribute mutations the same way: send a known input span, read the file exporter output, assert the mutated attribute value.

Step 5 - CI integration

Full pipeline: validate config, start the collector in Docker, send test spans, assert on the file exporter output, stop the container. Minimal shape:

- name: Validate config
  run: otelcol validate --config=collector-config-test.yaml
- name: Start collector, send spans, assert
  run: |
    docker run -d --name otel-test -p 4317:4317 \
      -v $PWD/collector-config-test.yaml:/etc/otel/config.yaml \
      -v /tmp/spans:/tmp/spans \
      otel/opentelemetry-collector-contrib:0.153.0 --config=/etc/otel/config.yaml
    sleep 2 && python3 tests/send_test_spans.py && sleep 2
    [ $(wc -l < /tmp/spans/output.jsonl) -gt 0 ]

Pin the image tag (0.153.0) - the latest tag changes component stability levels between releases; the image exposes OTLP over gRPC on 4317 and HTTP on 4318. Full workflow with checkout, startup gating, and teardown: references/ci-integration.md.

Anti-patterns

Anti-patternWhy it failsFix
Only running otelcol validateCatches syntax errors but not pipeline wiring or processor logic errorsAdd a send-and-assert step (Steps 2-4)
Using debug exporter with basic verbosity for assertionsOutputs only count summaries; no attribute values to assert onUse verbosity: detailed or switch to file exporter
Asserting immediately after sending spansfile exporter flush_interval defaults to 1s - file may be emptyWait at least 2s after last span
Using latest Docker image tag in CIComponent stability levels change between releases; tests break on unrelated collector upgradesPin to a specific version tag
Reusing production exporter in test pipelineSends test spans to the live backendUse a named test pipeline (traces/test) with file or debug exporter

Limitations

  • otelcol validate does not check network reachability of exporter endpoints - a valid config may still fail at runtime if the backend is unreachable.
  • The file exporter is in the contrib distribution (otel/opentelemetry-collector-contrib), not the core distribution. Verify it is present in the collector build used in CI.
  • The default flush_interval is 1 second; very-high-throughput tests may need flush_interval: 100ms to avoid waiting on large batches.
  • This skill covers pipeline correctness testing. For sampling-ratio verification or tail-sampling behavior, pair with opentelemetry-trace-assertions which uses in-process SDK exporters for finer-grained span-count control.

References

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

Builds a CI gate that fails the build on **new** WCAG / a11y violations introduced by a PR while grandfathering pre-existing violations on a per-rule / per-page baseline. Aggregates verdicts from axe-core / pa11y / Lighthouse a11y / WAVE / IBM Equal Access scans. Use when a project has accumulated a11y debt and a strict "zero violations" gate would block every PR - the ratchet pattern lets the team ship while preventing regressions.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

Workflow skill that builds an A/B-test validity checklist from an experiment proposal, walking the canonical design-correctness gates - pre-registered OEC/power/guardrails, randomization unit + SRM check, assignment integrity, telemetry, peeking discipline, novelty/primacy, post-experiment SRM re-check - into a per-experiment checklist + sign-off form. Use when launching, auditing, or governing an experiment. For pitfall mechanics (guardrails, peeking) see experiment-results-interpreter's references; to read an already-valid result use experiment-results-interpreter; for per-SDK harness tests use experiment-sdk-testing - this gates DESIGN, not SDK code.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

The single install-flow skill: the reference contract for the PWA install flow (installability gate fields, `beforeinstallprompt` handshake, per-platform paths - Android WebAPK / iOS Share menu / Firefox no-op - and the `display-mode` post-install signal, in references/install-flow-reference.md) plus the build-an-X workflow that emits the Add-to-Home-Screen suite. Walks the four-stage timeline, emitting one test per gate cell per [web.dev/articles/install-criteria][install-criteria], the deferred-prompt → `prompt()` → `userChoice` chain per [web.dev/articles/customize-install][customize-install], the iOS Safari manual-metadata branch (`apple-touch-icon`) per [web.dev/learn/pwa/installation][learn-pwa], and the post-install `(display-mode: standalone)` MQ assertion. Output: a Playwright spec with per-stage cells plus a coverage matrix. Use when a PWA's manifest, icons, or install handler change, when install conversion drops at an unknown stage, or when triaging a flaky install assertion.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

Build-an-X workflow that uses an LLM to map existing tests to spec sections - given a spec doc + the test suite, the LLM identifies which tests cover which sections, surfaces uncovered sections (gap), and recommends specific tests to add. Output is a coverage matrix per spec ID. Scope is mapping tests that already exist and naming the gaps, not authoring tests for new acceptance criteria. Use when a spec doc and a test suite both exist but nobody can say which requirements are actually covered - before a release sign-off, an audit, or a decision about where to spend the next round of test effort.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

Generates tests from natural-language specs (acceptance criteria, user stories, requirements) using an LLM, with confidence scoring per test case (LLM self-assessment plus heuristics: assertion quality, naming, completeness), batching uncertain cases for human review, and integration with the team's existing test framework. Use when the user asks to generate unit tests from acceptance criteria, convert user stories to test cases, automate test creation from requirements, or augment a spec-driven test suite with AI-generated stubs that are then curated before merge.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

Configures Allure Report (test-runner adapter install, `allure-results` directory wiring, `categories.json` for failure classification, `history-trend.json` retention via the copy-history-between-runs pattern), runs the Allure CLI to convert `allure-results` to a static HTML site, and uploads the report as a CI artifact. Use when the team needs richer test reporting than JUnit XML - step-level attachments, per-test history, retry tracking, and severity / epic / feature labeling across framework-agnostic adapters (pytest, Jest, JUnit, TestNG, NUnit, Mocha). As a rich static HTML report generator, it is the open-source alternative to the sunset ExtentReports (JVM/.NET per-test HTML narrative); for hosted cross-run flakiness analytics rather than a static per-run report use currents-integration.

日本語の概要は準備中です。原文の説明を表示しています。

testland/qa132026年10月20日 更新

testland のスキルをすべて見る

このスキルの問題を報告する