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

add metrics, metrics analysis, and concurrency #37

Merged
merged 3 commits into from
Apr 12, 2023
Merged

Conversation

lingrino
Copy link
Contributor

Reminder: This is a public repo

This PR adds a new command to export metrics and their associated tags. There's always going to be way more metrics than dashboards/monitors and running this command takes quite a while in our datadog account. I tried to speed this up by adding some concurrency but even a little bit gets us rate limited by datadog. A future PR should add retries on 429s from datadog. Docs on that here.

This PR also adds a new command metrics-analysis that writes a file analysis.json. The output of this command is an ordered list of tags across all metrics with the given prefix. So you can run it on an individual metric (datadog-exporter metrics-analysis system.cpu.user) or on multiple metrics with the same prefix (datadog-exporter metrics-analysis system.cpu)

The goal with the analysis command is that we can take a high-cardinality metric namespace like server.* and run this command to get a list of all custom tags used by this metric namespace. We can feed that into metrics without limits and exclude the high-cardinality tags.

One caveat: This doesn't seem to ever output the host tag and I'm not sure why. It appears the host tag is a special datadog thing that has its own API and doesn't show up in the requests for all other tags. Just a way for them to extract money from people who don't even want the tag but can't remove it.

@lingrino lingrino requested a review from a team as a code owner April 12, 2023 00:18
@lingrino lingrino merged commit e007af0 into main Apr 12, 2023
@lingrino lingrino deleted the export-metrics branch April 12, 2023 17:18
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants