Skip to content

[Question] Multiple Values UsageΒ #275

@bruhtus

Description

@bruhtus

Hello there,
I am new to prometheus exporter in general and trying to implement sql exporter with query that return multiple values.

I tried with this collector metrics:

collector_name: postgresql

metrics:
  - metric_name: participants_weekly
    type: gauge
    help: 'Total participants this week'
    value_label: 'participants'
    values:
      - weekly
      - total_participants
    query: |
      select
      date_trunc('week', to_timestamp(created_at/1000)) as weekly,
      count(*) as total_participants
      from participants
      where attendance_status ilike 'attended'
      group by weekly
      order by weekly desc
      limit 1;

and then when i run curl localhost:9399/metrics, the metrics does not appear. I also try adding another metrics but only the above metrics does not appear.

So i want to ask, how do we use value label? or to be precise, how do we use multiple values with sql exporter?
Thank you!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions