---
# docker-compose file for datadog agent
# DOCKER_HOST=dkhost:2376 docker-compose up -d
#
# DOCKER_HOST=dkhost:2376 docker stack deploy -c docker-compose.yml services
#
# DOCKER_HOST=dkhost:2376  docker stack ps services

version: '3.4'
services:

  datadog:
    image: datadog/docker-dd-agent:latest-dogstatsd
    hostname: home
    environment:
      API_KEY: ca0faf176c4aedd4f547ed7cf85615eb
      LOG_LEVEL: INFO
      NON_LOCAL_TRAFFIC: "true"
    ports:
      - "8125:8125/udp"
    deploy:
      mode: replicated
      replicas: 1
      restart_policy:
        condition: any
        delay: "1m"
        max_attempts: 1
      update_config:
        parallelism: 1
        delay: 2s
        order: start-first
      resources:
        limits:
          memory: 512M

    logging:
      driver: fluentd
      options:
        fluentd-address: "logs.xai-corp.net:24224"
        fluentd-async-connect: 'true'
        tag: datadog
