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

Can't get sql-exporter to try to connect to db at all #131

Open
caseyandgina opened this issue Jul 26, 2024 · 0 comments
Open

Can't get sql-exporter to try to connect to db at all #131

caseyandgina opened this issue Jul 26, 2024 · 0 comments

Comments

@caseyandgina
Copy link

I'm trying a very simple config:

global:
  scrape_timeout: 5s
  max_connections: 1
  max_idle_connections: 1

target:
  data_source_name: 'postgres://app_sql_exporter:testpw@localhost:5432/postgres'
  collectors: [simple_test]

collectors:
  - collector_name: simple_test
    metrics:
      - metric_name: simple_value
        type: gauge
        help: Simple test value.
        values:
          - simple_value
        query_ref: simple_query
    queries:
      - query_name: simple_query
        query: select 1 as simple_value

sql-exporter only produces a single line of output, and stays running:

{"build_context":"(go=go1.22.1, platform=linux/amd64, user=, date=, tags=unknown)","caller":"main.go:56","msg":"Starting sql_exporter","ts":"2024-07-26T17:30:33.315441745Z","version_info":"(version=, branch=, revision=unknown)"}
{"caller":"main.go:79","level":"info","listenAddress":":9237","msg":"Listening","ts":"2024-07-26T17:30:33.315676078Z"}

However, it never even tries to connect to the db - there's no connection attempts in the postgres log. Looking at the /metrics endpoint, there's no simple_value metric.

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