-
Notifications
You must be signed in to change notification settings - Fork 31
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 const labels to metrics #64
Add const labels to metrics #64
Conversation
6a18e99
to
1871d7b
Compare
route53.go
Outdated
HostedZonesPerAccountUsage: prometheus.NewDesc(prometheus.BuildFQName(namespace, "", "route53_hostedzonesperaccount_total"), "Number of Resource records", []string{}, nil), | ||
LastUpdateTime: prometheus.NewDesc(prometheus.BuildFQName(namespace, "", "route53_last_updated_timestamp_seconds"), "Last time, the route53 metrics were sucessfully updated", []string{}, nil), | ||
RecordsPerHostedZoneQuota: prometheus.NewDesc(prometheus.BuildFQName(namespace, "", "route53_recordsperhostedzone_quota"), "Quota for maximum number of records in a Route53 hosted zone", []string{"hostedzoneid", "hostedzonename"}, constLabels), | ||
RecordsPerHostedZoneUsage: prometheus.NewDesc(prometheus.BuildFQName(namespace, "", "route53_recordsperhostedzone_total"), "Number of Resource records", []string{"hostedzoneid", "hostedzonename"}, constLabels), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RecordsPerHostedZones acutally do have their own quota code: L-E209CC9F
I think, we should include that as well
1871d7b
to
63de38f
Compare
Please also check this ongoing discussion, cause it seems related: #62 (comment) |
@janboll thanks for the pointer - I think we can live with that solution - it would make the app-interface queries a bit more complex, but I think that shouldn't be a big issue, as we only have to get one working and the rest is 90% copy-paste. So if that is the approach you will use, I will update our static labels to use the same approach - I certainly don't want 2 divergent solutions to the same problem in this codebase. @mrWinston WDYT? |
63de38f
to
0d6f738
Compare
After trying to migrate the metrics to use a single metric for constant labels, I am not so sure this works well for the metrics in the privatelink exporters.
This makes writing the |
This will help in quickly identifying which account requires action, if an alerts pops up.
This can later be used for automation purposes.
0d6f738
to
f5b5215
Compare
Seconding @bergmannf 's point above - the lack of a common ID for our metrics would make writing the group expressions grow in complexity for what I don't see is much gain. I'm personally in favor with the current approach for our needs here. For example, in the following metrics there is no common id in the labels that we could group our metrics on easily. We could add all of the IDs to the labels for every metric, but this would lead to empty labels in multiple places (which I'm not sure is posssible).
|
@janboll So I think the privatelink metrics are better of with the constant labels being duplicated between the metrics. Would also be great - if this is fine for you - to get this PR reviewed, because @AlexVulaj would like to start working on the app-interface updates to the prometheusrules. |
Your argument makes sense! Also the account ID is somewhat of a special case. I added some review comments to get this merged. |
This PR adds const labels to metrics:
This is a newer version of #49, but I couldn't reopen the old PR, due to having force-pushed additional commits.