Add application setting for CI telemetry OTEL endpoint URL
What does this MR do and why?
Adds a new ci_telemetry_otel_endpoint application setting that replaces the hardcoded OTEL Collector URL (https://otel-collector.gitlab.net/v1/traces) used for CI job telemetry. This makes the OTEL endpoint configurable by instance administrators.
When the setting is configured and the ci_job_telemetry beta feature flag is enabled, the endpoint URL is included in the features.tracing.otel_endpoints payload in /api/v4/jobs/request responses, allowing runners to push telemetry spans. When the setting is blank/nil or the feature flag is disabled, tracing is omitted from the payload.
Closes #591941
Changes
- Migration: Adds nullable
ci_telemetry_otel_endpointtext column toapplication_settings(1024 char limit) - Model: URL validation (
http/httpsschemes), blank-to-nil normalization viabefore_validation - Build model: Replaces hardcoded
OTEL_COLLECTOR_URLconstant withGitlab::CurrentSettings.ci_telemetry_otel_endpoint - API: Exposes settings in the application settings entity and accepts it as an optional API parameter
- Feature flag gating: Entity exposure, controller permitted params, and build features are all gated behind the
ci_job_telemetrybeta feature flag
No UI/Frontend Changes are in the scope of this MR
How to set up and validate locally
-
Enable the feature flag:
Feature.enable(:ci_job_telemetry) -
Set the OTEL endpoint via Rails console:
ApplicationSetting.current.update!(ci_telemetry_otel_endpoint: 'https://otel-collector.example.com/v1/traces') -
Register a runner and request a job — verify
features.tracingincludes the configured endpoint URL. -
Clear the setting or disable the feature flag — verify
features.tracingis absent from the response.
MR acceptance checklist
- Tests added for all new/changed functionality
- Rubocop passes with no offenses
- OpenAPI docs regenerated