Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distinguishing metrics by tag #544

Open
80kk opened this issue May 17, 2023 · 4 comments
Open

Distinguishing metrics by tag #544

80kk opened this issue May 17, 2023 · 4 comments

Comments

@80kk
Copy link

80kk commented May 17, 2023

Is it possible to have signle dimension defined multiple times for example with tag selection and without?
Lets say:

config: |-
  region: eu-west-1
  period_seconds: 240
  metrics:
  - aws_dimensions:
    - QueueName
    aws_metric_name: NumberOfMessagesSent
    aws_namespace: AWS/SQS
    aws_statistics: [Sum, SampleCount, Minimum, Maximum, Average]
---

and:

config: |-
  region: eu-west-1
  period_seconds: 240
  metrics:
  - aws_dimensions:
    - QueueName
    aws_metric_name: NumberOfMessagesSent
    aws_namespace: AWS/SQS
    aws_statistics: [Sum, SampleCount, Minimum, Maximum, Average]
   aws_tag_select:
     tag_selections:
       Monitoring: ["enabled"]
---

The reason I am asking is that I want to differentiate alert route in Grafana and send notification to Slack only or both to Slack and PagerDuty if particular queue has a desired tag.

@80kk 80kk added the metrics-configuration How to configure specific metrics for collection label May 17, 2023
@80kk 80kk changed the title [metrics]: short description here [metrics]: Same dimension defined multiple times May 17, 2023
@matthiasr
Copy link
Contributor

This is an interesting use case! Unfortunately I don't think this solution would work. We would have to add the tag value as a label on the metric, which is unfortunately not something we support. You may be interested in the other CloudWatch exporter which includes this as a headline feature.

I am somewhat hesitant about adding this feature to CWE (this exporter), considering YACE has it. This exporter is more "pure" in that it really (almost) only translates CloudWatch without trying to know about all the different AWS services and how their tagging interacts with the CloudWatch metric. Even supporting tag selections results in an endless stream of "but how do I use it for this particular metric" questions 😅

@matthiasr matthiasr added enhancement and removed metrics-configuration How to configure specific metrics for collection labels Jun 2, 2023
@matthiasr matthiasr changed the title [metrics]: Same dimension defined multiple times Distinguishing metrics by tag Jun 2, 2023
@matthiasr
Copy link
Contributor

I updated the labels and title to reflect the use case you are asking about.

@abrassel
Copy link

abrassel commented Nov 7, 2023

@matthiasr Checking in - does that mean that it is currently impossible for my metric to contain information about the tags of the resource it is scraping?

This would definitely be one of my top feature asks. We have a set of nat gateways in our account, and we want to bucket them by category of network infrastructure that they belong to, which is currently indicated by a tag on the natgateway.

@matthiasr
Copy link
Contributor

Correct – if you need this, use YACE instead. It is designed to understand AWS beyond CloudWatch, which this exporter is not.

I am not totally opposed – if someone comes up with a proposal how we could generically do this, what it would look like in configuration, and what the implementation would look like, we can talk about it. I'll leave this issue open for another few months as an invitation 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants