
Collector to Collector: choose authentication for the hop you have
By Nicolas Narbais
Two Collectors can authenticate with TLS, mTLS, basic auth, bearer tokens, OIDC, or a service mesh. Each answers a different question, and the right one depends on the boundary the hop crosses.
An OpenTelemetry Collector hop terminates an inbound connection and opens a new outbound connection. Treating both sides as one security boundary creates broken assumptions about who sent what.
Choose authentication for a Collector hop by answering three questions:
- Boundary: Does this hop stay on one node, cross namespaces, cross clusters, or cross organizations?
- Sender identity: Does the receiving pipeline need a verified name for the sender?
- Persistence: Must that verified identity survive the next hop?
TLS, mTLS, basic auth, bearer tokens, OIDC, and service meshes are not a ladder of upgrades. Each solves a different slice of admission control vs sender attribution.
Verified against Collector v0.160.0: Every option name, context key, and stability level below was checked against opentelemetry-collector and opentelemetry-collector-contrib at tag v0.160.0 (released September 2, 2026).
A Collector hop resets transport identity
Consider a node agent forwarding to a gateway Collector, which exports to an observability backend:
Because the gateway opens a brand-new outbound request, the backend authenticates the gateway, not the original agent. That separates two distinct security jobs:
- Admission control: May this sender connect?
- Attribution: Which verified sender produced this telemetry?
If downstream systems need sender attribution, write the verified identity into a resource attribute at the gateway or inject a trusted outbound header. Never expect the next hop to infer it from the previous TLS handshake.
Lock down bind address and network reachability first
Before picking credentials, restrict who can reach the receiver. Since Collector v0.110.0, receivers default to localhost; in Kubernetes, bind to the pod IP instead of 0.0.0.0 (Collector security best practices):
receivers:
otlp:
protocols:
grpc:
endpoint: ${env:MY_POD_IP}:4317
Pair that with a Kubernetes NetworkPolicy allowing only approved sender namespaces:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: gateway-otlp-ingress
namespace: observability
spec:
podSelector:
matchLabels:
app: otel-gateway
policyTypes: [Ingress]
ingress:
- from:
- namespaceSelector:
matchLabels:
otel-send: "true"
ports:
- protocol: TCP
port: 4317
- protocol: TCP
port: 4318
Test from an unselected namespace and confirm the connection is refused. A NetworkPolicy ignored by your CNI provides zero protection.
Use TLS and mTLS for transport security and admission control
Enable validated TLS on every hop that leaves a node or crosses an untrusted network, and do not set insecure_skip_verify to hide certificate mismatches.
For strong connection admission, add client_ca_file for mTLS at the Collector and enable client_ca_file_reload (defaults to false):
receivers:
otlp:
protocols:
grpc:
endpoint: ${env:MY_POD_IP}:4317
tls:
cert_file: /certs/gateway.crt
key_file: /certs/gateway.key
client_ca_file: /certs/collector-ca.crt
reload_interval: 1h
client_ca_file_reload: true
mTLS admits connections; it does not populate auth.* pipeline attributes. Neither receiver mTLS nor a Kubernetes Gateway/load balancer terminating mTLS (Gateway API mTLS example) exposes a portable client-certificate identity to Collector processors. When processors need a verified sender name, add an authenticator extension or a trusted proxy header contract.
Compare every authentication mechanism at v0.160.0
| Mechanism | Admission control | Pipeline identity (auth.*) | Rotation / reload | Stability (v0.160.0) |
|---|---|---|---|---|
NetworkPolicy | Source reachability only | None | N/A | CNI-dependent |
| TLS | Client verifies server | None | reload_interval | Stable |
| Collector mTLS | Strong (client_ca_file) | None documented | reload_interval + client_ca_file_reload | Stable |
| Proxy / Gateway mTLS | Strong at proxy | None at Collector | Owned by proxy | N/A |
| Mesh mTLS + authz policy | Strong at sidecar | None unless propagated & tested | Owned by mesh | N/A |
| Static bearer token | Yes | None | File reload undocumented | Beta |
| Basic auth | Yes | auth.username | Client files watched; server htpasswd.file undocumented | Beta |
| OIDC receiver auth | Yes | auth.claims.* | Issuer-managed | Beta |
Add basic auth or OIDC when processors need sender identity
Both static bearer tokens and basic auth rely on static secrets over TLS. Choose basic auth when you operate a small set of named senders without an IdP and need the verified username inside processors. Its client username_file and password_file options reload live, while changing the server’s htpasswd.file requires a gateway rollout.
processors:
resource/sender_identity:
attributes:
- key: telemetry.sender
from_context: auth.username
action: upsert
Choose OIDC for multi-tenant or partner ingestion where identity carries verified claims (tenant, audience, subject). Pair a receiver OIDC extension with an OAuth2 client-credentials extension on the outbound Collector:
processors:
resource/tenant:
attributes:
- key: tenant.id
from_context: auth.claims.tenant_id
action: upsert
auth.* vs metadata.* is a trust boundary: metadata.tenant_id reads an unverified header supplied by the caller; auth.claims.tenant_id reads a claim verified by the authenticator. Never drive tenancy, routing, or billing from metadata.*.
Service meshes handle transport, not pipeline attribution
If both Collectors run inside a mesh such as Istio, enforce strict mTLS (permissive mode still accepts plaintext) and authorization policies on OTLP ports. That removes TLS cert management from Collector YAML, but it still does not populate processor identity unless you build and test an explicit proxy-to-Collector contract. Verify what the receiver actually sees in a local Docker Compose lab.
Stamp verified identity deliberately and watch batch cardinality
Workload identity (k8s.pod.name, service.name) belongs at the node agent before hops hide the workload (Kubernetes OTel stack). Sender identity (telemetry.sender, tenant.id) belongs at the gateway, which owns three places it matters:
- Telemetry attributes:
upsert(overwrite) the sender or tenant attribute at the gateway so callers cannot spoof it. - Gateway routing: route only on verified
auth.*values or gateway-stamped attributes. - Outbound headers: inject downstream tenant headers only after inbound authentication succeeds.
If you partition batches by sender using the batch processor’s metadata_keys (requires include_metadata: true on receivers), remember every distinct key combination spawns a long-lived batcher up to metadata_cardinality_limit (default 1,000). Always validate batching keys through an auth extension first so an arbitrary header cannot exhaust gateway memory.
Pick the authentication stack for your hop
| Hop scenario | Recommended baseline |
|---|---|
| App to node-local agent | localhost or Unix socket; no extra auth needed |
| Agent to gateway (same cluster) | Pod-IP bind + NetworkPolicy + TLS; add basic auth or OIDC if sender name is needed |
| Collector hop inside a mesh | Strict mesh mTLS + authorization policy; test any identity-propagation header |
| Cluster-to-cluster (same org) | Private network + TLS + mTLS; add basic auth or OIDC if gateway must name source cluster |
| Partner or multi-tenant ingestion | TLS + OIDC issuer + receiver OIDC verification; promote verified claims into attributes |
| Large fleet workload identity | SPIFFE/SPIRE if you operate it, with explicit pipeline mapping |
Roll out gateway security in six steps:
- Bind receivers to pod/private IPs and verify
NetworkPolicyrejects unauthorized namespaces. - Require validated TLS on every hop leaving a node.
- Add mTLS or strict mesh policy across cluster, account, or org boundaries.
- Add basic auth (per-sender username) or OIDC (verified claims) only where processors need verified identity.
- Overwrite sender/tenant attributes at the gateway before forwarding.
- Enable metadata-aware batching only when isolation requires it, and monitor batcher cardinality.
Pick one Collector-to-Collector hop in your production topology today, classify whether it needs admission control or pipeline attribution, and remove every unverified metadata.* trust assumption before your next rollout.
Written by
Nicolas Narbais
Nicolas Narbais builds, breaks, debugs, and scales observability systems using OpenTelemetry and modern telemetry pipelines. He shares practical, opinionated lessons to help engineers get better signal with less noise.
Olatuak Editorial Philosophy
Better signal, not more telemetry.
Olatuak helps platform engineers, SREs, and observability teams turn noisy telemetry into clear operational decisions without blindly collecting more data.
