The Service Map for APM is here!

Custom Integrations

ConfigMap

It is possible to leverage a ConfigMap to configure or enable integrations. To do so, you only need to create a ConfigMap with the integration(s)’s configuration. Then, reference this ConfigMap among the volumes of your Agent’s manifest.

For example, in the following case we customize the name, url, and tags fields of the HTTP check. To enable other integrations, just specify the correct YAML name and make sure it is properly formated.

kind: ConfigMap
apiVersion: v1
metadata:
  name: dd-agent-config
  namespace: default
data:
  http-config: |-
    init_config:
    instances:
    - name: My service
      url: my.service:port/healthz
      tags:
        - service:critical
---

And in the manifest of your Agent (DaemonSet/deployment) add the following:

[...]
        volumeMounts:
        [...]
          - name: dd-agent-config
            mountPath: /conf.d
      volumes:
      [...]
        - name: dd-agent-config
          configMap:
            name: dd-agent-config
            items:
            - key: http-config
              path: http_check.yaml
[...]

To enable Log collection add the following lines in your http-config:

(...)
data:
  http-config: |-
  (...)
    logs:
      - type: docker
        service: docker
        source: kubernetes

Learn more about this in the Docker log collection documentation.

Mounting a custom configuration file in a container with a ConfigMap

To mount a custom datadog.yaml in a container with a ConfigMap, employ the following in your DaemonSet manifest:

[]
volumeMounts:
 []
 - name: confd-config
 mountPath: /conf.d
 - name: datadog-yaml
 mountPath: /etc/datadog-agent/datadog.yaml
 subPath: datadog.yaml

volumes:
 []
 - name: confd-config
 configMap:
 name: dd-agent-config
 items:
 - key: http-config
 path: http_check.yaml
 - name: datadog-yaml
 configMap:
 name: dd-agent-config
 items:
 - key: datadog-yaml
 path: datadog.yaml 

And in your ConfigMap:

 kind: ConfigMap
apiVersion: v1
metadata:
 name: dd-agent-config
 namespace: default
data:
 http-config: |-
 init_config:
 instances:
 datadog-yaml: |-
 listeners:
 - name: kubelet
 config_providers:
 - name: kubelet
 polling: true
 check_runners: 1

Annotations

It is also possible to enable integrations via the annotations in the manifest of your application. This can be done with Autodiscovery. For more details, see the Autodiscovery section.

Further Reading

Additional helpful documentation, links, and articles: