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
- Check for
job_telemetry: truein thefeaturesobject of the job payload response - Only initialize telemetry (OTEL SDK, exporter, trace context) when the feature is present
- Gracefully handle missing feature flag (assume disabled) — ensures backward compatibility with older GitLab versions
- Read
trace_contextfrom 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
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 by Pedro Pombeiro