mesaguy / ansible-prometheus

Ansible role for the management of Prometheus software and Prometheus exporters
https://galaxy.ansible.com/mesaguy/prometheus
MIT License
71 stars 31 forks source link

cloudwatch_exporter does not start in case custom metrics are provided #28

Closed gaarm closed 3 years ago

gaarm commented 3 years ago

https://github.com/mesaguy/ansible-prometheus/blob/4c22d377e05b83bf6dfad06190575b01d46a17d0/templates/cloudwatch_exporter.yml.j2#L7

Cloudwatch_exporter cannot be started in case you provide custom metrics - via _prometheus_cloudwatch_exportercfg. In that case metrics section is indented to the right which causes error - inability for cloudwatch_exporter to start.

Config file is generated like this:

---
#
# Do not edit manually, this file is managed using automation tools
#
modules: 
  metrics:
  - aws_dimensions:
    - LoadBalancer
    aws_metric_name: ActiveConnectionCount
    aws_namespace: AWS/ApplicationELB

but it should be like this (no indentation for metric section):

---
#
# Do not edit manually, this file is managed using automation tools
#
modules: 
metrics:
- aws_dimensions:
  - LoadBalancer
  aws_metric_name: ActiveConnectionCount
  aws_namespace: AWS/ApplicationELB

See more here: https://github.com/prometheus/cloudwatch_exporter

@mesaguy

mesaguy commented 3 years ago

This was resolved a while ago