Skip to content

[question] how to get a row count? #1

Description

@ketzacoatl

Hello!

I have setup your exporter with prometheus and postgres, and I can see basic metrics being exported using the config provided in the repo. However, when I go to write my own queries, I am not understanding how this is done. I started with a few simple examples:

  - name: "msg_count"
    help: "Number of messages in the posts table"
    values:
      - "msg_count"
    query: "SELECT COUNT(*) FROM posts;"
  - name: "connections"
    help: "Active Connections"
    values:
      - "connections_count"
    query: "SELECT sum(numbackends) FROM pg_stat_database;"

The logs look ok, and I can query prometheus for the stats, though they come back 0 (I can see correct values with psql, so I know 0 is wrong).

I assume that I don't have the config correct, but I haven't been able to figure out what I'm doing wrong.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions