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

Metric URL not accessable #732

Open
phionachao opened this issue Dec 9, 2022 · 2 comments
Open

Metric URL not accessable #732

phionachao opened this issue Dec 9, 2022 · 2 comments

Comments

@phionachao
Copy link

What did you do?
Installed Postgres_Exporter with 9187 but not accessible

What did you expect to see?
expected to see metric from URL
What did you see instead? Under which circumstances?
unreachable

Environment

  • System information:

    insert output of uname -srm here
    Linux 4.18.0-372.19.1.el8_6.x86_64 x86_64

  • postgres_exporter version:

    insert output of postgres_exporter --version here 0.11.1

  • postgres_exporter flags:

insert list of flags used here
  • PostgreSQL version:

    insert PostgreSQL version here 14

  • Logs:

insert logs relevant to the issue here
@zeusng-fast
Copy link

Running Postgres Exporter against 2 x instances in a Kubernetes Statefulset.

We experience the same issue. Our initial tests indicate that.

  1. If postgres_exporter is pointing to multiple postgres instances (e.g. postgresql://postgres:[email protected]/postgres,postgresql://postgres:[email protected]/postgres) this problem will occur
  2. If postgres_exporter is pointing to only one instance, there is no problem.

The same connection url with multiple instances works in release v0.10.x and below.

sh-4.4$ curl -v http://10.129.5.188:9187/metrics

  • Trying 10.129.5.188...
  • TCP_NODELAY set
  • Connected to 10.129.5.188 (10.129.5.188) port 9187 (#0)

GET /metrics HTTP/1.1
Host: 10.129.5.188:9187
User-Agent: curl/7.61.1
Accept: /

< HTTP/1.1 500 Internal Server Error
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Thu, 15 Dec 2022 03:02:40 GMT
< Content-Length: 785
<
An error has occurred while serving metrics:

4 error(s) occurred:

  • collected metric "pg_scrape_collector_duration_seconds" { label:<name:"collector" value:"bgwriter" > gauge:<value:0.065998482 > } was collected before with the same name and label values
  • collected metric "pg_scrape_collector_success" { label:<name:"collector" value:"bgwriter" > gauge:<value:1 > } was collected before with the same name and label values
  • collected metric "pg_scrape_collector_duration_seconds" { label:<name:"collector" value:"database" > gauge:<value:0.092288993 > } was collected before with the same name and label values
  • collected metric "pg_scrape_collector_success" { label:<name:"collector" value:"database" > gauge:<value:1 > } was collected before with the same name and label values
  • Connection #0 to host 10.129.5.188 left intact

Similar problem is affecting pgbouncer exporter as well. prometheus-community/pgbouncer_exporter#47

Wonder if this is a problem with the Prometheus library or the new connector implementation in general.

@phionachao
Copy link
Author

Running Postgres Exporter against 2 x instances in a Kubernetes Statefulset.

We experience the same issue. Our initial tests indicate that.

  1. If postgres_exporter is pointing to multiple postgres instances (e.g. postgresql://postgres:[email protected]/postgres,postgresql://postgres:[email protected]/postgres) this problem will occur
  2. If postgres_exporter is pointing to only one instance, there is no problem.

The same connection url with multiple instances works in release v0.10.x and below.

sh-4.4$ curl -v http://10.129.5.188:9187/metrics

  • Trying 10.129.5.188...
  • TCP_NODELAY set
  • Connected to 10.129.5.188 (10.129.5.188) port 9187 (#0)

GET /metrics HTTP/1.1
Host: 10.129.5.188:9187
User-Agent: curl/7.61.1
Accept: /

< HTTP/1.1 500 Internal Server Error < Content-Type: text/plain; charset=utf-8 < X-Content-Type-Options: nosniff < Date: Thu, 15 Dec 2022 03:02:40 GMT < Content-Length: 785 < An error has occurred while serving metrics:

4 error(s) occurred:

  • collected metric "pg_scrape_collector_duration_seconds" { label:<name:"collector" value:"bgwriter" > gauge:<value:0.065998482 > } was collected before with the same name and label values
  • collected metric "pg_scrape_collector_success" { label:<name:"collector" value:"bgwriter" > gauge:<value:1 > } was collected before with the same name and label values
  • collected metric "pg_scrape_collector_duration_seconds" { label:<name:"collector" value:"database" > gauge:<value:0.092288993 > } was collected before with the same name and label values
  • collected metric "pg_scrape_collector_success" { label:<name:"collector" value:"database" > gauge:<value:1 > } was collected before with the same name and label values
  • Connection #0 to host 10.129.5.188 left intact

Similar problem is affecting pgbouncer exporter as well. prometheus-community/pgbouncer_exporter#47

Wonder if this is a problem with the Prometheus library or the new connector implementation in general.

I'm just trying to get the metrics from single postgres instance, while i tried to startup the postgres_exporter below the collector cannot be created

"ts=2022-12-29T09:39:40.145Z caller=main.go:124 level=error msg="Failed to create PostgresCollector" err="malformed dsn """"

Just wondering if there is any where i have missed

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