Skip to content

feat(tracing): add OpenTelemetry tracing to entrypoint step execution #9796

@waveywaves

Description

@waveywaves

Feature request

Add OTel tracing to the entrypoint binary so each step's execution lifecycle is visible in traces. Currently the entrypoint has zero OTel support — no TracerProvider, no spans, no trace context propagation.

Use case

The gap between controller-side traces and actual step execution is the biggest blind spot in Tekton observability. Operators can see that a TaskRun was created but not how long each step waited, ran, or wrote results.

Implementation hints

pkg/entrypoint/entrypointer.go:

  • Go() (line 198) — top-level orchestrator, root entrypoint span
  • readResultsFromDisk() (line 437) — result extraction + SPIRE signing
  • applyStepResultSubstitutions() — runtime variable substitution

cmd/entrypoint/:

  • waiter.go:52Wait() polls for predecessor step completion
  • runner.go:73Run() executes user command via exec.CommandContext
  • post_writer.go:33Write() writes completion signal files

Prerequisites (large effort):

  1. Inject TRACEPARENT/TRACESTATE env vars into step containers during pod construction (pkg/pod/pod.go)
  2. Initialize OTel TracerProvider in entrypoint main() with OTLP exporter
  3. Create child spans linking to the TaskRun reconciler's parent span

Tracked in umbrella #9701 as "Large effort."

Part of umbrella: #9701

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions