Technofy / cloudwatch_exporter

A CloudWatch exporter for Prometheus coded in Go, with multi-region support
Apache License 2.0
78 stars 140 forks source link

Regex and no dimension_select functionnalities #4

Closed mjubenot closed 6 years ago

mjubenot commented 6 years ago

The no dimensions_select functionality is hooked up with the regex one.

If no dimensions_select nor dimensions_select_regex are specified, it will use the regex functionality matching all the dimension name. The equivalent would be:

      aws_dimensions_select_regex:
        DimensionsName: .*
odupuy commented 6 years ago

Hi, Any timeline for this nice enhancement?

a-teisseire commented 6 years ago

@odupuy Hello, I had forgotten about this PR and just merged it. Please try it and tell us if it worked for you :)

odupuy commented 6 years ago

Merci @a-teisseire

I have tried to use the regexp on a multi-dimension metric, trying to transform

 - name: billing-per-service
   default_region: us-east-1
   metrics:
    - aws_namespace: "AWS/Billing"
      aws_dimensions: [Currency, ServiceName]
      aws_dimensions_select:
        Currency: [USD]
        ServiceName: [AmazonEC2]
      aws_metric_name: EstimatedCharges
      aws_statistics: [Average]
      range_seconds: 86400 

to a regexp version to avoid having an entry for each AWS service. I have tried different formats but without success. This would be a good way to complete the regexp work. At the very least, please document that the regexps are not supported in multi-dimension metrics for now.

The metric above w/ or w/o regexps would be a good thing to add in your sample to show a multi-dimensional metric.

Still, a very good step. Thanks /merci

Some ideas for possible enhancements around regexps ;-)

FYI 9042 is the default port for Cassandra, this is why it sounded familiar to me.

mjubenot commented 6 years ago

Hello @odupuy , the multi-dimension metrics support problem you brought up has been fixed. Some examples have been added to the config.yml to showcase the new possibilities.

About the others enhancements, we will think about it but this quick fix should make the regex feature more reliable. Please try these new features and tell us if it worked for you 🙂

odupuy commented 6 years ago

@mjubenot Thanks for the update. I will have a look at it this week or if not then early next week.

odupuy commented 6 years ago

@mjubenot Tested and it works perfectly. I am upgrading my project to use #6. Merci