OpsCanary
kubernetesobservabilityPractitioner

Seamless Distributed Tracing for CI Pipelines in Kubernetes

5 min read CNCF BlogSep 8, 2026Reviewed for accuracy
Share
PractitionerHands-on experience recommended

In today's fast-paced development environment, understanding the performance of your CI pipelines is crucial. Distributed tracing provides visibility into the execution of workflows, helping you pinpoint bottlenecks and optimize processes. With the right setup, you can achieve this without ever touching your workflow files, making it easier to maintain and scale your CI/CD practices.

The magic happens with an OpenTelemetry Collector configured to receive GitHub webhook events. When a workflow runs, it triggers both workflow_run and workflow_job events. The collector, equipped with the githubreceiver component, converts these events directly into OTLP spans. Each workflow becomes an outer span, while jobs and steps within those jobs are represented as child spans. This hierarchical structure allows you to trace the execution flow effectively. Key configuration parameters include the webhook endpoint, path, and secret, as well as the OTLP exporter endpoint and authorization headers. For instance, your collector configuration might look like this:

YAML
1receivers:
2  github:
3    webhook:
4      endpoint: 0.0.0.0:19418
5      path: /events
6      secret: ${env:GITHUB_WEBHOOK_SECRET}
7    scrapers:
8      scraper:
9        github_org: ${env:GITHUB_ORG}
10
11exporters:
12  otlp:
13    endpoint: ${env:TRACE_BACKEND_ENDPOINT}
14    headers:
15      authorization: ${env:TRACE_BACKEND_API_KEY}
16
17service:
18  pipelines:
19    traces:
20      receivers: [github]
21      exporters: [otlp]

In production, be aware of some critical considerations. The collector must be publicly accessible for GitHub to send webhooks, so plan for IP allowlisting or a WAF to secure it. Additionally, setting up an org-level webhook requires admin access, which can be a roadblock if not confirmed early in the process. Lastly, the scrapers block, while seemingly unrelated to tracing, is mandatory for configuration validation, potentially wasting your time if overlooked.

Key takeaways

  • Configure an OpenTelemetry Collector with the GitHub webhook to enable distributed tracing.
  • Understand that `workflow_run` and `workflow_job` events are converted into OTLP spans.
  • Ensure the collector has a publicly reachable endpoint for GitHub webhooks.
  • Plan for IP allowlisting or WAF to secure your collector endpoint.
  • Confirm org admin access early to avoid delays in setting up the webhook.

Why it matters

Implementing distributed tracing in CI pipelines enhances visibility into workflow performance, allowing teams to identify and resolve issues faster, ultimately improving deployment speed and reliability.

Code examples

YAML
1receivers:
2  github:
3    webhook:
4      endpoint: 0.0.0.0:19418
5      path: /events
6      secret: ${env:GITHUB_WEBHOOK_SECRET}
7    scrapers:
8      scraper:
9        github_org: ${env:GITHUB_ORG}
10
11exporters:
12  otlp:
13    endpoint: ${env:TRACE_BACKEND_ENDPOINT}
14    headers:
15      authorization: ${env:TRACE_BACKEND_API_KEY}
16
17service:
18  pipelines:
19    traces:
20      receivers: [github]
21      exporters: [otlp]

When NOT to use this

The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →
Linux FoundationSponsor

Industry-standard certifications built by the people behind Linux and Kubernetes. Earn the CKA — the gold standard Kubernetes administrator cert. OpsCanary readers get 30% off year-round with code OPSCANARY3.

Get CKA certified →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.