← Back to Pull requests

Add local mode to DatadogObservabilityPipelinesWorker (dev/test only) #3651

Closed
unknown closed this pull request without merging on Nov 16, 2026 12:07 UTC
View on GitHub
unknown unknown commented on Oct 22, 2026 15:44 UTC
Author

Motivation

DatadogBYOCCluster lets the Datadog Operator bring up a complete BYOC cluster in the user's own environment, including the Observability Pipelines Worker that feeds it. For traces, the operator's job is to get that stack ready to receive pipelines: it deploys and wires the Worker, but it does not create pipelines. Pipelines are authored in Datadog and delivered to the Worker through Remote Config. Until a traces pipeline can be delivered that way, there is no way to run the traces path end to end.

This PR fills that gap with a local mode on DatadogObservabilityPipelinesWorker, for development and testing only: it runs a known pipeline from the Worker spec, leaves Remote Config as the default and the supported path, and may be removed once Remote Config delivery covers this case.

It is one of three related PRs:

  • #3761 builds on this PR: it lets a DatadogBYOCCluster carry the same pipelineConfig and passes it to the Worker the operator creates.

  • #3749 is independent and complementary: it gives a traces cluster's Worker the traces endpoint it sends to, which every pipeline needs, whether it comes from Remote Config or from local mode.
  • What does this PR do?

    Setting spec.pipelineConfig on a DatadogObservabilityPipelinesWorker to a pipeline in YAML makes the controller render it into a ConfigMap, mount it into the Worker pod and start the Worker with that file, rather than with the pipeline from Remote Config. Everything else about the Worker is unchanged.

    flowchart LR
        CL["DatadogBYOCCluster<br/>signal: traces"] -->|"operator creates<br/>(#3761 passes pipelineConfig)"| W["Worker"]
        RC["Remote Config<br/>(default)"] -->|"pipelineID"| W
        LM["spec.pipelineConfig<br/>local mode, dev/test only"] -.->|"ConfigMap, mounted file<br/>(this PR)"| W
        W -->|"traces endpoint<br/>(#3749)"| IX["BYOC indexer"]
        style LM fill:#d4f4dd,stroke:#2e7d32
    

    Key details:

  • Dev/test-only signal: the controller emits a Warning event with reason LocalModeDevOnly on every local-mode reconcile (the CRDs carry no field descriptions, so the event is the signal a cluster user gets).

  • Rollout: the pipeline is mounted at /etc/observability-pipelines-worker/pipeline and a checksum/pipeline pod annotation rolls the pods when it changes (the Worker does not reload the file). The Worker runs with --pipeline-config=... --skip-key-validation, and DD_OP_PIPELINE_ID is pipelineID if given, otherwise the Worker UID.

  • Switching back: going back to Remote Config deletes the ConfigMap (only if the Worker controls it) and removes the args, volume, mount and annotation. Remote Config Workers render exactly as before, so they don't restart on operator upgrade.

  • API and validation: pipelineID becomes optional in the CRD schema (it lives on a struct shared with DatadogBYOCCluster components.pipelines[]). Validation is in Go: a Worker needs pipelineID or pipelineConfig, pipelineConfig must be a single non-empty YAML mapping, every BYOC pipeline still needs pipelineID, and in local mode the pipeline-config volume name and mounts overlapping the pipeline directory are reserved.

  • RBAC: the event needs create and patch on events, added to the generated BYOC role in config/rbac/byoc/role.yaml.
  • Additional Notes

  • Worker flags: local mode depends on the Worker's --pipeline-config and --skip-key-validation options. Without --skip-key-validation, startup validates the pipeline ID against Remote Config and fails. The flag also skips the API key check at startup.

  • Downgrade: remove local-mode Workers before downgrading the operator. Older operators dereference pipelineID and would panic on a Worker without one.

  • Helm role: the chart's main ClusterRole already grants create and patch on events to the operator service account, so the warning works with the chart as is. The chart's BYOC ClusterRole is generated from config/rbac/byoc/role.yaml and needs a regeneration to include the new rule, for consistency only; tracked as a follow-up.

  • A pipeline that is a valid YAML mapping but not a valid Worker pipeline passes validation; the pods CrashLoop with Available=False until the spec is fixed.
  • Minimum Agent Versions

    N/A (no Agent change).

    Describe your test plan

  • Unit: builder tests diff the local-mode StatefulSet against the unchanged Remote Config fixture (only args, pipeline ID, checksum, volume and mount differ); ConfigMap and cleanup stubs; validation (pipeline source, YAML shape, multi-document, reserved names); BYOC pipelineID check.

  • Envtest: local Worker without pipelineID reaches Available with its UID as the pipeline ID; Remote Config → local → edit (checksum changes) → Remote Config (ConfigMap, args, volume, mount and annotation all gone); an unowned <worker>-pipeline ConfigMap reports Conflict and survives local mode being turned off; a local-mode Worker gets a LocalModeDevOnly Warning event and a Remote Config Worker gets none.

  • make generate manifests clean, make lint, go test ./... scope, make integration-tests pass.

  • On a cluster, a local-mode Worker without pipelineID reached Available, and patching pipelineConfig rolled the StatefulSet to a new revision. A sample OTLP traces pipeline passes the Worker's validate command.
  • Checklist

  • PR has at least one valid label: enhancement

  • PR has a milestone or the qa/skip-qa label

  • All commits are signed
  • 🤖 Generated with Claude Code

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: fpddog Review duration: 35782m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3651"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%