Skip to content
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 metrics based on path and method #51

Closed
rjshrjndrn opened this issue May 25, 2019 · 3 comments
Closed

Nginx metrics based on path and method #51

rjshrjndrn opened this issue May 25, 2019 · 3 comments

Comments

@rjshrjndrn
Copy link

Hi,
Thank you for this awesome plugin. Helped me to get rid of logspout, logstash and statsd.
But some small clarifications.

  1. is it possible to get custom metrics( like per path or incoming ip/server)
  2. Is it possible to gather metrics with methods(GET, POST, OPTIONS)

and one doubt,
while looking at nginx_http_requests_total I saw

nginx_http_requests_total{host="xxx.yyy.com",instance="10.0.0.156:9145",job="nginx_prom",status="200"} 58408
and
nginx_http_requests_total{instance="10.0.0.156:9145",job="nginx_prom",status="200"} 138

one with instance and one without. What's this?

I am running nginx in docker swarm, with 6 replicas, and prometheus dns_sd to discover nodes.

--

Thank you.

@rjshrjndrn
Copy link
Author

I found the solution. Thank you for the awesome plugin once again. Preparing documentation, How I did it for nginx running in a swarm. If you're interested I can raise PR. It'll be an honor.

@rjshrjndrn
Copy link
Author

Sorry,
I got the solution for 1 and 2. But the doubt is still not clarified. What's that 2 metrics with same name and different tags?

@knyar
Copy link
Owner

knyar commented May 28, 2019

A time series in Prometheus is identified by a metric name and a combination of labels, so it's completely normal to have several metrics with the same name and different labels.

In your example it seems like you either added or removed the host label at some point.

@knyar knyar closed this as completed May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants