feat: Update libraries and add _total suffix to metrics#35
Open
raelga wants to merge 3 commits intochatwork:mainfrom
Open
feat: Update libraries and add _total suffix to metrics#35raelga wants to merge 3 commits intochatwork:mainfrom
_total suffix to metrics#35raelga wants to merge 3 commits intochatwork:mainfrom
Conversation
Signed-off-by: Rael Garcia <rael@redhat.com>
Signed-off-by: Rael Garcia <rael@redhat.com>
Author
|
cc @cw-sakamoto |
Signed-off-by: Rael Garcia <rael@redhat.com>
|
|
||
| blocks: prometheus.NewDesc( | ||
| prometheus.BuildFQName(namespace, "", "blocks"), | ||
| prometheus.BuildFQName(namespace, "", "blocks_total"), |
There was a problem hiding this comment.
we rename the values to total here because they are counters, but further down we still treat them as gauge_values and not as counters, are you sure they are counters?
From me scanning the source code they are not actually total counters but daily counters, because we only request the statistics for a single day.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several updates to modernize the codebase, including upgrading dependencies, switching to a newer logging library, and following Prometheus metric naming conventions. The changes enhance compatibility, improve readability, and align with current best practices.
Dependency Updates:
Dockerfileto1.24.4and ingo.modto1.24. This ensures compatibility with the latest language features and optimizations.go.modto newer versions, improving stability and adding support for modern features.Logging Library Migration:
go-kit/logwithslogfor logging incollect.goandmain.go. This simplifies log handling and improves the structure of log messages.Metric Naming Improvements:
collect.goto include_totalsuffixes, adhering to Prometheus naming conventions for counters. https://github.com/prometheus/client_golang/blob/0400fc44d42dd0bca7fb16e87ea0313bb2eb8c53/prometheus/testutil/promlint/promlint_test.go#L444Code Refactoring:
promlogwithpromsloginmain.goto align with updated Prometheus libraries. Adjusted related flag and logger initialization accordingly.These changes collectively enhance the maintainability, readability, and compliance of the codebase with modern standards. It will introduce breaking changes, as all the metrics will be renamed. The current names, raise errors in modern prometheus installations: