-
Notifications
You must be signed in to change notification settings - Fork 341
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
Add initial support for stream upstream metrics #1
Conversation
This includes only the subset of per-upstream/peer metrics that already exist for non-stream upstreams which are applicable to stream/UDP upstreams. There are additional stream/UDP-specific metrics that should be added later, but this is a useful start. Note: This propagates the existing incorrect help text for the "fails" metric (it shouldn't be "Active connections") because I'm not sure what the correct help text should be.
@eriksw thx for the PR. we'll review it and get back to you shortly |
@eriksw Thanks for the PR. It is a good start for supporting stream upstreams. However, the correct implementation must use the stream specific data strucures. Currently, we're in the process of migrating the prometheus exporter to use our public SDK client https://github.com/nginxinc/nginx-plus-go-sdk. Also, we're planning to add the stream related data structures to our public SDK client. Would you be OK to extend the PR to support a few additional stream metrics once our public is SDK is added to this project and updated with stream upstream metrics. Your existing code should continue to work. Regarding the docs for "fails" method, thanks for catching that. The correct value is "Unsuccessful attempts to communicate with the server", we got it from http://nginx.org/en/docs/http/ngx_http_api_module.html#def_nginx_http_upstream. |
Yes, I'd be happy to rebase and extend this work to cover the rest of the metrics once the external SDK client is integrated into the exporter. |
@eriksw great! thank you |
@eriksw Great! Thank you for your contribution. We also need stream metrics and I already wanted to contribute and create a pull request but that 's not needed anymore. Let me know if you need help. @pleshakov |
I've been waiting for a switch to the external SDK client to land (is that being actively worked on by anyone, @pleshakov?) before reworking this to support all the possible metrics. This PR is a lot less useful than an updated one that supports all the upstream metrics would be. |
@avthart thanks for sharing your implementation. I'm glad that you find our implementation useful. Our goal is to have a long-term supported solution. @eriksw we just added support for stream upstreams and server zones to the SDK - nginxinc/nginx-plus-go-client@c9fb4ac . It will be added to this project in a couple of days. Thanks again for bringing this PR. We'll ping you once the updated SDK is added to this project. @eriksw @avthart except for the stream-related metrics, do you have any additional requirements/proposals for the exporter? |
I compared both exporters, see below: nginx/nginx-prometheus-exporter:0.1.0
avthart/nginxplus-exporter:v0.1.0
As you can see some metrics are not available yet in the official exporter. Besides that there are some implementation differences. We have included the state (unavail,down,unhealthy,up,checking) as a label of the metric |
@eriksw the exporter started using the NGINX Plus client from our go sdk project -- https://github.com/nginxinc/nginx-plus-go-sdk The client includes the I reviewed your PR. Please see the following suggestions:
|
@eriksw we'd like to proceed with this feature. If it is OK with you, we will implement that in a separate PR and close this one? |
Sorry, I've been too busy to work on this. Feel free to close this and reimplement in another PR. |
Closes: #1 * Add streamUpstream metrics * Add streamUpstreamServer metrics * Add streamServerZone metrics
Closes: #1 * Add streamUpstream metrics * Add streamUpstreamServer metrics * Add streamServerZone metrics * Metric descriptor must be the same for every metric with the same metricName, so Metric descriptions must be the same regardless of label * Add stream metrics documentation to readme * Fix readme typo Upsteams->Upstreams
Closes: #1 * Add streamUpstream metrics * Add streamUpstreamServer metrics * Add streamServerZone metrics * Metric descriptor must be the same for every metric with the same metricName, so Metric descriptions must be the same regardless of label * Add stream metrics documentation to readme * Fix readme typo Upsteams->Upstreams
This includes only the subset of per-upstream/peer metrics that already
exist for non-stream upstreams which are applicable to stream/UDP
upstreams. There are additional stream/UDP-specific metrics that should
be added later, but this is a useful start.
Note: This propagates the existing incorrect help text for the "fails"
metric (it shouldn't be "Active connections") because I'm not sure what
the correct help text should be.