otel-collector-builder
Skill126 starsChanged 4 months agoApache-2.0View on GitHub
Build custom OpenTelemetry Collector distributions with OCB (OpenTelemetry Collector Builder). Use when authoring or debugging a builder manifest (builder.yaml), choosing component and provider versions, building a collector that bundles a custom or out-of-distribution component, setting up CI or Docker builds of a distribution, or troubleshooting OCB build failures. Triggers on "ocb", "collector builder", "custom collector distribution", "builder manifest", "builder-config", and version-mismatch errors from OCB builds.
- Installs packages
In this repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- otel-browserSkill
- otel-collectorSkill
- otel-declarative-configSkill
- otel-dotnetSkill
- otel-goSkill
- otel-javaSkill
- otel-jsSkill
- otel-ottlSkill
- otel-profilesSkill
- otel-pythonSkill
- otel-rubySkill
- otel-sdk-versionsSkill
- otel-semantic-conventionsSkill
- otel-span-events-to-logs-migrationSkill
- otel-telemetry-emissionsSkill
- otel-telemetrygenSkill
- otel-upgradeSkill
- otel-weaverSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Use OCB when the stock otelcol/otelcol-contrib distributions don't fit: you need a component that ships in no distribution, a private/local …
- Very specific: line 18
Align versions: All core components share one v0.x.0 version, contrib components use the same v0.x.0, and confmap providers use the paired …
- Very specific: line 20
Verify: run ./dist/<name> validate --config=<collector-config>.yaml, then start it and send test data (otel-telemetrygen skill).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
OpenTelemetry Collector Builder (OCB)
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.
Workflow
- Install OCB at the version matching your target Collector version (see Install).
- Write the manifest —
dist:block plus component lists. Start from the minimal manifest; full key reference in references/manifest.md. - Align versions. All core components share one
v0.x.0version, contrib components use the samev0.x.0, and confmap providers use the paired stablev1.y.0. Getting this wrong is the #1 build failure — see Version alignment. - Build with
ocb --config=builder.yaml(binary is namedbuilderwhen installed viago install). CI, Docker, multi-arch, and local-component workflows are in references/workflows.md. - Verify: run
./dist/<name> validate --config=<collector-config>.yaml, then start it and send test data (otel-telemetrygenskill). If the build fails, see references/troubleshooting.md.
Install
Pick the OCB version equal to the Collector core version you're targeting; the dated record shows 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/builder@v0.163.0The commands below use ocb, the release-archive 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 .).
Minimal manifest
# 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.163.0
processors:
- gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.163.0
exporters:
- gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.163.0
- gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.163.0
providers:
- gomod: go.opentelemetry.io/collector/confmap/provider/fileprovider v1.69.0
- gomod: go.opentelemetry.io/collector/confmap/provider/envprovider v1.69.0providers: 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.163.0Version alignment
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) |
Verified 2026-10-25
Offline, cite this date, never call a value currently latest, and confirm it against the evidence before deploying. The examples in this skill pin the v0.163.0 row. OCB, core, and contrib-base components use the release version; both rows need Go 1.26+.
| Release | Providers (core stable) | Contrib stable-base (k8sattributesprocessor) | Prebuilt OCB binary and image |
v0.163.0 (tagged 2026-10-14) | v1.69.0 | v1.2.0 | published as 0.163.0–0.163.2 (same source) |
v0.162.0 | v1.68.0 | v1.1.0 | published |
Evidence at each tag: providers in cmd/builder/internal/config/default.yaml (authoritative), core and contrib versions.yaml, cmd/builder/go.mod, collector-releases, Docker Hub.
Rules:
- Use the same
v0.x.0for every core and contrib component, matched to the OCB version — except contrib modules in thestable-baseset of contrib'sversions.yamlat the matching tag; use that set'sv1.xversion, neverv0.x.0(no such tag exists). Theotelcol-contribmanifest of the same release shows the pairing. - Take providers from the release's embedded
default.yaml, not a guess. - Versions require the
vprefix (v0.163.0, not0.163.0). --skip-strict-versioningdefaults totrue, so mismatches surface as Go module resolution errors, not friendly OCB errors. Align versions up front instead of debugginggo mod tidyoutput.
Build commands and flags
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.
Reference files
- references/manifest.md — every manifest key:
dist:fields, component spec (gomod/import/name/path), providers,replaces,excludes,conf_resolver,telemetry - references/workflows.md — local component development, CI two-stage builds, Docker and multi-arch builds, relationship to
opentelemetry-collector-releases - references/troubleshooting.md — version mismatches, module conflicts, CGO, missing providers, runtime failures
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

