Skip to content

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

Description

@caseyandgina

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.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions