Implement feature negotiation for CI job telemetry (Rails side)
Summary
Implement the Rails side of feature negotiation for CI job telemetry. When a Runner requests a job, the Rails response should indicate whether the job_telemetry feature is available for that project.
Job payload change
Add a job_telemetry entry to the existing features object in the /api/v4/jobs/request response:
{
"features": {
"job_telemetry": true
}
}
When job_telemetry is absent or false, the Runner skips all telemetry instrumentation for that job.
This is a binary enablement signal — it does not carry sampling configuration or an OTEL Collector endpoint URL:
- Sampling is handled entirely at the OTEL Collector level using the probabilistic sampler processor, adjustable without Rails or Runner changes
- The OTEL Collector endpoint is statically configured on each runner manager (see architecture document)
Requirements
- Add
job_telemetrytoGitlabFeaturesin the job payload response - Controlled by a project-level feature flag for gradual rollout
- MVC: enable for DevExp Customer0 projects on hosted runners
- Broader rollout: enable progressively for more projects
- Only include
trace_context(see #590587) whenjob_telemetryis enabled
Architecture Reference
Related
- Trace context initialization (Rails): #590587
- Runner-side implementation: gitlab-runner#39231
- Coordinate with grouprunner core on the payload schema
Parent Epic
Edited by Pedro Pombeiro