Building a custom OpenTelemetry Collector distribution with ocb

Teams that want only the receivers, processors and exporters they use can produce their own Collector binary with ocb. This page covers the manifest, pinning, CI builds, signing and attack surface trade-offs.

On this page

Why build a custom OpenTelemetry Collector distribution

A security or platform team often wants a Collector that contains only the receivers, processors, exporters and extensions its pipelines actually use. The OpenTelemetry Collector is a vendor-agnostic way to receive, process and export telemetry, and it can run as an agent next to workloads or as a gateway that accepts data from many sources. Its repository is licensed under Apache-2.0, which means the source can be compiled into your own binary under the terms of that license. OpenTelemetry's security guidance recommends building with only the components you need using the Collector Builder, because every component compiled into a binary is code you must review, patch and keep track of.

A custom build is usually the better fit when the published distributions carry components your environment will never run, when your security review requires a short, documented component list, or when you need to pin specific component versions and rebuild on your own schedule. It can also suit teams that must avoid shipping components their approved software inventory does not cover. Confirm these needs against your own policies before choosing, because a custom build moves responsibility for rebuilds, vulnerability tracking and release testing to your team or to the partner you hire for them.

Before committing, ask who will maintain the build over time. Ask which components your pipelines require today, which of them carry mixed stability levels as documented in each component's README, and how often your organization will rebuild when upstream releases arrive. Those answers decide the size of the manifest, the CI work and the upgrade cadence that the rest of this page describes.

Manifest sections and the choices each one controls

This table maps each section of the ocb YAML manifest to what it controls and the decisions your team makes there. Read it top to bottom before writing your first manifest, since the dist section shapes the build and the component lists determine what ends up in the binary.

Manifest sectionWhat it controlsDecisions for your team and when each fits
distCode generation and compilation: module name, output binary name and path, and the Collector version the build targetsChoose the module path, binary name and the Collector version to pin. Fits every build; pin one version and change it only through a reviewed pull request.
extensionsExtension components such as health check, authentication and storage extensions compiled into the binaryList only the extensions your pipelines reference, such as an OIDC authenticator or file_storage for buffering. Omit extensions you do not configure, since unused code still widens the binary.
exportersComponents that send telemetry to back ends, for example OTLP or vendor-specific exportersInclude exporters for each back end you actually use. Each new exporter adds a dependency you must track for upgrades and vulnerabilities.
receiversComponents that accept or collect telemetry, such as OTLP, filelog, hostmetrics or Kubernetes receiversInclude only the collection paths your agents and gateways run. Receivers that open network listeners deserve the closest review, since they define exposed attack surface.
processorsComponents that transform, batch, filter or limit telemetry, such as memory_limiter, batch, transform, filter and redactionInclude the processors your pipelines call. Keep memory_limiter in every pipeline you build, and confirm the redaction processor is present wherever sensitive attributes may appear.
Go toolchainThe language runtime that ocb needs to generate and compile the distributionConfirm the build host or CI image has the Go version the chosen Collector release requires. Pin it in CI so builds stay reproducible.
Component stabilityMaturity of each component, which can differ from the Collector core and between signalsCheck each component's README before adding it. Components at mixed stability levels may change configuration or names between releases, so record their levels in your build review.

How a manifest becomes a signed Collector binary

The build starts with a YAML manifest that lists the receivers, processors, exporters and extensions you chose, plus a dist section that controls code generation and compilation. The ocb builder generates Go code from that manifest and compiles it into a binary, which needs Go on the build runner. CI then tests the binary and signs it before it moves to the environments that run the Collector. Check each hand-off: who can change the manifest, who runs the build, and who holds the signing key.

Trust boundaries sit at the manifest, the build runner and the signing step.

Build sequence from manifest to deployed binary

This sequence turns a chosen Collector version and a minimal component list into a signed, checksummed binary that is verified on the host where it runs. Each step ends with a check, so a failure is caught before the build reaches production.

  1. Choose the Collector version and pin it

    The platform or observability team selects the OpenTelemetry Collector version the build will target and records it in version control. Pick a release from the official releases list and check its changelog for component stability notes, since core components have mixed stability levels documented in each component's README. Pin the core module versions in the manifest so that a rebuild next month produces the same component set. Done when the chosen version, its release date and the stability level of every planned component are written down in the build repository.

  2. Write the manifest with only required components

    The engineer writing the ocb manifest lists only the extensions, receivers, processors and exporters the pipelines actually use. The manifest is YAML: the dist section controls the generated module name, output path and binary name, and the other sections list each component with its Go module path and pinned version. Every component added here is code that ships in the binary, so review each entry against the pipeline design. Done when a peer review confirms that each listed component maps to a configured pipeline and that no component is included only because it is in an example file.

  3. Generate and compile with ocb

    The build engineer runs the Collector Builder against the manifest on a machine or CI runner with the Go toolchain installed, as the ocb documentation requires. The builder generates a Go module from the manifest and compiles it into a single binary. Confirm the exact ocb command, its flags and the Go version requirement in the official ocb documentation before scripting it. Done when the build completes without dependency resolution errors and the output binary runs its version command.

  4. Run configuration and component tests

    The team validates the built binary against the configuration files that will run in production, using the Collector's configuration validation before any traffic is sent. Add tests for each custom component or configuration path, and run the pipelines against sample OTLP input in a non-production environment. Confirm that an unknown component in a configuration file fails validation, because that failure is how a missing component in the manifest shows up. Done when every production configuration validates against this binary and sample telemetry flows end to end through each pipeline.

  5. Produce the artifact and record its checksum

    The CI job stores the compiled binary in an artifact repository together with its build metadata: the manifest, the Collector version, the Go version and the build time. Generate a SHA256 checksum for the binary and store it alongside the artifact, matching the checksum practice the official Collector releases use. Keep the manifest in the same commit as the build so the component list can be reproduced. Done when a second person can download the artifact, recompute the checksum and get the same value.

  6. Sign the binary and attach an SBOM

    The security or release engineer signs the binary with the organization's signing key or keyless signing service, and produces a software bill of materials that lists the components compiled in. Store the signature and SBOM with the artifact and confirm that the signing identity is restricted to the release pipeline. Confirm the signing and SBOM tooling options with your own security policy and the official build documentation. Done when signature verification passes against the published public key or identity, and the SBOM lists every component in the manifest.

  7. Deploy the binary and confirm its components

    The operations team deploys the signed binary through the normal change process to the hosts or container images that run the Collector. Before the Collector receives production traffic, verify the signature and checksum again on the target, then check the running build's reported components against the manifest. Any component listed in the manifest but absent at runtime, or present but not in the manifest, blocks the rollout. Done when the component list reported by the running binary matches the manifest exactly and the pipelines report healthy after restart.

Why a smaller build reduces attack surface

A custom Collector binary contains only the components you list in the builder manifest, so every compiled receiver, processor, exporter and extension becomes something your team owns. The cards below cover what that narrower footprint changes in code paths, advisories, open endpoints and assessment scope, and what your team still has to do to keep it true.

Fewer code paths compiled in

Each receiver, processor, exporter and extension in the manifest adds its own parsing logic and configuration handling to the binary. A build that omits components it never uses removes those code paths from the running process entirely. Check the manifest against the pipelines in your configuration files, because a component that is listed but never referenced still ships and still counts toward review.

Build with ocb

Fewer dependencies in advisories

Every compiled component brings Go module dependencies, and each dependency can receive a security advisory. Your team must track advisories only for the components it keeps, which makes the watch list shorter and the triage queue easier to clear. Pin the versions in the manifest and record which advisories apply to the build you deployed.

Fewer open endpoints to configure

Receivers and extensions that open listening ports are the Collector's network exposure. Removing unused ones means fewer ports to firewall, fewer TLS and authentication settings to verify, and fewer entries in your network diagrams. Since Collector v0.110.0, server components bind to localhost by default, so confirm each remaining listener and bind address explicitly in configuration.

Configuration best practices

Fewer components in assessments

A reviewer assessing the Collector must understand what each compiled component does, what data it touches and how it is configured. A short, documented component list lets security engineers and compliance leads scope their review to the components in use. Keep the manifest in version control so the reviewed list and the deployed list stay identical.

Stability levels still need review

Core Collector components have mixed stability levels, and each component's README documents its own status. A smaller build does not remove the need to check whether the components you keep are stable enough for your data path. Record the stability level of every retained component in your build documentation and revisit it at each upgrade.

OpenTelemetry status

Pinning Collector versions or following releases

Pinning means the manifest names one Collector version and every build uses it until someone changes that value on purpose. The same manifest then produces the same component set and code, which makes reviews, rollbacks and audit evidence simpler. The cost is that your team owns every upgrade, including the security fixes that land in later releases, so the pin must be reviewed on a schedule rather than forgotten.

  • Who does the work: Your platform or observability team owns each bump, from reading release notes to rebuilding, testing and rolling out the binary. Confirm whether a partner will carry this work under a retainer or whether it stays with your staff.
  • How often the manifest changes: Only when someone decides to move the pin. Between bumps the manifest stays fixed, which keeps review load low but lets known issues age in production.
  • Breaking change risk: Breaking changes arrive in a batch at upgrade time, so the team must test every component you ship against the new version in one pass.
  • Security exposure: A pin that stays old can miss fixes. Set a review cadence so an outdated pin is an explicit decision, not an accident.
  • Reproducibility: Pair the pin with stored build inputs and recorded artifact checksums so a rebuild six months later produces an identical binary.

Before any bump, read the release notes for every version between your pin and the target, and confirm that each component in your manifest still exists under the same name and configuration keys.

How CI builds and signing make the binary verifiable

A custom Collector binary is only as trustworthy as the path that produced it, so the CI pipeline should be able to rebuild the same binary from a committed manifest at any time. Keep the builder-config.yaml manifest in version control with every component pinned to an explicit module version, and treat any change to that file as a reviewed change. The pipeline should run ocb from a pinned builder version against that manifest, build for each target platform, and fail if the manifest references an unpinned or unexpected module. Store the Go toolchain version alongside the manifest so a reviewer can reproduce the build later without guessing which compiler produced the binary.

Every build should publish a SHA256 checksum for each artifact and an SBOM that lists the exact receivers, processors, exporters and extensions compiled in, with their versions. These files let the team confirm what is inside the binary and detect tampering after the build. Collector releases already follow this model, shipping signed artifacts, SHA256 checksums and SBOM files, so the team can compare its own release outputs against that structure. The signature is the control that proves who produced the artifact, and the checksum alone only proves the file was not corrupted.

Before you adopt this model, confirm three things with your own team. First, confirm who holds the signing keys, whether keys live in a managed key service or hardware-backed storage, and who can trigger a signing job. Second, confirm how the build runner is secured, including ephemeral runners, restricted network egress for module downloads, and separation between the runner that builds and the runner that signs. Third, confirm how deployments verify the artifact before running it, such as checking the signature and checksum in the rollout pipeline and refusing binaries that lack a matching SBOM. Write these answers down as part of the release runbook, because an auditor or incident responder will ask for them.

Operational risks after the custom build ships

A custom Collector binary is only as safe as the process that maintains it. The cards below cover the recurring work that keeps the build current, trusted and locked down after the first deployment, and each one has an owner and a repeating task.

Track Collector and component advisories

Every component in your manifest carries its own stability level and release history, so a fix in one receiver or processor can matter even when the Collector core is unchanged. Assign a named owner to watch the Collector releases page and the component READMEs for the modules you compile in. Check each advisory against the versions in your manifest and record the decision, even when the answer is to take no action.

Collector releases

Rebuild on each release

A pinned build is only current if someone rebuilds it. Schedule a recurring task, owned by the platform team, to bump the versions in the manifest, regenerate the code with ocb, run the build in CI and roll the new binary through staging before production. Keep the rebuild separate from unrelated config changes so a regression can be traced to one cause.

Protect the signing keys

If you sign your binaries, the private key is the most sensitive item in the pipeline. Keep it in a managed key store or hardware-backed signer, limit which CI jobs can use it, and log every signing event. Review the list of principals with access each quarter and rotate the key on a schedule your security team sets, with the old key revoked once consumers trust the new one.

Encrypt and authenticate configuration

Collector configuration often contains endpoints, tokens and tenant identifiers, so it belongs under the same controls as other secrets. Store it encrypted at rest, inject credentials at runtime from a secrets manager, and enable authentication on receivers and exporters, for example with the oauth2client extension for outgoing requests. The owner should confirm during each rebuild that no credential appears in the manifest or the rendered configuration.

Redact sensitive attributes

Telemetry leaves your applications with more data than anyone intended, including user identifiers, query strings and headers. Add the redaction processor to every pipeline that handles production traffic, and list the attribute keys your teams have agreed are sensitive. Review the list when new services or libraries are onboarded, and sample exported data periodically to confirm that values are removed before they reach a back end.

Keep server components on localhost

Since v0.110.0, server components bind to localhost by default instead of 0.0.0.0. Any change that exposes a receiver to the network is therefore a deliberate decision, so record it in the manifest review. Ask the owner to confirm each exposed endpoint has authentication and network controls, and check the bind address after every upgrade so a configuration copied from an older example does not widen access.

Questions teams ask before building their own Collector

How much effort does a first custom Collector build take?

The effort depends on how many components you include, whether any of them are custom, how deep your testing goes, and how mature your CI is. A first build with only standard receivers, processors and exporters is mostly manifest work, pinning and a pipeline that compiles and runs the binary. Each custom component adds Go development, unit tests and integration tests against the Collector's component interfaces. Ask any partner to break its estimate into those four drivers so you can see which ones your team already covers. No duration figure is given here because none has been researched for this topic.

Can our own team build a custom Collector without outside help?

Yes, if your team already writes Go, runs CI pipelines and owns container or binary releases. The core task is writing a manifest for ocb, which the OpenTelemetry documentation describes as a YAML file with a dist section for code generation and compilation, plus sections listing extensions, exporters, receivers and processors. Teams without Go experience usually need either training or a partner for the first build and the handover. Outside help is most useful for the first build, for custom components and for setting up signing and release controls that your auditors will ask about.

What skills, runners and owners does an ocb build need?

Plan for four things before the first build starts:

  • Go skills to read the generated code and maintain any custom components, since ocb requires Go.
  • A CI runner with network access to fetch module dependencies and the build toolchain.
  • A signing key or keyless signing process, with the key stored in a managed secret store and a documented rotation procedure.
  • A named owner for upgrades who tracks Collector releases and rebuilds the binary when a security fix or needed component changes.

If any of these is missing, the build may work but will not be repeatable or easy to audit.

How often do we need to rebuild a custom Collector?

You rebuild whenever you change the manifest, move to a new Collector version, or need a security fix in an included component. The OpenTelemetry Collector project publishes releases on a regular cadence, and recent releases in the supplied facts were v0.161.0 on September 16, 2026, v0.162.0 on September 29 and v0.163.0 on October 16, 2026. Your own rhythm should follow your policy for vulnerability response and your change windows, not the upstream release date alone. Confirm your release cadence with whoever owns the pipeline, and record it in the build's runbook.

Why does a smaller Collector build reduce security risk?

A binary that contains only the components you use has fewer code paths that could contain a vulnerability, and fewer dependencies to track. OpenTelemetry's security guidance recommends building with only the needed components through the Collector Builder. Smaller builds also make review simpler, because your security team can check a short component list against what the pipeline actually uses. Smaller does not replace other controls, so pair it with encrypted, authenticated endpoints and a redaction processor for sensitive attributes.

What should a partner quote for a custom Collector include?

A written quote should list the following, so you can compare it with your own estimate:

  • The component list and which components are custom, with the reason for each.
  • Testing scope, including unit tests, configuration tests and runs against your back ends.
  • CI pipeline work: build, pinning, artifact storage, signing and checksum generation.
  • Handover items: runbook, named owners, and training for your Go and operations staff.
  • Recurring work: rebuild cadence, upgrade support and any retainer terms.

DeployOpen agrees on scope, deliverables and timelines in writing before work starts, and the quote follows from that scope.

What does the Collector build cost us to run over time?

The one-time cost is the first build, the component work and the CI setup. The recurring cost is the rebuild and upgrade cycle, testing against new releases, key management and the time your owner spends on vulnerability response. Ask for these recurring items to be separated in any quote, and decide up front whether your team or a retainer will carry them. No price figure is given here, because none has been researched and DeployOpen does not publish a price list.

Should we use a prebuilt distribution instead of building our own?

Build your own when the prebuilt distributions include components you do not need, or when they lack components you do need, and when you can staff the upgrade cycle. Otherwise a prebuilt distribution with a clear update path is usually less work. The choice affects support, update timing and how much of the component list you can audit, so compare them against the same list of components you actually use. The companion topic on choosing a Collector distribution covers this trade-off in more depth.

What to confirm in your environment before committing

A custom Collector binary is only as good as the component list behind it. The cards below cover the decisions that determine whether your build compiles, runs and stays supportable after the first release. Treat each one as a question to confirm with the vendor documentation or your own environment before you commit.

Component stability levels

Each receiver, processor and exporter carries its own stability level, documented in the component's README. Before you add a component to the manifest, confirm its stability for the signals you plan to send. A component still in development may change configuration keys between releases, which means your manifest and your collector configuration both need rework on upgrade. Record the level for every component you include.

OpenTelemetry status

Components present in your target version

Module versions in the builder manifest must line up with the Collector version you pin. Confirm that every receiver, processor and exporter you need exists in that release line, because components are added, renamed and moved between core and contrib over time. Check the release notes for the version you intend to build against, and test the manifest against that exact version before you rely on it.

Authenticator coverage for identity needs

If your receivers must authenticate clients or your exporters must send credentials, confirm that an authenticator extension covers your identity model. OIDC validation on receivers and the oauth2client extension on exporters are the cases to check against your identity provider's token format, audience rules and token lifetimes. Do not assume a component in the list handles your provider until you have tested the token flow end to end.

Collector configuration docs

Go and build toolchain in CI

The builder requires Go, and the Go version your CI image provides must match what the Collector release expects. Confirm that your build runners can fetch modules from the public proxy or from your internal mirror, because a build that cannot resolve dependencies fails before any code is produced. Also check that the runner image is patched and that build caches cannot silently pull in different module versions than the manifest specifies.

Signing and key management policy

A custom binary you build is your own artifact, so your organization must decide who signs it, where the signing key lives and how verification happens at deploy time. Confirm whether your policy requires hardware-backed keys, keyless signing or a central signing service, and whether your deployment tooling can verify signatures and SHA256 checksums before rollout. Ask who rotates keys and how a compromised key is revoked.

Collector release artifacts

Ownership of rebuilds

A custom distribution must be rebuilt for every Collector upgrade, security fix and component change, so someone on your platform team has to own that cycle. Confirm that the team can review release notes, update the manifest, run tests and roll out the binary on a schedule. If no one owns rebuilds, an official distribution with a supported update path is usually the safer choice.

How DeployOpen scopes and delivers a custom Collector build

DeployOpen plans, builds, documents and supports custom OpenTelemetry Collector distributions inside your own infrastructure and build systems. We start from the components your pipelines actually use, so the manifest, pinning, CI and handover reflect your environment rather than a generic template.

How we scope

  • Inventory the receivers, processors, exporters and extensions your pipelines need, and record why each one is required.
  • Agree the Collector versions, Go toolchain and build host in writing before any build work starts.
  • Engagements are fixed-scope, with deliverables and timelines confirmed in writing. Ongoing support is available as a retainer.

How we build

  • Write the ocb manifest with the dist section and component lists, and pin every module to a reviewed version.
  • Set up CI jobs that generate and compile the binary, run configuration validation and fail on unexpected components.
  • Wire up artifact signing and checksum generation so each build can be traced back to its manifest and source commit.

How we hand over

  • Deliver the manifest, CI pipeline, build documentation and a component inventory for each released binary.
  • Document the upgrade procedure, including how to bump Collector versions and re-verify the component set.
  • Walk your platform and security teams through the build, the verification steps and the rollback path.

How we support

  • Review each Collector release notes against your manifest and flag component changes or deprecations before you upgrade.
  • Run retests of the build after dependency updates, and update the component inventory and documentation accordingly.
  • Offer ongoing support, upgrades and continuous checks as a retainer, scoped in writing for your build cadence.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.