repowiseopen-telemetry/opentelemetry-collector

Architecture of open-telemetry/opentelemetry-collector

open-telemetry/opentelemetry-collector is 2,311 source files holding 13,821 symbols across 21 modules, written mainly in Go, Makefile, Shell. The largest module is pdata, with 585 files, and 8 files are entry points into the dependency graph.

How opentelemetry-collector fits together

Telemetry enters through receiver endpoints, and configuration is loaded from layered YAML files. The confmap package merges the configured locations into one configuration by asking a registered provider to fetch each one and then expanding references in the result. The component package defines what a component must do to start and stop and what it can ask of its host. The connector package passes telemetry of one signal type to downstream consumers, which may belong to a pipeline of another signal type. The pdata package holds the shared in-memory data model that telemetry is kept in as it moves through the pipeline. The cmd/builder/main.go entry point builds a custom collector binary, while cmd/mdatagen and cmd/schemagen generate Go code from declarative files.

Largest modules

  • pdata: 585 files and 66,915 lines of code
  • exporter: 177 files and 22,284 lines of code
  • internal: 139 files and 16,549 lines of code
  • service: 130 files and 19,038 lines of code
  • cmd: 113 files and 19,690 lines of code
  • config: 90 files and 13,326 lines of code
  • confmap: 65 files and 7,337 lines of code
  • processor: 61 files and 5,529 lines of code

Languages

By file count: Go 1,579 files, Makefile 101 files, Shell 22 files.

Documentation

Repowise documents opentelemetry-collector in 1,912 pages generated from the source, 58 of them written explanations of the repository and its modules. Module guides include:

  • config/configauth: Auth and Transport Configs
  • cmd: Cmd Overview
  • otelcol: Collector Assembly

More on opentelemetry-collector: summary and FAQ, codebase overview, code health.

Related guide: Best dependency graph tools for monorepos