Skip to content

OpenTelemetry tracing#189

Open
carole-lavillonniere wants to merge 1 commit intomainfrom
otel-tracing
Open

OpenTelemetry tracing#189
carole-lavillonniere wants to merge 1 commit intomainfrom
otel-tracing

Conversation

@carole-lavillonniere
Copy link
Copy Markdown
Collaborator

@carole-lavillonniere carole-lavillonniere commented Apr 13, 2026

Motivation

Add end-to-end distributed tracing to lstk so developers can inspect the full call tree of any command — Docker API calls, platform API calls, emulator health checks — in a local Jaeger (or any OTLP-compatible) backend.

Can be enabled with env var LSTK_OTEL=1.

Closes DRG-410

Changes

  • internal/tracing: new package that initialises the global OTel TracerProvider; exports spans via OTLP/HTTP
  • cmd/root.go: wraps every command lstk.<command> span
  • What's instrumented:
    • lstk commands
    • Docker API calls
    • Platform API calls
    • AWS emulator API calls
  • Included resource attributes: lstk.exit_code on all commands, service.name, service.version, os.type, host.arch on all spans
  • docker-compose.tracing.yaml: allow running Jaeger locally

Tests

Manually verified with docker compose -f docker-compose.tracing.yaml up -d and lstk start / lstk status. Traces appear in Jaeger at http://localhost:16686 with correct span hierarchy and names. Existing unit and integration tests pass unchanged.

image

@carole-lavillonniere carole-lavillonniere changed the title Add OpenTelemetry distributed tracing Add OpenTelemetry tracing Apr 13, 2026
@carole-lavillonniere carole-lavillonniere changed the title Add OpenTelemetry tracing OpenTelemetry tracing Apr 13, 2026
@carole-lavillonniere carole-lavillonniere force-pushed the otel-tracing branch 3 times, most recently from 5a18031 to f743cf2 Compare April 20, 2026 13:54
@carole-lavillonniere carole-lavillonniere force-pushed the otel-tracing branch 2 times, most recently from 6d18566 to c61fafe Compare April 21, 2026 14:01
@carole-lavillonniere carole-lavillonniere marked this pull request as ready for review April 21, 2026 14:02
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

Copy link
Copy Markdown
Contributor

@anisaoshafi anisaoshafi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really useful, will definitely use this more 🤩 Thank you!

Image

Comment thread README.md
|---|---|
| `LOCALSTACK_AUTH_TOKEN` | Auth token used for non-interactive runs or to skip browser login |
| `LOCALSTACK_DISABLE_EVENTS=1` | Disables telemetry event reporting |
| `LSTK_OTEL=1` | Enables OpenTelemetry trace export (disabled by default). When enabled, standard `OTEL_EXPORTER_OTLP_*` env vars are respected by the SDK (e.g. `OTEL_EXPORTER_OTLP_ENDPOINT` defaults to `http://localhost:4318`). |
Copy link
Copy Markdown
Contributor

@anisaoshafi anisaoshafi Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding a small clarification that the docker compose for jaeger should be up in order to visualize the traces (perhaps a make command)? I initially thought only passing LSTK_OTEL=1 was enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants