Same as the basic sample, but with traces exported to Jaeger.
Prerequisites
# Start Jaeger
jaeger
# or: docker run -d -p 16686:16686 -p 4318:4318 jaegertracing/jaeger:latest
Run
elixir examples/sample_traced.exs
# Then open http://localhost:16686 → service "light_cdp_sample"
How it works
- Configures the OTLP exporter to send to
localhost:4318 - Calls
LightCDP.Telemetry.OtelBridge.setup()to bridge telemetry events to OTel spans - Wraps the workflow in
OpenTelemetry.Tracer.with_spanfor a single root trace - All page operations and CDP commands appear as nested spans in Jaeger
LightCDP.Telemetry.OtelBridge.setup()
OpenTelemetry.Tracer.with_span "hn_search" do
{:ok, session} = LightCDP.start()
{:ok, page} = LightCDP.new_page(session)
LightCDP.Page.navigate(page, "https://news.ycombinator.com/")
LightCDP.Page.fill(page, "input[name=\"q\"]", "lightpanda")
# ...
LightCDP.stop(session)
endMulti-step operations like fill include span events showing internal steps (focus, clear, insert) — visible as logs within the span in Jaeger.
See sample_traced.exs for the full runnable script.