-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[nginx] Include track label in Prometheus metrics #2128
Comments
We have this information but it will too expensive (CPU and time) because the only way we can support this is searching the upstream IP and port in the local cache. |
ping @pieterlange |
@lambertjosh looks like you need to configure your prometheus server to inject the pod label during the scrape. Below you can see how my metrics are tagged by prometheus. I'm currently using prometheus-operator to setup my server, it can abstract a lot of configuration for you. I'm pasting the config generated by prometheus, hope it can help you.
|
@gianrubio that would apply the labels of the ingress, right? In the case of canary deploys, you'd typically only have a single ingress pointing at a single service, with multiple deployments underneath it. The trick is to be able to differentiate, in the upstream metrics, between the multiple deployments backing a single service. |
Could you illustrate that using an existing metrics and adding the desired labels? |
@gianrubio sorry for the delay in writing this up. Our use case is canary deployments, but this same use case could apply to anyone who is running two different deployments matching the same service. In our case we have two deployments matching a single service, one with container.v1 and another with container.v2. This allows us to test new versions of software, gradually rolling it out across our pods until version 2 is all that remains. We'd really like to be able to detect at the NGINX level if we are different behavior between the two versions. Unfortunately the existing labels do not provide enough information to know which deployment the upstream is a member of. k8s specs of sample environment: If I query for
There are two relevant labels for the upstream pod:
Technically it is possible to match Pod IP to other pod details like the It would be amazing if either the pod name or pod labels could be attached to the emitted metrics. |
@aledbf Indeed this is the solution, does the |
No, the Store contains a local copy of the required objects but even with that the operation will be expensive. |
@gianrubio once I get a working PR with the described change I will request you a review of the prometheus part |
The addition of Prometheus metrics support directly within the Ingress in 0.9.0 beta is great. One limitation we have found however, is that there is a limited set of upstream information available.
For example if a company uses two labels to facilitate canary deployments in k8s, this unfortunately means there is no way to differentiate between them. This makes it hard to detect increasing error rates and latency from these canary pods.
It would be really helpful if we could include an additional label, or perhaps include it in the existing upstream label.
The text was updated successfully, but these errors were encountered: