1
0
Fork
You've already forked html-report-for-dagger
0
HTML Report for Dagger
  • Go 100%
Thomas SharedInbox 6fac57ae5a Add receiver and report tests with real trace spans
receiver_test.go: sends actual OTLP HTTP posts to the receiver and
verifies spans are captured end-to-end (name, timestamps, cached flag).
report_test.go: generates HTML from real span+sample data and checks
that span names appear, cached color is present, HTML structure is
valid, and the command string is properly escaped.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026年05月21日 19:01:11 +02:00
cmd/dagger-report Add dagger-report: HTML report generator for Dagger pipelines 2026年05月21日 18:26:17 +02:00
internal Add receiver and report tests with real trace spans 2026年05月21日 19:01:11 +02:00
.gitignore gitignore 2026年05月21日 18:57:38 +02:00
go.mod Add dagger-report: HTML report generator for Dagger pipelines 2026年05月21日 18:26:17 +02:00
LICENSE Initial commit 2026年05月21日 17:28:41 +02:00
README.md Add dagger-report: HTML report generator for Dagger pipelines 2026年05月21日 18:26:17 +02:00

html-report-for-dagger

A CLI tool that wraps any command, captures its OpenTelemetry (OTLP) traces and system resource usage, then produces a self-contained HTML report with:

  • Gantt chart — span timeline showing parallelism and cached steps
  • CPU / Memory / Network charts — sampled every second during the run
  • Sortable span table — all spans ranked by duration

Works best with Dagger pipelines, but wraps any command that emits OTLP traces.

Install

go install github.com/guettli/html-report-for-dagger/cmd/dagger-report@latest

Or build from source:

git clone https://codeberg.org/guettli/html-report-for-dagger
cd html-report-for-dagger
go build -o dagger-report ./cmd/dagger-report

Usage

dagger-report [flags] -- <command> [args...]
Flag Default Description
-o <file> dagger-report-TIMESTAMP.html Output HTML path
-interval <duration> 1s Resource sampling interval

With Dagger

dagger-report -- dagger run go test ./...
dagger-report -o ci-report.html -- dagger run ./ci/build

With any OTLP-instrumented command

dagger-report -- my-tool --some-flag

The tool sets these environment variables for the wrapped command:

OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:<random-port>
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf

If the wrapped command doesn't emit OTLP traces, the report still shows the resource charts. If the command exits non-zero, dagger-report propagates that exit code after writing the report.

How it works

  1. Starts an embedded OTLP HTTP receiver on a random local port
  2. Starts a resource sampler reading /proc/stat, /proc/meminfo, /proc/net/dev
  3. Runs the wrapped command with the OTEL env vars injected
  4. After the command exits, waits 500ms for any last trace flushes
  5. Generates a single self-contained HTML file (no external dependencies)

Development

go test ./...
go build ./cmd/dagger-report

No external Go dependencies — only the standard library.

Requirements

  • Go 1.22+
  • Linux (resource sampling reads /proc; other platforms produce the report with zero resource samples)