CI OpenTelemetry Collector
Instruments CI pipelines with OpenTelemetry distributed tracing. Captures job, step, and command-level spans for detailed CI observability. Sends traces to any OTLP-compatible backend (Tempo, Jaeger, etc.).
ci-otel to your lunar-config.yml:uses: github://earthly/lunar-lib/collectors/ci-otel@v1.0.0
What This Integration Collects
This integration includes 6 collectors that gather metadata from your systems.
job-start
Starts the root span for the CI job. Generates trace ID from component and job ID, stores context in temp files for child spans.
.*
job-end
Ends the root span for the CI job. Reads start time from temp file, calculates duration, and sends the complete span to the OTLP endpoint.
.*
step-start
Starts a span for each CI step. Creates child span under the job root span, stores step context for command spans.
.*
step-end
Ends the span for each CI step. Calculates step duration and sends the complete span to the OTLP endpoint.
.*
cmd-start
Starts a span for each CI command. Creates child span under the current step, captures command details and PID for correlation.
cmd-end
Ends the span for each CI command. Captures exit code, calculates duration, and sends the complete span with command metadata.
How Collectors Fit into Lunar
Lunar watches your code and CI/CD systems to collect SDLC data from config files, test results, IaC, deployment configurations, security scans, and more.
Collectors are the automatic data-gathering layer. They extract structured metadata from your repositories and pipelines, feeding it into Lunar's centralized database where guardrails evaluate it to enforce your engineering standards.
Learn How Lunar Works →Example Collected Data
This collector writes structured metadata to the Component JSON. Here's an example of the data it produces:
{
"ci": {
"traces": {
"abc123def456...": {
"trace_id": "abc123def456...",
"root_span_id": "1234567890abcdef",
"job_id": "12345",
"job_name": "build",
"component_id": "github.com/acme/myproject",
"status": "completed"
}
}
}
}
Configuration
Configure this collector in your lunar-config.yml.
Inputs
| Input | Required | Default | Description |
|---|---|---|---|
otel_endpoint
|
Optional |
http://tempo:4318
|
The OTLP HTTP endpoint for sending traces (e.g., http://tempo:4318) |
debug
|
Optional |
false
|
Enable debug mode to collect detailed debugging information in the Component JSON |
Documentation
View on GitHubCI OpenTelemetry Collector
Emits OpenTelemetry traces for CI pipeline runs, providing detailed observability into job execution.
Overview
This collector instruments CI pipelines with OpenTelemetry distributed tracing, capturing job, step, and command-level spans with timing and metadata. Traces are sent to any OTLP-compatible backend (Tempo, Jaeger, Honeycomb, etc.). Requires jq and curl in your CI environment (pre-installed on most runners); xxd is optional.
Collected Data
This collector writes to the following Component JSON paths (when debug mode is enabled):
| Path | Type | Description |
|---|---|---|
.ci.traces.{trace_id} |
object | Trace metadata including job, steps, and commands |
.ci.traces.{trace_id}.steps.{step_index} |
object | Step-level timing and metadata |
.ci.traces.{trace_id}.steps.{step_index}.commands.{cmd_hash} |
object | Command-level timing and process info |
Note: The primary output is OpenTelemetry traces sent to the configured OTLP endpoint. Component JSON data is only collected when debug: "true" is set.
Collectors
This plugin provides the following collectors:
| Collector | Description |
|---|---|
job-start |
Starts the root span for the CI job, generates trace ID from component and job ID |
job-end |
Ends the root span, calculates duration, sends the complete job span |
step-start |
Starts a span for each CI step as a child of the job span |
step-end |
Ends the step span, calculates duration, sends the complete step span |
cmd-start |
Starts a span for each CI command under the current step |
cmd-end |
Ends the command span with exit code and duration metadata |
Installation
Add to your lunar-config.yml:
collectors:
- uses: github://earthly/lunar-lib/collectors/ci-otel@v1.0.0
on: ["domain:your-domain"]
with:
otel_endpoint: "http://tempo:4318" # Your OTLP HTTP endpoint
# debug: "true" # Enable to collect trace data in Component JSON
Open Source
This collector is open source and available on GitHub. Contribute improvements, report issues, or fork it for your own use.
Ready to Automate Your Standards?
See how Lunar can turn your engineering wiki, compliance docs, or postmortem action items into automated guardrails with our 100+ built-in guardrails.