Skip to content

Add optional traceId/spanId fields to BuildReport for OTel correlation #13567

Open

Description

@gnodet

Context

The OpenTelemetry Maven extension
(v1.60.0-alpha) captures per-mojo spans as an EventSpy. Maven's BuildReport
captures overlapping data (per-mojo timing, module execution, downloads). The two
aren't competing — OTel is for distributed tracing backends (Jaeger, Grafana Tempo),
while build-report.json is for local consumption.

Proposal

Add optional fields to MojoReport and ModuleReport:

@Nullable String traceId();
@Nullable String spanId();

These are populated only when the OTel extension (or any other tracing extension)
sets them via a well-defined mechanism (e.g., MDC keys otel.trace_id and
otel.span_id, or a dedicated API).

This lets tools correlate the local JSON report entry with a specific span in a
distributed trace — useful for CI observability dashboards.

Priority

Nice-to-have. Low effort, high interoperability value.

Related

🤖 Drafted with Claude Code (Claude Opus 4.6). Reviewed and confirmed by @gnodet before submission.

Activity

  1. added
    enhancement
    on Oct 16, 2026
  2. added this to the 4.1.0 milestone on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementmvn4

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions