Hamburger Cross Icon
CI OpenTelemetry Collector - Lunar Collector

CI OpenTelemetry Collector

Collector Stable Ci Cd

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.).

Add 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.

Collector ci-before-job

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.

Pattern: .*
opentelemetry tracing ci job observability
Book a demo
Collector ci-after-job

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.

Pattern: .*
opentelemetry tracing ci job span completion
Book a demo
Collector ci-before-step

step-start

Starts a span for each CI step. Creates child span under the job root span, stores step context for command spans.

Pattern: .*
opentelemetry tracing ci step observability
Book a demo
Collector ci-after-step

step-end

Ends the span for each CI step. Calculates step duration and sends the complete span to the OTLP endpoint.

Pattern: .*
opentelemetry tracing ci step span completion
Book a demo
Collector ci-before-command

cmd-start

Starts a span for each CI command. Creates child span under the current step, captures command details and PID for correlation.

opentelemetry tracing ci command process tracing
Book a demo
Collector ci-after-command

cmd-end

Ends the span for each CI command. Captures exit code, calculates duration, and sends the complete span with command metadata.

opentelemetry tracing ci command span completion
Book a demo

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
1
Collectors Gather Data This Integration
Triggered by code changes or CI pipelines, collectors extract metadata from config files, tool outputs, test results, and scans
2
{ } Centralized as JSON
All data merged into each component's unified metadata document
3
Guardrails Enforce Standards
Real-time feedback in PRs and AI workflows

Example Collected Data

This collector writes structured metadata to the Component JSON. Here's an example of the data it produces:

{ } component.json Component JSON
{
  "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 GitHub

CI 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.

View Repository

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.

Works with any process
check Infrastructure conventions
check Post-mortem action items
check Security & compliance policies
check Testing & quality requirements
Automate Now
Turn any process doc into guardrails
Book a Demo