Feature negotiation for CI job telemetry

Summary

Implement feature negotiation in Runner so it only initializes telemetry when GitLab indicates support. This is Phase 1 of Runner instrumentation — paired with the OTLP export client (#39231) to achieve end-to-end integration.

Requirements

  1. Check for job_telemetry: true in the features object of the job payload response
  2. Only initialize telemetry (OTEL SDK, exporter, trace context) when the feature is present
  3. Gracefully handle missing feature flag (assume disabled) — ensures backward compatibility with older GitLab versions
  4. Read trace_context from the job payload when telemetry is enabled:
    • trace_id (32-char hex) — deterministically generated by Rails from the job ID
    • parent_span_id (16-char hex) — the root span ID for this job's trace

Job Payload Example

{
  "features": {
    "job_telemetry": true
  },
  "trace_context": {
    "trace_id": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
    "parent_span_id": "1a2b3c4d5e6f7a8b"
  }
}

Architecture Reference

  • Job payload changes
  • Feature negotiation

Related

  • Rails-side feature negotiation: gitlab#590588
  • Rails-side trace context initialization: gitlab#590587
  • OTLP export client (Phase 1 companion): #39231
  • Parent epic: &20633
Edited Feb 19, 2026 by Pedro Pombeiro
Assignee Loading
Time tracking Loading