/opentelemetry-agent-skills:otel-collector-builderfrom opentelemetry-agent-skills
Builds custom OpenTelemetry Collector distributions using OCB. Covers manifest authoring, version alignment, CI/Docker builds, and troubleshooting build failures.
Ships in opentelemetry-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
OCB generates and compiles a custom Collector binary from a YAML manifest that lists exactly the components to include. Source of truth: cmd/builder in opentelemetry-collector.
Use OCB when the stock otelcol/otelcol-contrib distributions don't fit: you need a component that ships in no distribution, a private/local component, or a slimmer binary with only the components you run.
This skill covers building the distribution. For configuring individual components, see otel-collector; for writing a new component, see the component-authoring guidance; for generating test traffic against the built binary, see otel-telemetrygen.
dist: block plus component lists. Start from the minimal manifest; full key reference in references/manifest.md.v0.x.0 version, contrib components follow the same minor, and confmap providers use the paired stable v1.y.0. Getting this wrong is the #1 build failure — see Version alignment for the contrib patch and stable-base rules.ocb --config=builder.yaml (binary is named builder when installed via go install). CI, Docker, multi-arch, and local-component workflows are in references/workflows.md../dist/<name> validate --config=<collector-config>.yaml, then start it and send test data (otel-telemetrygen skill). If the build fails, see references/troubleshooting.md.Pick the OCB version equal to the Collector core version you're targeting; the release pairings show which releases have a binary.
# Release binary (named ocb): https://github.com/open-telemetry/opentelemetry-collector-releases/releases?q=cmd/builder
# Go install (binary is named `builder`, not `ocb`):
go install go.opentelemetry.io/collector/cmd/[email protected]
The commands below use ocb, the release binary name. If you install with
go install, invoke the same commands as builder ... instead.
ocb init (experimental) scaffolds a new distribution repo — manifest, Makefile, sample config, README — in --path (default .).
# builder.yaml
dist:
name: otelcol-custom
description: Custom OpenTelemetry Collector distribution
output_path: ./dist
version: 1.0.0
receivers:
- gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.165.0
processors:
- gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.165.0
exporters:
- gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.165.0
- gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.165.0
providers:
- gomod: go.opentelemetry.io/collector/confmap/provider/fileprovider v1.71.0
- gomod: go.opentelemetry.io/collector/confmap/provider/envprovider v1.71.0
providers: semantics. Omitting the key entirely keeps OCB's built-in default set (env, file, http, https, yaml at the paired stable version). But setting providers: at all replaces that set. The generated Collector defaults conf_resolver.default_uri_scheme to env, so an explicit list without envprovider fails configuration validation unless you set another included provider as the default. Either omit the key, or include envprovider plus every scheme the collector's config will use.
Contrib components use the same list syntax:
processors:
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.165.0
Three version streams exist and must be paired:
| Stream | Modules |
|---|---|
v0.x.0 | OCB itself, all core components (go.opentelemetry.io/collector/...), contrib components in contrib's contrib-base module set |
v1.y.0 (stable) | confmap providers (confmap/provider/...), other 1.x modules (pdata, etc.) |
contrib v1.x (stable) | contrib modules in contrib's stable-base module set (e.g. processor/k8sattributesprocessor) |
Values hold for the named releases; check the current release before relying on them. The examples in this skill pin the v0.165.0 row. The Go version a build needs is the highest go directive among the manifest's modules at that tag: OCB and core need Go 1.26.0+, but some contrib v0.165.x modules (resourcedetectionprocessor, the Datadog components) declare go 1.26.9.
| Release (OCB, core) | Providers (core stable) | Contrib contrib-base → stable-base (k8sattributesprocessor) | Prebuilt OCB binary and image |
|---|---|---|---|
v0.165.0 | v1.71.0 | v0.165.0 → v1.4.0; patch v0.165.1 → v1.4.1 | published as 0.165.0 |
v0.164.0 | v1.70.0 | v0.164.1 → v1.3.1 (not v0.164.0; see troubleshooting) | published as 0.164.0 |
Evidence at each tag: providers in cmd/builder/internal/config/default.yaml (authoritative); stable-base is the processor/k8sattributesprocessor/v1.x tag on the contrib release commit (contrib versions.yaml can lag); collector-releases manifests; cmd/builder/go.mod; Docker Hub.
Rules:
v0.x.0 for OCB and every core component. Contrib components use the same minor, optionally a contrib patch (v0.x.1, which has no core counterpart; even --skip-strict-versioning=false compares only major.minor). Contrib modules in the stable-base set use the v1.x tagged with that contrib release, never v0.x.y (no such tag exists). The otelcol-contrib manifest of the matching collector-releases tag shows the pairing.default.yaml, not a guess.v prefix (v0.165.0, not 0.165.0).--skip-strict-versioning defaults to true, so mismatches surface as Go module resolution errors, not friendly OCB errors. Align versions up front instead of debugging go mod tidy output.ocb --config=builder.yaml # full build: generate + go mod tidy + compile
ocb --config=builder.yaml --skip-compilation # generate sources only (two-stage CI)
ocb --config=builder.yaml --skip-generate --skip-get-modules # compile pre-generated sources untouched
| Flag | Default | Purpose |
|---|---|---|
--config | embedded default manifest | Manifest path. With no --config, OCB builds otelcorecol, a minimal test-only distribution. |
--skip-generate | false | Don't regenerate Go sources |
--skip-compilation | false | Generate sources, don't compile |
--skip-get-modules | false | Don't run go mod tidy/downloads. Since v0.154.0 also leaves go.mod unregenerated. |
--skip-strict-versioning | true | Set to false to make OCB verify resolved versions against the manifest |
--ldflags / --gcflags | — | Extra go build flags |
--verbose | false | Log the underlying Go commands |
Generated output in output_path: main.go, components.go, main_others.go, main_windows.go, go.mod, go.sum, and the compiled binary named dist.name (.exe appended for Windows targets). By default binaries are stripped (-s -w); set dist.debug_compilation: true for Delve-friendly builds.
dist: fields, component spec (gomod/import/name/path), providers, replaces, excludes, conf_resolver, telemetryopentelemetry-collector-releasesWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
20 skills in this plugin
/otel-browserOpenTelemetry browser/RUM mechanics for SPAs and MPAs. Use for “browser OTel,” “frontend observability,” “Web Vitals,” `sdk-trace-web`, `WebTracerProvider`, `browser-sdk`, browser instrumentations, page-load or route tracing, sessions, clicks, console capture, JavaScript errors, or frontend-to-backend trace correlation. Browser telemetry is privacy- and volume-sensitive, and experimental packages move quickly. Not for Node.js service instrumentation or Collector-only configuration./otel-cicdObserve CI/CD pipelines with OpenTelemetry. Use when turning GitHub Actions or GitLab CI/CD runs, jobs and steps into traces with the Collector `github` or `gitlab` receiver (workflow_run and pipeline webhooks, the GitHub scraper), or keeping raw webhook payloads as logs with `webhook_event`; collecting pull-request, branch and repository (VCS) or DORA metrics such as lead time for changes; joining build or test processes to the pipeline trace through `TRACEPARENT` or otel-cli; exporting OTLP from Jenkins, Argo Workflows, Tekton, Buildkite, Concourse or Dagger; or applying the `cicd.*` and `vcs.*` semantic conventions. Triggers on "trace our GitHub Actions workflows", "GitLab pipeline traces in the Collector", "make test spans join the CI trace", and "instrument our pipeline runner". Not for testing OpenTelemetry changes in CI, dependency-update automation, or deployment verification.Generated from the plugin's indexed repository (ollygarden/opentelemetry-agent-skills) — no native marketplace selected
npx claudepluginhub p/ollygarden-opentelemetry-agent-skillsOther plugins' skills for the same job