Add application setting for CI telemetry sampling rate
## Summary Add a global Rails application setting for the CI job telemetry sampling rate. This controls what fraction of pipelines within feature-flag-enabled projects have telemetry instrumentation. ## Background The [architecture design document](https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/ci_job_telemetry/#sampling-strategy) specifies that sampling is handled at the Rails level using a **deterministic hash of the root pipeline ID** combined with a global sampling rate. When the hash falls within the configured percentage, Rails includes `features.tracing` in the job payload; otherwise it omits it entirely. This ensures: - **Per-pipeline consistency**: All jobs in the same pipeline hierarchy get the same sampling decision (no partial traces) - **Minimal Collector load**: Only sampled pipelines generate telemetry traffic - **Centralized control**: Sampling rate is adjustable without Runner or Collector changes The Runner uses `AlwaysOn` SDK sampling — if `features.tracing` is present, it instruments everything. The sampling decision belongs entirely to Rails. ## Requirements 1. Add a global application setting for the CI telemetry sampling rate - Setting name suggestion: `ci_job_telemetry_sampling_rate` (float, 0.0–1.0, default 0.0) - When 0.0, no pipelines are sampled (telemetry effectively disabled even if the feature flag is on) - When 1.0, all pipelines in enabled projects are sampled 1. Apply the sampling rate **deterministically per root pipeline ID**, so all jobs in the same pipeline hierarchy get the same result: ```ruby sampled = (Digest::MD5.hexdigest(root_pipeline_id.to_s).to_i(16) % 10000) < (sampling_rate * 10000) ``` 1. `features.tracing` is included in the job payload only when **all three** conditions are met: - The `ci_job_telemetry` feature flag is enabled for the project (gitlab-org/gitlab#590939) - The CI telemetry OTEL Collector endpoint application setting is configured (gitlab-org/gitlab#591941) - The pipeline is sampled according to this application setting ## Architecture Reference - [Sampling strategy — Stage 1: Rails-side deterministic head sampling](https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/ci_job_telemetry/#sampling-strategy) - [Design decision: Sampling location](https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/ci_job_telemetry/#design-decisions) - [Job payload semantics](https://handbook.gitlab.com/handbook/engineering/architecture/design-documents/ci_job_telemetry/#job-payload-changes) ## Dependencies - Feature negotiation (gitlab-org/gitlab#590939) — the feature flag must be enabled for the project - OTEL Collector endpoint setting (gitlab-org/gitlab#591941) — the endpoint must be configured - Trace context initialization (gitlab-org/gitlab#590587) — sampling check should be integrated into the same code path that builds `features.tracing` ## Parent Epic gitlab-org&20945
issue