Skip to content

postgres_exporter is stuck and do not log out #1135

Open
@wangshuai0709

Description

@wangshuai0709

postgres_exporter start command:
docker run --net=host -d --restart=always --name=postgres-exporter -e DATA_SOURCE_NAME="postgresql://postgres_exporter:admin123456@10.41.32.33:5432/phecda-cm?sslmode=disable" -v /tmp/default_pg_20240410.yaml:/tmp/default_pg_20240410.yaml repo.cicc.com.cn/public-docker-virtual/prometheuscommunity/postgres-exporter:v0.11.1 --extend.query-path=/tmp/default_pg_20240410.yaml

postgres_exporter log only print:
ts=2025-03-06T00:44:38.390Z caller=main.go:135 level=info msg="Listening on address" address=:9187
ts=2025-03-06T00:44:38.390Z caller=tls_config.go:195 level=info msg="TLS is disabled." http2=false

Activity

sysadmind

sysadmind commented on Mar 10, 2025

@sysadmind
Contributor

I'm not sure what the problem is that you are asking about. Can you clarify what you are asking?

wangshuai0709

wangshuai0709 commented on Mar 11, 2025

@wangshuai0709
Author

I'm not sure what the problem is that you are asking about. Can you clarify what you are asking?

my container`s log only has tow lines,it do not work

wangshuai0709

wangshuai0709 commented on Mar 11, 2025

@wangshuai0709
Author

my other container log is:
{"log":"ts=2024-04-11T07:24:23.880Z caller=main.go:135 level=info msg="Listening on address" address=:9187\n","stream":"stderr","time":"2024-04-11T07:24:23.880490707Z"}
{"log":"ts=2024-04-11T07:24:23.880Z caller=tls_config.go:195 level=info msg="TLS is disabled." http2=false\n","stream":"stderr","time":"2024-04-11T07:24:23.880647846Z"}
{"log":"ts=2024-04-11T07:25:05.283Z caller=server.go:74 level=info msg="Established new database connection" fingerprint=10.51.12.11:5432\n","stream":"stderr","time":"2024-04-11T07:25:05.283345176Z"}
{"log":"ts=2024-04-11T07:25:05.291Z caller=postgres_exporter.go:645 level=info msg="Semantic version changed" server=10.51.12.11:5432 from=0.0.0 to=13.4.0\n","stream":"stderr","time":"2024-04-11T07:25:05.291358683Z"}

This is the normal container.

sysadmind

sysadmind commented on Mar 16, 2025

@sysadmind
Contributor

It will only try to establish the connection if you try to scrape the metrics. Are you sure that you have something scraping the /metrics HTTP endpoint?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @sysadmind@wangshuai0709

        Issue actions

          postgres_exporter is stuck and do not log out · Issue #1135 · prometheus-community/postgres_exporter