ansible-datadog icon indicating copy to clipboard operation
ansible-datadog copied to clipboard

Playbook will not pickup variables for haproxy logs forwarding.

Open bnjeongwo opened this issue 1 year ago • 1 comments

What task specifically populates /etc/datadog-agent/conf.d/haproxy.d/conf.yaml

bnjeongwo avatar Jun 17 '23 12:06 bnjeongwo

this is how my haproxy vars_file looks. I am not sure why the playbook is not picking up the logs vars to populate /etc/datadog-agent/conf.d/haproxy.d/conf.yaml

---
datadog_checks:
  haproxy:
    init_config:
    instances:
      - url: "https://127.0.0.1:8080/stats"
        tls_verify: xxxx
        tls_ignore_warning: xxxx
  logs:
    - type: file
      path: /var/log/haproxy-traffic.log
      service: my_haproxy_service
      source: haproxy
      sourcecategory: http_web_access

bnjeongwo avatar Jun 21 '23 14:06 bnjeongwo

I took the liberty of editing your comment to use code formatting so that indentation can be looked at (as it's quite critical in yaml). It looks like the whole logs key requires some further indentation, i.e.:

datadog_checks:
  haproxy:
    init_config:
    instances:
      - url: "https://127.0.0.1:8080/stats"
        tls_verify: xxxx
        tls_ignore_warning: xxxx
    logs:
      - type: file
        path: /var/log/haproxy-traffic.log
        service: my_haproxy_service
        source: haproxy
        sourcecategory: http_web_access

I'll be closing this now; note that contacting Datadog support can be much more effective at getting a response for this sort of issue.

alopezz avatar Jul 19 '24 14:07 alopezz