Network Performance Monitoring is now generally available! Network Monitoring is now available!

Autodiscovery Container Identifiers

Autodiscovery container identifiers, or ad_identifiers, allow you to apply an Autodiscovery configuration file template to a given container, either by using the container short image or with a custom Autodiscovery container identifier.

Note: For other configuration types—key-value stores, Docker labels, or Kubernetes pod annotations—the matching between an integration configuration template and the corresponding container is based on the <CONTAINER_IDENTIFIER> included in the key-value stores, labels, or annotations configuration.

Short image container identifiers

To apply the following Autodiscovery configuration template to a given container, use the container short image name as the <INTEGRATION_AUTODISCOVERY_IDENTIFIER>:

ad_identifiers:
  <INTEGRATION_AUTODISCOVERY_IDENTIFIER>

init_config:
  <INIT_CONFIG>

instances:
  <INSTANCES_CONFIG>

For example, the following Apache Autodiscovery configuration template can be used by the Agent:

ad_identifiers:
  - httpd
init_config:
instances:
  - apache_status_url: http://%%host%%/server-status?auto
logs:
  source: apache
  service: webapp

This matches ANY httpd container image on your host. Suppose you have one container running library/httpd:latest and another running <WHATEVER>/httpd:v2. The Agent applies the above template to both containers since you have to provide short names for container images, e.g. httpd, NOT library/httpd:latest.

When using short image names as Autodiscovery container identifiers, the Agent cannot distinguish between identically named images from different sources or with different tags.

Multiple identifiers

Specify multiple image names by adding to the ad_identifiers list, for example:

ad_identifiers:
  - httpd
  - my-custom-httpd-image

Custom Autodiscovery container identifiers

To apply different Autodiscovery configuration templates to containers running the same image, use a custom value <INTEGRATION_AUTODISCOVERY_IDENTIFIER> and apply it with the com.datadoghq.ad.check.id label to identify your container. Using the following configuration file:

ad_identifiers:
  <INTEGRATION_AUTODISCOVERY_IDENTIFIER>

init_config:
  <INIT_CONFIG>

instances:
  <INSTANCES_CONFIG>

Add the following label to apply this Autodiscovery configuration template to a specific container.

com.datadoghq.ad.check.id: <INTEGRATION_AUTODISCOVERY_IDENTIFIER>

Note: The com.datadoghq.ad.check.id label takes precedence over the image/name.

Further Reading