Add flightrecorder feature to the operator#2785
Conversation
Flight Recorder is a Rust sidecar that records agent pipeline signals (metrics, logs) to Vortex columnar files. This adds operator support so users can enable it via `spec.features.flightRecorder.enabled` in the DatadogAgent CRD. The operator creates a flightrecorder container in the agent pod with: - Shared emptyDir volume at /var/run/flightrecorder for Unix socket IPC - Data volume at /data/signals for Vortex output files - DD_FLIGHTRECORDER_ENABLED and DD_FLIGHTRECORDER_SOCKET_PATH env vars on the core agent container Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2785 +/- ##
==========================================
+ Coverage 38.94% 39.05% +0.11%
==========================================
Files 313 314 +1
Lines 27134 27240 +106
==========================================
+ Hits 10567 10639 +72
- Misses 15778 15810 +32
- Partials 789 791 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Request 50Mi, limit 200Mi — based on DESIGN.md benchmarks showing 33-61MB RSS for the recorder sidecar. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nv var instead of CRD field Remove spec.features.flightRecorder from the DatadogAgent CRD schema. Instead, Configure() detects DD_EXPERIMENTAL_FLIGHTRECORDER_ENABLED=true in either spec.override.nodeAgent.env (component-level) or spec.override.nodeAgent.containers.agent.env (container-level). This avoids the CRD pruning issue where unknown fields are silently stripped before the operator can read them. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… changes Restore controller-gen version to v0.17.3 (CI version) in CRD files that were inadvertently regenerated with the local v0.16.3 toolchain. Revert unrelated changes to dashboards/metrics/monitors/SLOs/RBAC that were side effects of running make generate locally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Set DD_FLIGHTRECORDER_ENABLED and DD_FLIGHTRECORDER_SOCKET_PATH on both the core agent and trace-agent containers - Mount the flightrecorder socket volume on the trace-agent container Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bfb840294f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… feature Switch from reading DD_EXPERIMENTAL_FLIGHTRECORDER_ENABLED in spec.override.nodeAgent.env to the annotation-based pattern used by other experimental features (e.g. privateactionrunner). The feature is now enabled via: agent.datadoghq.com/flightrecorder-enabled: "true" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Align with the convention used by DogStatsD and APM sockets which live under /var/run/datadog/. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…der.sock Only one socket is used, so a subdirectory is unnecessary. Mount the volume at /var/run/datadog and place the socket file directly as flightrecorder.sock, consistent with dsd.socket and apm.socket. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…r socket Two volumes cannot mount at the same path — using /var/run/datadog directly would conflict with the DogStatsD socket volume. Use a dedicated subdirectory instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Set DD_FLIGHTRECORDER_SOCKET_PATH and DD_FLIGHTRECORDER_OUTPUT_DIR on the flightrecorder container so it knows where to listen and write - Remove DD_FLIGHTRECORDER_ENABLED from the flightrecorder container (it is agent-side only) - Clean up example YAML: remove custom image overrides and clusterName - Replace "Vortex" with "Parquet" in comments Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
adel121
left a comment
There was a problem hiding this comment.
LGTM 👍
@tbavelier to have a quick final look 🙇
internal/controller/datadogagent/feature/flightrecorder/const.go
Outdated
Show resolved
Hide resolved
Move env var constants (DD_FLIGHTRECORDER_*) from common/envvar.go to flightrecorder/const.go since they are only used within the feature. Move shared volume names and paths to common/const.go so they can be referenced by both the feature and the component default container. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add volumeMountsForFlightRecorder() helper following the pattern used by other containers. Remove memory requests/limits as they are never set by default and can be configured via overrides. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add FlightRecorderContainerName to the merger AllAgentContainers map so that node-agent-wide env/envFrom overrides are applied to the flightrecorder sidecar container. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Context
The flight recorder is a lightweight sidecar that passively mirrors pipeline signals (metrics, logs, trace stats) from the Datadog Agent over a Unix socket. A Rust sidecar process writes the data as columnar Parquet files for offline analysis and debugging.
Key design properties:
Summary
Adds flightrecorder sidecar support to the Datadog Operator. When the annotation
agent.datadoghq.com/flightrecorder-enabled: "true"is set on the DatadogAgent resource, the operator:flightrecordersidecar container into the agent DaemonSet/var/run/flightrecorder) for agent-to-flightrecorder IPC/data/signals) for Parquet output filesDD_FLIGHTRECORDER_ENABLEDandDD_FLIGHTRECORDER_SOCKET_PATHenv vars on the core agent and trace-agent containersDD_FLIGHTRECORDER_SOCKET_PATHandDD_FLIGHTRECORDER_OUTPUT_DIRenv vars on the flightrecorder container.Usage
Changes
internal/controller/datadogagent/feature/flightrecorder/— Feature implementation (volumes, env vars, container injection)internal/controller/datadogagent/feature/utils/utils.go— Annotation constantinternal/controller/datadogagent/component/agent/default.go— Default flightrecorder container definition with resource limitsTest plan
go build ./...passes🤖 Generated with Claude Code