Skip to content

How the Collector Maps to Chant

llms.txt lists every page for an agent

A collector config file has five component sections (receivers, processors, exporters, connectors, extensions) and a service block whose pipelines wire components together per signal. The otel lexicon gives each of those parts an entity.

Components are entities, ids come from the config

Section titled “Components are entities, ids come from the config”

A component entity is new <Class>(config). Its collector id is its type, or type/name when the config sets name. The export name in your source is chant’s name for the entity and never appears in the YAML, so renaming a variable cannot change the emitted config, and two differently named exports that declare the same id are reported (OTEL108) rather than silently merged.

Pipeline takes a signal (traces, metrics or logs), an optional name, and lists of receivers, processors and exporters. Each entry is either the entity itself, which TypeScript checks for kind, or an id string for a component declared somewhere chant can’t see. A component that a pipeline references by entity is emitted even if you never exported it, because the entity carries its config. A string that matches no declared component is OTEL101.

A connector is an exporter in one pipeline and a receiver in another, and it is how a collector turns traces into metrics (spanmetrics, servicegraph), splits traffic (routing) or chains pipelines (forward, count). In chant a connector is one entity listed in both pipelines: in exporters of the one that feeds it and in receivers of the one it feeds. Each connector reads and writes fixed signals, so a pipeline’s signal decides which side it can be on; OTEL101 and OTEL112 check both.

Declared extensions are enabled in declaration order. Declare a Service to choose the order, enable a subset, or set service.telemetry.

Sections always come out as receivers, processors, exporters, connectors, extensions, service. Within a section, components follow the order the build hands them over, and each component’s keys keep the order you wrote them in. Processor order inside a pipeline is significant to the collector and is emitted exactly as declared.

Each collector component defines its config as a Go struct in its own module, and upstream’s schemagen writes a config.schema.yaml next to it. The built-in config types are generated from those schemas at one collector-contrib release, recorded as COLLECTOR_PIN (v0.162.0), and scoped by the otelcol-contrib distribution’s manifest at that release: the modules a given otelcol-contrib binary is built from. otelcol-k8s is pinned too, for the coverage report. The schemas are kept in a committed snapshot (src/spec/otel-schemas.snapshot.json, refreshed with just snapshot), pinned by digest, and generation reads only that file.

A schema cannot say everything. Upstream publishes no schema for a few packages the configs embed (the health_check extension’s settings, hostmetrics’ scrapers, the googlecloud exporter’s settings from outside the collector), and it writes tail_sampling policies and the loadbalancing resolver as structs of optional members where only one may be set. For those, the built-in’s definition overlays a hand-written type, and it also marks the fields a component cannot start without as required, since the schemas mark none. The definitions add what a schema has no place for: checks on the config (validate), and the endpoints, protocols and connector signal pairs collectorTopology() reports. forward has no config and keeps a hand-written type.

coverageReport() lists the components each distribution ships, which of them are built in, and which upstream ships a schema for. Components outside the built-ins come in through defineComponent, which carries its own pin.

The lexicon writes the config file. It does not run a collector; composites in the platform lexicons do, see Composites.

chant