-
Notifications
You must be signed in to change notification settings - Fork 596
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
Fix: Handle float apiserver buckets #965
base: master
Are you sure you want to change the base?
Conversation
We have some lint failures |
Depending on the version of client_golang and metrics format (Prometheus vs OpenMetrics), bucket names may contain either integer or float formatting. Use a regexp match to select either format. Signed-off-by: SuperQ <superq@gmail.com>
80f69a1
to
608c01f
Compare
@SuperQ FYI CI is still failing |
kubeApiserverReadResourceLatency: '1(\.0)?', | ||
kubeApiserverReadNamespaceLatency: '5(\.0)?', | ||
kubeApiserverReadClusterLatency: '30(\.0)?', | ||
kubeApiserverWriteLatency: '1(\.0)?', |
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.
kubeApiserverReadResourceLatency: '1(\.0)?', | |
kubeApiserverReadNamespaceLatency: '5(\.0)?', | |
kubeApiserverReadClusterLatency: '30(\.0)?', | |
kubeApiserverWriteLatency: '1(\.0)?', | |
kubeApiserverReadResourceLatency: '1(.0)?', | |
kubeApiserverReadNamespaceLatency: '5(.0)?', | |
kubeApiserverReadClusterLatency: '30(.0)?', | |
kubeApiserverWriteLatency: '1(.0)?', |
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.
That doesn't seem correct. We need to escape the .
in order to have a literal .
match instead of a regexp any character match.
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.
Of course, you're right @SuperQ. What you need instead then is to double-double-escape! i.e.
- kubeApiserverReadResourceLatency: '1(\.0)?',
- kubeApiserverReadNamespaceLatency: '5(\.0)?',
- kubeApiserverReadClusterLatency: '30(\.0)?',
- kubeApiserverWriteLatency: '1(\.0)?',
+ kubeApiserverReadResourceLatency: '1(\\\\.0)?',
+ kubeApiserverReadNamespaceLatency: '5(\\\\.0)?',
+ kubeApiserverReadClusterLatency: '30(\\\\.0)?',
+ kubeApiserverWriteLatency: '1(\\\\.0)?',
which would produce queries like:
sum by (cluster) (cluster_verb_scope_le:apiserver_request_sli_duration_seconds_bucket:increase30d{verb=~"POST|PUT|PATCH|DELETE",le=~"1(\\.0)?"})
Depending on the version of client_golang and metrics format (Prometheus vs OpenMetrics), bucket names may contain either integer or float formatting.
Use a regexp match to select either format.