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

Error when defining scrape uri #2

Closed
r4j4h opened this issue Aug 11, 2018 · 4 comments
Closed

Error when defining scrape uri #2

r4j4h opened this issue Aug 11, 2018 · 4 comments
Assignees
Labels
question An issue asking a question

Comments

@r4j4h
Copy link

r4j4h commented Aug 11, 2018

When running

the README states

http://127.0.0.1:8080/stub_status is the default scrape URI. Running it without changing it seems to confirm.

2018/08/11 00:12:14 Could not create Nginx Client: Failed to create NginxClient: failed to get http://127.0.0.1:8080/stub_status: Get http://127.0.0.1:8080/stub_status: dial tcp 127.0.0.1:8080: connect: connection refused

However, if I try to define it as that via -nginx.scrape-uri="http://127.0.0.1:8080/stub_status", when I run it I get:

2018/08/11 00:11:20 Could not create Nginx Client: Failed to create NginxClient: failed to get "http://127.0.0.1:8080/stub_status": parse "http://127.0.0.1:8080/stub_status": first path segment in URL cannot contain colon
@Dean-Coakley Dean-Coakley self-assigned this Aug 13, 2018
@Dean-Coakley Dean-Coakley added the question An issue asking a question label Aug 13, 2018
@Dean-Coakley
Copy link
Contributor

Dean-Coakley commented Aug 13, 2018

Hi @r4j4h

I've been unable to recreate this issue. Can you give me some more details about how exactly you are running this?

  • Did you build the image locally, or did you pull the image from our docker registry?
  • What is the full command you are using to run the container?
  • Docker version?

Issue appears to be that the flag is adding a set of quotes to the url. Perhaps try the alternate go flag syntax?:
$ docker run -p 9113:9113 nginx/nginx-prometheus-exporter:0.1.0 -nginx.scrape-uri http://127.0.0.1:8080/stub_status

@r4j4h
Copy link
Author

r4j4h commented Aug 14, 2018

Hi there,

You were right, it was with quotations.

FWIW though, I am running this in a Kubernetes Pod as a sidecar to an nginxinc nginx Ingress exporter.

Using the alternate syntax didn't seem to work:

  nginx-prometheus-exporter:
    Container ID:  docker://0136d7700ccaf9099029f6a4f9e3ca5d5b9600f68331893b402b0295211a8f29
    Image:         nginx/nginx-prometheus-exporter:0.1.0
    Image ID:      docker-pullable://nginx/nginx-prometheus-exporter@sha256:24e87a3a18fd27c39e8d4fb11147ab080a0c39a3171d85e6c17954fbf09644fc
    Port:          9113/TCP
    Host Port:     9113/TCP
    Args:
      -nginx.scrape-uri http://127.0.0.1:80/stub_status

gives

flag provided but not defined: -nginx.scrape-uri http://127.0.0.1:80/stub_status
Usage of /usr/bin/exporter:
  -nginx.plus
    	Start the exporter for NGINX Plus. By default, the exporter is started for NGINX.
  -nginx.scrape-uri string
    	A URI for scraping NGINX or NGINX Plus metrics.
    		For NGINX, the stub_status page must be available through the URI. For NGINX Plus -- the API. (default "http://127.0.0.1:8080/stub_status")
  -web.listen-address string
    	An address to listen on for web interface and telemetry. (default ":9113")
  -web.telemetry-path string
    	A path under which to expose metrics. (default "/metrics")

But

    Args:
      -nginx.scrape-uri=http://127.0.0.1:80/stub_status

indeed works!

Versus my prior

    Args:
      -nginx.scrape-uri="http://127.0.0.1:80/stub_status"

Thanks!

@r4j4h r4j4h closed this as completed Aug 14, 2018
@Dean-Coakley
Copy link
Contributor

Glad I could help!

Thanks for all this extra detail. I'll take some steps to investigate if we can make this less error prone

@r4j4h
Copy link
Author

r4j4h commented Aug 15, 2018

My pleasure, and mega thanks to ya'll for starting this exporter!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question An issue asking a question
Projects
None yet
Development

No branches or pull requests

2 participants