-
Notifications
You must be signed in to change notification settings - Fork 303
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
Export various stats about services in the metrics exported by this c… #1943
Export various stats about services in the metrics exported by this c… #1943
Conversation
Hi @mmamczur. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
pkg/servicemetrics/servicemetrics.go
Outdated
IsStaticIPv4: service.Spec.LoadBalancerIP != "", | ||
IsStaticIPv6: false, |
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.
@panslava is this assumption right? there are never StaticIPv6?
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.
for now they are not supported in Google Cloud
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.
Let's add a todo to extend this field as soon as we support this
return string(*service.Spec.InternalTrafficPolicy) | ||
} | ||
|
||
func getPortsBucket(ports []v1.ServicePort) string { |
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.
prometheus histogram metrics only need to receive the data and it already. manages the bucket, do we need to export this as a string?
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.
so here we want to limit the number of possible values in the label and we decided on these specific 'bucket' ourselves. This is intended to limit the cardinality of the metric
57194ba
to
f476884
Compare
/ok-to-test |
pkg/servicemetrics/servicemetrics.go
Outdated
IsStaticIPv4: service.Spec.LoadBalancerIP != "", | ||
IsStaticIPv6: false, |
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.
Let's add a todo to extend this field as soon as we support this
Michał overall LGTM from my side please take from my comments whatever you find useful and we can commit soon thanks! |
309bac4
to
ad346f4
Compare
ad346f4
to
0e76ed7
Compare
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.
this mostly looks good to me. I would recommend customizing the buckets in prometheus if the goal is to reduce the cardinality and remove some of the logic necessary to maintain the buckets.
labelIPFamilies = "ip_families" | ||
labelIPFamilyPolicy = "ip_family_policy" | ||
labelIsStaticIPv4 = "is_static_ip_v4" | ||
labelIsStaticIPv6 = "is_static_ip_v6" |
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.
do we want a labelIsStaticDualStack
?
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.
LB that would have 2 static IPs?
is this possible? We could also set both these to true if we ever support a case like that
var ( | ||
serviceL4ProtocolStatsCount = prometheus.NewGaugeVec( | ||
prometheus.GaugeOpts{ | ||
Name: "service_l4_protocol_stats", |
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.
nit: Since these aren't all protocol labels, many configuration or config?
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.
something like service_l4_config_stats?
|
||
const ( | ||
// Names of the labels used by the service metrics. | ||
labelType = "type" |
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.
what are the possible values for "type"
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.
in general this is the service type, so could be ClusterIP, NodePort etc with a caveat that instead of just having LoadBalancer we have special values for each varian of them, like LegacyXLB, RBSXLB etc
we considered having separate label but we wanted to limit the number of possible label value combinatons
what do you mean about the buckets, can you have them for the label values (and not the metric value)? |
@swetharepakula the metrics we want to export are type even if there was such metric type, to calculate bucketed gauges we would need to keep a slice of buckets in memory while iterating over services (thus duplicating prometheus) also we can not use |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cezarygerard, mmamczur The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…ontroller.