Skip to content

Conversation

@mackjmr
Copy link
Member

@mackjmr mackjmr commented Dec 12, 2025

What does this PR do?

Add support for full host profiler.

Motivation

OTAGENT-711

Additional Notes

Anything else we should know when reviewing?

Minimum Agent Versions

Are there minimum versions of the Datadog Agent and/or Cluster Agent required?

  • Agent: Feature has not been released yet. For now, only image available in dockerhub datadog/ddot-ebpf-dev repo.
  • Cluster Agent: vX.Y.Z

Describe your test plan

Prereqs:

  • Staging API Key
  • Staging APP key with continuous_profiler_read permission
  • Cluster in Real Linux environment (The host profiler relies on eBPF, which requires direct access to a real Linux kernel)

Test 1. Configmap

apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
  name: datadog
spec:
  override:
    nodeAgent:
      env:
        - name: DD_HOSTNAME
          value: "test1"
        - name: DD_API_KEY
          value: xxx
        - name: DD_APP_KEY
          value: xxx
        - name: DD_SITE
          value: datad0g.com

  global:
    registry: docker.io/datadog
    site: datad0g.com
    kubelet:
      tlsVerify: false
    credentials:
      apiKey: xxx
  features:
    hostProfiler:
      enabled: true
      conf: 
        configMap: 
          name: custom-config-map
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: custom-config-map
  namespace: system
data:
  host-profiler-config.yaml: |-
    extensions:
      ddprofiling/default:
      hpflare/default:
    receivers:
      otlp:
        protocols:
          grpc:
          http:
      hostprofiler:
        symbol_uploader:
          enabled: true
          symbol_endpoints:
            - site: ${env:DD_SITE}
              api_key: ${env:DD_API_KEY}
              app_key: ${env:DD_APP_KEY}
    processors:
      infraattributes/default:
        cardinality: 2 # HighCardinality
        allow_hostname_override: true
      cumulativetodelta: {}

    exporters:
      debug: {}
      otlphttp:
        metrics_endpoint: https://otlp.datad0g.com/v1/metrics
        profiles_endpoint: https://intake.profile.datad0g.com/v1development/profiles
        headers:
          dd-api-key: ${env:DD_API_KEY}
          dd-otel-metric-config: '{"resource_attributes_as_tags": true}'
    service:
      extensions: [hpflare/default]
      pipelines:
        profiles:
          receivers: [hostprofiler]
          processors: [infraattributes/default]
          exporters: [otlphttp, debug]   
        metrics:
          receivers: [otlp]
          processors: [cumulativetodelta, infraattributes/default]
          exporters: [otlphttp]

Ensure:

  • host-profiler container is running in agent pod with no error
  • you see profiles under host:test1 in staging.

Test 2. Inline config

apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
  name: datadog
spec:
  override:
    nodeAgent:
      env:
        - name: DD_HOSTNAME
          value: "test2"
        - name: DD_API_KEY
          value: xxx
        - name: DD_APP_KEY
          value: xxx
        - name: DD_SITE
          value: datad0g.com
  global:
    registry: docker.io/datadog
    site: datad0g.com
    kubelet:
      tlsVerify: false
    credentials:
      apiKey: xxx
  features:
    hostProfiler:
      enabled: true
      conf: 
        configData: |-
          extensions:
            ddprofiling/default:
            hpflare/default:
          receivers:
            otlp:
              protocols:
                grpc:
                http:
            hostprofiler:
              symbol_uploader:
                enabled: true
                symbol_endpoints:
                  - site: ${env:DD_SITE}
                    api_key: ${env:DD_API_KEY}
                    app_key: ${env:DD_APP_KEY}
          processors:
            infraattributes/default:
              cardinality: 2 # HighCardinality
              allow_hostname_override: true
            cumulativetodelta: {}

          exporters:
            debug: {}
            otlphttp:
              metrics_endpoint: https://otlp.datad0g.com/v1/metrics
              profiles_endpoint: https://intake.profile.datad0g.com/v1development/profiles
              headers:
                dd-api-key: ${env:DD_API_KEY}
                dd-otel-metric-config: '{"resource_attributes_as_tags": true}'
          service:
            extensions: [hpflare/default]
            pipelines:
              profiles:
                receivers: [hostprofiler]
                processors: [infraattributes/default]
                exporters: [otlphttp, debug]   
              metrics:
                receivers: [otlp]
                processors: [cumulativetodelta, infraattributes/default]
                exporters: [otlphttp]

Test 3. HostPID manually disabled

apiVersion: datadoghq.com/v2alpha1
kind: DatadogAgent
metadata:
  name: datadog
spec:
  override:
    nodeAgent:
      env:
        - name: DD_HOSTNAME
          value: "test3"
        - name: DD_API_KEY
          value: xxx
        - name: DD_APP_KEY
          value: xxx
        - name: DD_SITE
          value: datad0g.com
      hostPID: false

  global:
    registry: docker.io/datadog
    site: datad0g.com
    kubelet:
      tlsVerify: false
    credentials:
      apiKey: xxx
  features:
    hostProfiler:
      enabled: true

Ensure:

  • host-profiler container is not running in agent pod
  • operator logs error: Host PID is required to run the host profiler. Please enable host PID or disable the host profiler

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label

@mackjmr mackjmr added the enhancement New feature or request label Dec 15, 2025
@mackjmr mackjmr added this to the v1.23.0 milestone Dec 16, 2025
@mackjmr mackjmr changed the title Mackjmr/host profiler feature Add Host Profiler Feature Dec 18, 2025
@mackjmr mackjmr marked this pull request as ready for review December 18, 2025 13:56
@mackjmr mackjmr requested review from a team as code owners December 18, 2025 13:56
Copy link
Contributor

@maycmlee maycmlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a tiny nit, but approving

| features.helmCheck.valuesAsTags | ValuesAsTags collects Helm values from a release and uses them as tags (Requires Agent and Cluster Agent 7.40.0+). Default: {} |
| features.hostProfiler.conf.configData | ConfigData corresponds to the configuration file content. |
| features.hostProfiler.conf.configMap.items | Maps a ConfigMap data `key` to a file `path` mount. |
| features.hostProfiler.conf.configMap.name | Is the name of the ConfigMap. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| features.hostProfiler.conf.configMap.name | Is the name of the ConfigMap. |
| features.hostProfiler.conf.configMap.name | Name of the ConfigMap. |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants