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

[Feature request] Custom tags on CloudWatch metrics #2572

Closed
jagregory opened this issue Mar 27, 2017 · 6 comments
Closed

[Feature request] Custom tags on CloudWatch metrics #2572

jagregory opened this issue Mar 27, 2017 · 6 comments
Labels
help wanted Request for community participation, code, contribution

Comments

@jagregory
Copy link
Contributor

Hey folks,

What do you think about allowing custom tags to be assigned to metrics which come from the CloudWatch input?

This feature would be most useful for metrics which have less-than-helpful dimensions associated with them, for example when your RDS database identifier is a random GUID it doesn't work very well in Dashboards where you want something a bit more user-friendly.

# Cloudwatch: RDS metrics 
[[inputs.cloudwatch]]
  namespace = "AWS/RDS"

  # test
  [[inputs.cloudwatch.metrics]]
    names = ["CPUUtilization", "MaximumUsedTransactionIDs", "DatabaseConnections"]

    [[inputs.cloudwatch.metrics.dimensions]]
      name = "DBInstanceIdentifier"
      value = "tf-00000000000000000000000000"

  # prod
  [[inputs.cloudwatch.metrics]]
    names = ["CPUUtilization", "MaximumUsedTransactionIDs", "DatabaseConnections"]

    [[inputs.cloudwatch.metrics.dimensions]]
      name = "DBInstanceIdentifier"
      value = "tf-111111111111111111111111"

It'd be great to add tags, something like:

[[inputs.cloudwatch.metrics]]
   names = ["CPUUtilization", "MaximumUsedTransactionIDs", "DatabaseConnections"]
   [[inputs.cloudwatch.metrics.tags]]
     environment = Production

This would be similar to the global_tags option.

@jagregory
Copy link
Contributor Author

To clarify why the global_tags option doesn't work for this scenario is I have a separate Telegraf instance which is responsible for collecting CloudWatch metrics (and a few other things), so it spans environments and can't really share their global tags.

@phemmer
Copy link
Contributor

phemmer commented Mar 27, 2017

Just FYI, you can do this:

# Cloudwatch: RDS metrics 
[[inputs.cloudwatch]]
  namespace = "AWS/RDS"

  [[inputs.cloudwatch.tags]]
    environment = "test"

  [[inputs.cloudwatch.metrics]]
    names = ["CPUUtilization", "MaximumUsedTransactionIDs", "DatabaseConnections"]

    [[inputs.cloudwatch.metrics.dimensions]]
      name = "DBInstanceIdentifier"
      value = "tf-00000000000000000000000000"

[[inputs.cloudwatch]]
  namespace = "AWS/RDS"

  [[inputs.cloudwatch.tags]]
    environment = "production"

  [[inputs.cloudwatch.metrics]]
    names = ["CPUUtilization", "MaximumUsedTransactionIDs", "DatabaseConnections"]

    [[inputs.cloudwatch.metrics.dimensions]]
      name = "DBInstanceIdentifier"
      value = "tf-111111111111111111111111"

Not saying your request shouldn't be implemented, just proposing a workaround.

@jagregory
Copy link
Contributor Author

Thanks, that's a good work around. It does make things quite verbose, unfortunately. Is anyone opposed to the feature request? I'd be interested in seeing if I can handle a PR for it.

@danielnelson
Copy link
Contributor

We would accept a PR for this.

@danielnelson
Copy link
Contributor

Doing input level tags is already working. If you wanted to add support for tags per individual metric within an input plugin that would be okay.

@nhaugo nhaugo added the help wanted Request for community participation, code, contribution label Mar 30, 2017
@danielnelson
Copy link
Contributor

@jagregory Based on the discussion in the linked issues, I think your problem is solved and this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Request for community participation, code, contribution
Projects
None yet
Development

No branches or pull requests

4 participants