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

server misbehaving #507

Closed
gldhnchn opened this issue Sep 21, 2023 · 1 comment
Closed

server misbehaving #507

gldhnchn opened this issue Sep 21, 2023 · 1 comment

Comments

@gldhnchn
Copy link

Prometheus is reporting me:

Get "http://nginx_exporter:9113/metrics": dial tcp: lookup nginx_exporter on 127.0.0.11:53: server misbehaving

grafik

The stub status is delivered by the nginx config file:

server {
    listen 127.0.0.1:8085;
    server_name _;
    location /status {
        stub_status;
    }
}

Which is giving the output:

$ curl 127.0.0.1:8085/status
Active connections: 26 
server accepts handled requests
 2526 2526 4586 
Reading: 0 Writing: 13 Waiting: 13

The exporter is started in the same docker-compose.yaml like my prometheus instance with the following config:

  nginx_exporter:
    image: nginx/nginx-prometheus-exporter
    container_name: nginx_exporter
    network_mode: "host"
    command: "-nginx.scrape-uri=http://127.0.0.1:8085/status"
    restart: unless-stopped

The exporter is giving me the output:

$ curl 127.0.0.1:9113/metrics
# HELP nginx_connections_accepted Accepted client connections
# TYPE nginx_connections_accepted counter
nginx_connections_accepted 2615
# HELP nginx_connections_active Active client connections
# TYPE nginx_connections_active gauge
nginx_connections_active 26
# HELP nginx_connections_handled Handled client connections
# TYPE nginx_connections_handled counter
nginx_connections_handled 2615
# HELP nginx_connections_reading Connections where NGINX is reading the request header
# TYPE nginx_connections_reading gauge
nginx_connections_reading 0
# HELP nginx_connections_waiting Idle client connections
# TYPE nginx_connections_waiting gauge
nginx_connections_waiting 11
# HELP nginx_connections_writing Connections where NGINX is writing the response back to the client
# TYPE nginx_connections_writing gauge
nginx_connections_writing 15
# HELP nginx_http_requests_total Total http requests
# TYPE nginx_http_requests_total counter
nginx_http_requests_total 4743
# HELP nginx_up Status of the last metric scrape
# TYPE nginx_up gauge
nginx_up 1
# HELP nginxexporter_build_info Exporter build information
# TYPE nginxexporter_build_info gauge
nginxexporter_build_info{arch="linux/amd64",commit="e4a6810d4f0b776f7fde37fea1d84e4c7284b72a",date="2022-09-07T21:09:51Z",dirty="false",go="go1.19",version="0.11.0"} 1

I thought with this output, that it should be working, but prometheus is giving me the error from above.

The target in prometheus.yml is defined as

  - job_name: "nginx_metrics"
    scrape_interval: 15s
    scrape_timeout: 5s
    static_configs:
      - targets: ['nginx_exporter:9113']

Does somebody have an idea, what could be wrong here?

environment

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.3 LTS
Release:	22.04
Codename:	jammy
$ nginx -v
nginx version: nginx/1.18.0 (Ubuntu)
$ docker -v
Docker version 24.0.5, build 24.0.5-0ubuntu1~22.04.1

prometheus version:
grafik

@gldhnchn
Copy link
Author

Okay, looks like it is a network misconfiguration in my docker compose. So this is not a issue of the nginx exporter. I found a "solution" with a static ip. I'll have to figure it out. Thanks anyway!

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

1 participant