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

inputs.cloudwatch: Error when using multiple namespaces #12172

Closed
atartareanu opened this issue Nov 3, 2022 · 4 comments · Fixed by #12177
Closed

inputs.cloudwatch: Error when using multiple namespaces #12172

atartareanu opened this issue Nov 3, 2022 · 4 comments · Fixed by #12177
Labels
area/aws AWS plugins including cloudwatch, ecs, kinesis bug unexpected problem or unintended behavior plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins

Comments

@atartareanu
Copy link

atartareanu commented Nov 3, 2022

Use Case

Hello
Thank you for making this possible: configure multiple namespaces in telegraf cloudwatch input
#9386

However there is no concrete example how to configure this, especially for the tree of metrics and dimensions. I have tried multiple combinations and some do not make sense, but still work like:

namespaces = ["AWS/Billing", "AWS/ECS"]

[[inputs.cloudwatch.metrics]]
names = ["MemoryUtilization", "CPUUtilization"]
  
[[inputs.cloudwatch.metrics.dimensions]]
name = "ServiceName"
value = "*"

[[inputs.cloudwatch.metrics.dimensions]]
name = "ClusterName"
value = "*"

[[inputs.cloudwatch.metrics]]
names = ["EstimatedCharges"]
  
[[inputs.cloudwatch.metrics.dimensions]]
name = "ServiceName"
value = "*"

[[inputs.cloudwatch.metrics.dimensions]]
name = "Currency"
value = "*"

[[inputs.cloudwatch.metrics]]
names = ["EstimatedCharges"]

[[inputs.cloudwatch.metrics.dimensions]]
name = "Currency"
value = "USD"

so I put AWS/Billing first in the namespaces and AWS/ECS second, but the associated metrics are reversed, however it's the only combination that works, but where is the logic ?

Also when trying to add another namespace, e.g. , "AWS/ApplicationELB" the previous config does not work, I will only get data for a single namespace.

Can you please provide an example of configuration with 3 namespaces + random metrics and dimensions.

Thank you.

Expected behavior

The documentation/config example should contain configuration for multiple namespaces

Actual behavior

there is no logic on how this works. we want to understand and make it better.

Additional info

No response

@atartareanu atartareanu added the feature request Requests for new plugin and for new features to existing plugins label Nov 3, 2022
@powersj
Copy link
Contributor

powersj commented Nov 3, 2022

Hi,

This sounds more like a support request, that would be better asked in Slack or on our community forums.

Can you show your full cloudwatch config as well as logs, please? I ask because you have one "namespace" option that isn't even in the cloudwatch plugin section and it helps to not hide any config options from us if we are trying to support you.

It sounds like you are doing the right thing, but running into actual issues, as such showing your logs would really help us understand what you are seeing, rather than needing to guess.

Let's try with a single namespace and the three metrics:

[[inputs.cloudwatch]]
  <add your auth items>
  <are there any other options outside of auth you are using, if so please let us know>
  namespaces = ["AWS/Billing"]

  [[inputs.cloudwatch.metrics]]
    names = ["MemoryUtilization", "CPUUtilization"]
    [[inputs.cloudwatch.metrics.dimensions]]
      name = "ServiceName"
      value = "*"
    [[inputs.cloudwatch.metrics.dimensions]]
      name = "ClusterName"
      value = "*"

  [[inputs.cloudwatch.metrics]]
    names = ["EstimatedCharges"]
    [[inputs.cloudwatch.metrics.dimensions]]
      name = "ServiceName"
      value = "*"
    [[inputs.cloudwatch.metrics.dimensions]]
      name = "Currency"
      value = "*"

  [[inputs.cloudwatch.metrics]]
    names = ["EstimatedCharges"]
    [[inputs.cloudwatch.metrics.dimensions]]
      name = "Currency"
      value = "USD"

Does that work? If so, great, try the other namespace by itself. Does that work?

If this does not work, can you confirm that you can actually see these metrics using the CLI. Checkout the Troubleshooting section and verify that each of these work for the namespace.

@powersj powersj added the waiting for response waiting for response from contributor label Nov 3, 2022
@atartareanu
Copy link
Author

Hello @powersj
Thank you for your quick reply, I was not aware we can get support on Slack, I will try my luck there by providing additional information.

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Nov 4, 2022
@powersj powersj added the waiting for response waiting for response from contributor label Nov 4, 2022
@srebhan srebhan added bug unexpected problem or unintended behavior area/aws AWS plugins including cloudwatch, ecs, kinesis plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins and removed feature request Requests for new plugin and for new features to existing plugins waiting for response waiting for response from contributor labels Nov 7, 2022
@srebhan srebhan changed the title cloudwatch input plugin config example with multiple namespaces inputs.cloudwatch: Error when using multiple namespaces Nov 7, 2022
@srebhan
Copy link
Member

srebhan commented Nov 7, 2022

Further digging brought up the error message

[inputs.cloudwatch] failed to list metrics with namespace AWS/ApplicationELB: operation error CloudWatch: ListMetrics, https response error StatusCode: 400, RequestID: [REDACTED], InvalidParameterValue: Parameters do not match original request parameters

occurring during ListMetrics.

@bwesen
Copy link

bwesen commented Jul 17, 2023

Can't you just replicate the whole inputs.cloudwatch section multiple times, each time with a different namespace? I ran into this now as well, and it's not obvious how to do this but that would be logical..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/aws AWS plugins including cloudwatch, ecs, kinesis bug unexpected problem or unintended behavior plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants