# open-telemetry/opentelemetry-collector-releases architecture

> Architecture diagram of the GitHub repository open-telemetry/opentelemetry-collector-releases, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/open-telemetry/opentelemetry-collector-releases
- Repository: https://github.com/open-telemetry/opentelemetry-collector-releases

## Overview

##### Project type and purpose
- This is a Go-based tooling repository (monorepo) that assembles and publishes multiple OpenTelemetry Collector distributions (“core”, “contrib”, “k8s”, “otlp”, “ebpf-profiler”).
- The primary function is build-and-release orchestration: compile Go binaries, build multi-arch container images, package OS installers (deb, rpm, brew), and push artifacts via GitHub Releases and container registries.

##### File structure analysis
- Top-level directories:
- cmd/ – CLI entrypoints: builder, goreleaser, opampsupervisor
- distributions/ – one subfolder per Collector distribution (each with its own Dockerfile, goreleaser config, service scripts, manifests)
- internal/tools/ – shared build utilities and Go modules
- scripts/ – shell scripts for ci, packaging and validation
- tests/ – Docker-based integration tests and MSI packaging tests
- Config and pipeline definitions:
- .github/workflows/ – GitHub Actions YAMLs for CI, testing, release
- .goreleaser.yaml & per-cmd/.goreleaser.yml – goreleaser definitions controlling artifact builds and publishing
- .chloggen/ & CHANGELOG.md – automated changelog generation
- Makefile – orchestrated local commands

##### README insights
- Describes purpose: assembly of distributions, artifacts produced, and lists sub-repos in distributions/
- Points to per-distribution README.md for details on config and packaging for each flavor

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Developer Environment"
        Makefile["Makefile"]:::code
        Scripts["scripts/"]:::code
        Changelog[".chloggen/config.yaml"]:::code
    end

    subgraph "CI/CD"
        Workflows[".github/workflows"]:::ci
        TestsDocker["tests/docker-tests"]:::ci
        TestsMSI["tests/msi"]:::ci
    end

    subgraph "Build Layer"
        BuilderCLI["builder CLI\n(cmd/builder)"]:::tools
        GoreleaserCLI["goreleaser CLI\n(cmd/goreleaser)"]:::tools
        OpampCLI["opampsupervisor CLI\n(cmd/opampsupervisor)"]:::tools
        SharedTools["internal/tools"]:::code
    end

    subgraph "Distributions"
        Core["otelcol"]:::code
        Contrib["otelcol-contrib"]:::code
        EBPF["otelcol-ebpf-profiler"]:::code
        K8s["otelcol-k8s"]:::code
        OTLP["otelcol-otlp"]:::code
    end

    subgraph "Artifacts"
        GitHubRel["GitHub Releases"]:::artifact
        DockerReg["Docker Registry"]:::artifact
        PackageRepos["OS Package Repos"]:::artifact
    end

    subgraph "External Services"
        GitHubExt["GitHub"]:::external
        DockerHubExt["Docker Hub"]:::external
        LinuxRepo["Linux Distro Repos"]:::external
        Brew["Homebrew Taps"]:::external
        WindowsStore["Windows Installer Stores"]:::external
    end

    GitHubExt -->|"push/PR triggers"| Workflows
    Makefile -->|uses| Workflows
    Scripts -->|provides scripts to| Workflows
    Changelog -->|configures changelog| Workflows

    Workflows -->|runs| TestsDocker
    Workflows -->|runs| TestsMSI
    Workflows -->|invokes| BuilderCLI
    BuilderCLI -->|uses| SharedTools
    BuilderCLI -->|triggers| GoreleaserCLI
    GoreleaserCLI -->|packages| Core
    GoreleaserCLI -->|packages| Contrib
    GoreleaserCLI -->|packages| EBPF
    GoreleaserCLI -->|packages| K8s
    GoreleaserCLI -->|packages| OTLP

    Core -->|artifact outputs| GitHubRel
    Contrib -->|artifact outputs| GitHubRel
    EBPF -->|artifact outputs| GitHubRel
    K8s -->|artifact outputs| GitHubRel
    OTLP -->|artifact outputs| GitHubRel

    Core -->|container images| DockerReg
    Contrib -->|container images| DockerReg
    EBPF -->|container images| DockerReg
    K8s -->|container images| DockerReg
    OTLP -->|container images| DockerReg

    Core -->|OS packages| PackageRepos
    Contrib -->|OS packages| PackageRepos
    EBPF -->|OS packages| PackageRepos
    K8s -->|OS packages| PackageRepos
    OTLP -->|OS packages| PackageRepos

    GitHubRel -->|published to| GitHubExt
    DockerReg -->|hosted on| DockerHubExt
    PackageRepos -->|sync to| LinuxRepo
    PackageRepos -->|sync to| Brew
    PackageRepos -->|sync to| WindowsStore

    click BuilderCLI "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/cmd/builder"
    click GoreleaserCLI "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/cmd/goreleaser"
    click OpampCLI "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/cmd/opampsupervisor"
    click SharedTools "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/internal/tools"
    click Core "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol"
    click Contrib "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib"
    click EBPF "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-ebpf-profiler"
    click K8s "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-k8s"
    click OTLP "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-otlp"
    click Workflows "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/.github/workflows"
    click Changelog "https://github.com/open-telemetry/opentelemetry-collector-releases/blob/main/.chloggen/config.yaml"
    click Makefile "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/Makefile"
    click Scripts "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/scripts"
    click TestsDocker "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/tests/docker-tests"
    click TestsMSI "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/tests/msi"
    click BuilderCLI "https://github.com/open-telemetry/opentelemetry-collector-releases/blob/main/cmd/builder/.goreleaser.yml"
    click OpampCLI "https://github.com/open-telemetry/opentelemetry-collector-releases/blob/main/cmd/opampsupervisor/.goreleaser.yml"
    click .goreleaser "https://github.com/open-telemetry/opentelemetry-collector-releases/blob/main/.goreleaser.yaml"

    classDef code fill:#D0E8FF,stroke:#0366d6,color:#0366d6
    classDef ci fill:#C8E6C9,stroke:#2e7d32,color:#2e7d32
    classDef tools fill:#FFE0B2,stroke:#ef6c00,color:#e65100
    classDef artifact fill:#FFF9C4,stroke:#f9a825,color:#f57f17
    classDef external fill:#E0E0E0,stroke:#757575,color:#424242
```
