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

Problem with connection to Nginx PLUS #619

Closed
soddevops opened this issue Feb 1, 2024 · 5 comments
Closed

Problem with connection to Nginx PLUS #619

soddevops opened this issue Feb 1, 2024 · 5 comments
Labels
stale Pull requests/issues with no activity

Comments

@soddevops
Copy link

Nginx [nginx-plus-r22 (1.19.0)] configuration:

`server {
listen MyIP:9999;

location /api {
    api write=on;
    # directives limiting access to the API
}

location = /dashboard.html {
    root /usr/share/nginx/html;
}

# Redirect requests made to the pre-NGINX Plus API dashboard
location = /status.html {
    return 301 /dashboard.html;
}

location = /favicon.ico {
    return 204;
    access_log off;
    log_not_found off;
}

location = /basic_status {
    stub_status;
}

}
`
Run command
./nginx-prometheus-exporter --nginx.plus --nginx.scrape-uri=http://MyIP:9999/api/ --log.level=debug

and check curl:
curl http://127.0.0.1:9113/metrics

response:
caller=nginx_plus.go:649 level=warn msg="Error getting stats" error="failed to get stats: failed to get endpoints: expected 200 response, got 404. error.status=404; error.text=unknown version; error.code=UnknownVersion; request_id=df67af273247ee1b7d71d89ab092ad67; href=https://nginx.org/en/docs/http/ngx_http_api_module.html"

Check api NGINX:
curl http://myIP:9999/api/

Response:
[1,2,3,4,5,6]

When run nginx_exporter without configuration for Plus....

./nginx-prometheus-exporter --nginx.scrape-uri=http://myIP:9999/basic_status --log.level=debug

and check metrics curl http://127.0.0.1:9113/metrics works good.

What 's wrong ?

@lucacome
Copy link
Member

lucacome commented Feb 8, 2024

Hi @soddevops

at the moment the exporter will try to connect to the latest API version that was available at the time of build. I think https://github.com/nginxinc/nginx-prometheus-exporter/releases/tag/v0.10.0 should work for you.

We should definitely improve this (it will probably require making some changes to https://github.com/nginxinc/nginx-plus-go-client too)

@soddevops

This comment was marked as off-topic.

@lucacome
Copy link
Member

lucacome commented Feb 8, 2024

I opened #629

Copy link

github-actions bot commented May 8, 2024

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale Pull requests/issues with no activity label May 8, 2024
Copy link

This issue was closed because it has been stalled for 10 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Pull requests/issues with no activity
Projects
None yet
Development

No branches or pull requests

2 participants