-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Use textparse in prometheus module helper library #33865
Conversation
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
Kudos, SonarCloud Quality Gate passed! |
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
0e90095
to
82290f3
Compare
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Opening for an early review since we agreed on moving this one forward. Tests have been added, and unit tests of both |
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.
Most of my comments are on code moved in the textparse.go
files, so feel free to ignore them by now as this is not added on this PR.
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
@@ -192,19 +190,6 @@ func (g remoteWriteTypedGenerator) GenerateEvents(metrics model.Samples) map[str | |||
return eventList | |||
} | |||
|
|||
// rateCounterUint64 fills a counter value and optionally adds the rate if rate_counters is enabled |
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.
Why is this deleted?
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.
It's not used at all and linter complains about this :)
Small one, can you add details how you installed and tested with prom/node-exporter:v0.18.1 ? Maybe an extra task to update our infraobs documentation? |
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Kudos, SonarCloud Quality Gate passed! |
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.
Most of my concerns have been addressed, LGTM, will leave the final decision to your team 🙂
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.
LGTM!
Signed-off-by: ChrsMark <[email protected]>
Since manual testing have been completed and unit tests are green I'm gonna merge this. |
What does this PR do?
Switches to using textparse as discussed at #24707.
This PR extends #27269 so as to make use the
textparse
in theprometheus
helper library which is used by theprometheus
,kubernetes
andcontainerd
modules.This will solve the issue of handling the duplicated metrics reported at #18813 -> Testcase
cc: @jsoriano @premendrasingh @vjsamuel
Closes #18813
Testing TODOs
In all cases the number of metrics and their types should be the same with the old and and new library.
Manually test the
kubernetes
module to ensure thatstate-*
metricsets are not brokenVerified number of events in both branches.
Manually test the
prometheus
module against anode-exporter
✅Tested against
prom/node-exporter:v0.18.1
. This branch andmain
collect the same number of metrics and labels. This ensure us that we collect and store the same number of fields.Manually test the
prometheus
module against anode-exporter
usingtypes
andrates
✅This branch and
main
collect the same number of metrics and labels. This ensure us that we collect and store the same number of fields.For the rest of the sanity checks we can rely on unit tests, since those evaluate the produced values too.
node-exporter appendix
docker-compose.yml
as:docker-compose up
0.0.0.0:9100
prometheus
module of metricbeat and configure thecollector
metricset to collect from0.0.0.0:9100
Histogram checks
In order to test that histograms are calculated properly use the following complete example of Prometheus
and
Histograms can be found at
prometheus-ip:9090/metrics
.