# OpenTelemetry-powered distributed tracing and Kubernetes events in OpenChoreo

Site [llms.txt](/llms.txt)

---

Getting code from a developer's editor into production means building it,
testing it, deploying it, and then understanding how it behaves once it's
running. Internal Developer Platforms (IDPs) promise a "golden path" through all
of that, so developers can focus on business logic instead of wiring up tooling.
Observability is one important step in that path as it helps to understand what
your workloads are doing. But there are too many observability tools to choose
from, too many components to wire together and too many dashboards to manage. So
observability has become a platform problem.

This article looks at how OpenChoreo tackles that problem with OpenTelemetry. It
uses the [OpenTelemetry Collector](/docs/collector/) to deliver two platform
features: distributed tracing, and persistent, enriched Kubernetes events.

## What is OpenChoreo?

[OpenChoreo](https://openchoreo.dev/) is a
[CNCF Sandbox project](https://www.cncf.io/sandbox-projects/): a modular, open
source Internal Developer Platform for Kubernetes. Building, deploying,
observing, and securing applications work out of the box, and a growing
ecosystem of modules lets platform teams swap in the tools they prefer to use.

A module is a pluggable integration, typically packaged as a Helm chart, that
provides one platform capability with a specific tool: an API gateway, a CI
workflow engine, or an observability backend, for example. Available modules are
listed in the [OpenChoreo ecosystem](https://openchoreo.dev/ecosystem/), and the
[modules overview](https://openchoreo.dev/docs/platform-engineer-guide/modules/overview/)
explains how they work.

OpenChoreo splits the platform into planes, each running on Kubernetes. A
control plane manages platform state. One or more data planes run the workloads.
Optional workflow planes run build and test workflows, and an observability
plane collects and serves observability data. On top of these, an experience
plane gives both people and AI agents a way in, through a
[Backstage](https://backstage.io)-based portal, a CLI, IDE integrations, and MCP
servers.

```mermaid
flowchart LR
    exp["Experience plane<br/>Portal, CLI,<br/>AI agents"] <--> cp["Control plane"]
    cp --> dp["Data planes<br/>Workloads"]
    cp --> wp["Workflow planes<br/>Build and test<br/>workflows"]
    dp -->|"runtime<br/>telemetry"| modules
    wp -->|"workflow<br/>telemetry"| modules
    observer -->|"query<br/>telemetry"| exp

    subgraph op["Observability plane"]
        modules["Logs, metrics, traces<br/>modules"] --> observer["Observer"]
    end
```

_Figure 1: OpenChoreo's planes. Data and workflow planes send telemetry to the
observability plane's modules, and the Observer serves it to the experience
plane._

## Observability as a core pillar

An IDP isn't complete until you can see what's happening to the platform and
especially to the workloads. That's why OpenChoreo builds observability in from
the start rather than bolting it on later. The observability plane collects
logs, metrics, traces and events from across the platform.

At the centre of that plane is the Observer, which follows a
[hexagonal](https://en.wikipedia.org/wiki/Hexagonal_architecture), or "ports and
adapters", architecture. On one side, it exposes logs, metrics, and tracing APIs
(the inbound ports) that the portal, CLI, and agents query. On the other side,
it connects to storage backends through adapter APIs with published specs. Each
backend ships as an
[ecosystem module](https://github.com/openchoreo/community-modules) that
implements the relevant adapter, so moving traces from
[Jaeger](https://www.jaegertracing.io/) or [OpenSearch](https://opensearch.org/)
to AWS X-Ray means installing a different Helm chart, not changing the platform.

```mermaid
flowchart TB
    portal["Portal"] --> inbound
    cli["CLI"] --> inbound
    agents["AI agents"] --> inbound

    subgraph observer["Observer"]
        inbound["Logs, metrics, and tracing APIs<br/>(inbound ports)"]
        core{{"Observer core"}}
        outbound["Adapter APIs<br/>(outbound ports)"]
        inbound --> core --> outbound
    end

    outbound --> logs["Logs module<br/>OpenSearch,<br/>OpenObserve, ..."]
    outbound --> metrics["Metrics module<br/>Prometheus,<br/>CloudWatch, ..."]
    outbound --> traces["Tracing module<br/>OpenSearch,<br/>AWS X-Ray, ..."]
```

_Figure 2: The Observer's hexagonal architecture. Consumers query the inbound
ports at the top; pluggable adapter modules at the bottom talk to the chosen
backends._

This design also means OpenChoreo doesn't prescribe how telemetry is collected.
Each module can make that choice independently, while the Observer's adapters
keep the experience the same for the portal, CLI, and agents. For example, the
default logs module uses [Fluent Bit](https://fluentbit.io/), a lightweight
processor widely used to ship container logs on Kubernetes. The default metrics
module builds on [Prometheus](https://prometheus.io/), which many platform teams
already run for cluster metrics, while some cloud-specific metrics modules
follow their provider's conventions; the AWS CloudWatch metrics module, for
example, uses the OpenTelemetry Collector. For the default traces module, the
OpenTelemetry Collector is the natural fit, because applications already emit
spans through OpenTelemetry SDKs and [OTLP](/docs/specs/otlp/). A team that
prefers OpenTelemetry for logs or metrics can use a Collector-based module
instead, without changing the platform. The OpenTelemetry Collector also
captures Kubernetes events, and these two OpenTelemetry-powered features are the
focus of this article.

## Where OpenTelemetry fits

OpenChoreo relies on the OpenTelemetry Collector for two features, and runs a
different Collector for each:

- **Distributed tracing** uses the upstream
  [Collector Contrib distribution](/docs/collector/distributions/), with a
  pipeline that OpenChoreo configures.
- **Kubernetes events** use a purpose-built Collector distribution, built with
  the [OpenTelemetry Collector Builder](/docs/collector/extend/ocb/) (OCB). It
  adds a custom processor that enriches each event with metadata about the
  object it refers to.

### Distributed tracing

Without distributed tracing, debugging a request that fans out across dozens of
microservices is very difficult. OpenChoreo streamlines this: developers only
add an [OpenTelemetry SDK](/docs/languages/) or
[zero-code instrumentation](/docs/zero-code/) for their language, then set the
standard `OTEL_*` environment variables on their workload so spans are exported
over OTLP to the Collector that OpenChoreo runs. From there, the platform takes
over:

- **Receive.** The `otlp` receiver ingests spans from workloads. A Collector
  runs local to each data plane, so spans are processed before they leave the
  cluster they came from.
- **Enrich.** The
  [`k8sattributes`](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/c64840337cf400792cb684037ed998428b268197/processor/k8sattributesprocessor)
  processor matches each span to the pod that produced it and attaches that
  pod's Kubernetes metadata. Because OpenChoreo labels every workload it
  deploys, those labels map each span back to OpenChoreo concepts: the project,
  component, and environment it belongs to.
- **Sample.** The
  [`tail_sampling`](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/c64840337cf400792cb684037ed998428b268197/processor/tailsamplingprocessor)
  processor decides which traces to keep after it has seen their spans, so the
  decision can take the whole trace into account instead of guessing from the
  first span.
- **Export.** Enriched traces are forwarded to a central Collector in the
  observability plane, or sent straight to a cloud backend with the
  `googlecloud`, `awsxray`, or `azuremonitor` exporters. The `otlphttp` exporter
  covers OTLP-native backends, and auth extensions supply each exporter's
  credentials.

This pipeline ships as a tracing module: an ecosystem module for OpenChoreo,
installed with Helm, that bundles the Collector configuration for one backend
with the matching Observer adapter. Tracing modules are available today for
OpenSearch, OpenObserve, AWS X-Ray, Azure Application Insights, and Google Cloud
Trace.

Traces appear in the Traces tab of the OpenChoreo portal, filterable by
component, environment, and time range, so developers can debug without leaving
the portal. The
[Observability Plane MCP server](https://openchoreo.dev/docs/reference/mcp-servers/#observability-plane-mcp-server)
exposes the same tracing data through tools, so AI agents can use distributed
traces to debug applications too.

![Figure 3: A trace in the OpenChoreo portal. The failing 10-second RecommendationService span stands out from the rest of the request.](portal-trace.png)

_Figure 3: A trace in the OpenChoreo portal. The failing 10-second
RecommendationService span stands out from the rest of the request._

### Persistent Kubernetes events

Not every incident shows up in application logs or traces. When a deployment
can't scale on Black Friday because it has hit its resource limits, the evidence
lives in Kubernetes events. Platform engineers reach for `kubectl get events`,
but by default the API server keeps events for only about an hour. By the time
someone investigates the incident, the events that explain it are often gone.

Events also resist the enrichment approach used for traces. They're emitted
about many kinds of objects, including Pods, Deployments, ReplicaSets, and Jobs,
so they can't be tied to a workload through pod association the way spans can.
OpenChoreo includes a
[purpose-built Collector distribution](https://github.com/openchoreo/community-modules/tree/35fac05461e3287ed0ddecc8911d292135a4dd35/observability-events-otel-collector)
to close that gap:

- **Collect.** The
  [`k8s_events`](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/c64840337cf400792cb684037ed998428b268197/receiver/k8seventsreceiver)
  receiver from the Collector contrib repository watches events across the
  cluster and converts each one into an OpenTelemetry log record: the event
  message becomes the log body, the event type (`Normal` or `Warning`) sets the
  severity, and the event's fields become attributes. The collector runs as a
  single replica so that each event is recorded only once.
- **Enrich.** A custom processor, `k8seventenrich`, looks up the object each
  event refers to and copies its labels, annotations, and controlling owner
  reference onto the event as resource attributes: `k8s.object.label.<key>`,
  `k8s.object.annotation.<key>`, and `k8s.object.owner.{kind,name,uid}`. Lookups
  are served from cluster-wide, in-memory informer caches, so enrichment adds no
  API server calls on the event path.
- **Export.** After the `batch` processor, events go to a durable log backend.
  The distribution bundles OpenSearch, OTLP (gRPC and HTTP), AWS CloudWatch
  Logs, and debug exporters, which covers backends such as OpenSearch and
  OpenObserve.

```mermaid
flowchart TB
    k8s["Kubernetes API server"] -->|"events"| collector

    subgraph collector["Events Collector (a single-replica OpenTelemetry Collector)"]
        direction LR
        receiver["k8s_events<br/>receiver"]
        enrich["k8seventenrich<br/>processor"]
        cache[("Informer<br/>cache")]
        batch["batch<br/>processor"]
        exporter["Exporter"]
        receiver -->|"log<br/>records"| enrich
        cache -.->|"labels,<br/>owners"| enrich
        enrich --> batch --> exporter
    end

    collector --> backend["Log backend: OpenSearch, OpenObserve, CloudWatch Logs, ..."]
```

_Figure 4: The events pipeline. The `k8seventenrich` processor enriches each
event from an in-memory informer cache before it is batched and exported._

Because the enriched labels carry OpenChoreo's own identifiers, the portal can
show each component's events in its Events tab, complete with project,
component, and environment, long after the API server has discarded them. That
makes events a lasting layer of observability instead of a short-lived one.

![Figure 5: Kubernetes events for a component in the OpenChoreo portal, with OpenChoreo metadata attached to each event.](portal-events.png)

_Figure 5: Kubernetes events for a component in the OpenChoreo portal, with
OpenChoreo metadata attached to each event._

The distribution is published as an ecosystem module and installs into the
observability plane with Helm:

```sh
helm upgrade --install observability-events-otel-collector \
  oci://ghcr.io/openchoreo/helm-charts/observability-events-otel-collector \
  --namespace openchoreo-observability-plane --create-namespace \
  --version 0.2.0
```

Out of the box it prints enriched events through the debug exporter. The
module's README shows how to point it at OpenSearch, OpenObserve, or CloudWatch
Logs.

## Why OpenTelemetry?

Four strengths made OpenTelemetry the right choice for OpenChoreo's
observability plane:

- **Vendor-neutral by default.** A per-vendor agent would have tied the platform
  to one backend. OTLP is an open standard, the Collector is vendor-neutral, and
  both are supported by a wide range of vendors.
- **A component for most jobs.** The Collector's catalogue of receivers,
  processors, and exporters covered most of what OpenChoreo needed to assemble,
  so much of each pipeline is configuration rather than code.
- **SDKs for numerous languages.** Developers instrument in the language they
  already use, and the platform doesn't need to care which one it is.
- **An extensible core.** When no existing component fit, as with event
  enrichment, a custom processor was a small, testable piece of Go, and OCB
  built it into a distribution alongside the upstream components. The OpenChoreo
  team plans to contribute it back to the OpenTelemetry community.

## Try it yourself

The
[GCP microservices demo sample](https://github.com/openchoreo/openchoreo/tree/4bd2b139ff9cf23d3b7e33a3d37ad7718b7c437e/samples/gcp-microservices-demo)
deploys Google's microservices demo on OpenChoreo. Once it's running, you can
follow a single request across services to find where it slows down or fails,
then read the events behind a deployment action to see what the cluster actually
did.

## Wrapping up

OpenChoreo shows what the Collector's receivers, processors, and exporters make
possible for platform teams. Standard components handle ingestion, enrichment,
sampling, and export; a small custom processor fills the one gap they couldn't
cover. By bringing enriched traces and persisted Kubernetes events into the
developer portal, OpenChoreo takes more of the operational burden of Kubernetes
off developers, so they can get back to writing software.

To learn more or get involved, visit [openchoreo.dev](https://openchoreo.dev/),
join the community on [Slack](https://openchoreo.dev/slack), or explore the
project on [GitHub](https://github.com/openchoreo/openchoreo).

Watch the OTel in Practice session to see OpenTelemetry with OpenChoreo in
action:

<div class="td-max-width-on-larger-screens">
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
			<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/yyJmBj8k7mk?autoplay=0&amp;controls=1&amp;end=0&amp;loop=0&amp;mute=0&amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"></iframe>
		</div>

</div>
