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

  1. Add job_telemetry to GitlabFeatures in the job payload response
  2. 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
  3. Only include trace_context (see #590587) when job_telemetry is enabled

Architecture Reference

  • Job payload changes
  • GitLab Runner changes

Related

  • Trace context initialization (Rails): #590587
  • Runner-side implementation: gitlab-runner#39231
  • Coordinate with grouprunner core on the payload schema

Parent Epic

&20945

Edited Feb 19, 2026 by Pedro Pombeiro
Assignee Loading
Time tracking Loading