# Passing and creating metrics in Prometheus using Postgres queries

**URL:** <https://discuss.prometheus.io/t/passing-and-creating-metrics-in-prometheus-using-postgres-queries/260>\
**Category:** Exporters and Metrics\
**Created:** [May 22, 2021, 3:37pm UTC](https://discuss.prometheus.io/t/passing-and-creating-metrics-in-prometheus-using-postgres-queries/260 "2021-05-22T15:37:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![f1fan](https://avatars.discourse-cdn.com/v4/letter/f/ec9cab/32.png) [@f1fan](https://discuss.prometheus.io/u/f1fan)\
**Post date:** [May 22, 2021, 3:37pm UTC](https://discuss.prometheus.io/t/passing-and-creating-metrics-in-prometheus-using-postgres-queries/260/1 "2021-05-22T15:37:08Z")

</div>

HelloI want to create metrics which I got from Postgres db.So far the metrics appear in Prometheus using this [query-exporter](https://github.com/albertodonato/query-exporter)The problem is that both metrics are big integers in Postgres so the values which i`ve got are not the real ones for some reason…This is a code sample for my queries

`databases:`  
`db1:`  
`dsn: postgres://........`

`metrics:`  
`delay:`  
`type: histogram`  
`description: A sample gauge`  
`id:`  
`type: histogram`  
`description: A sample summaryqueries:`  
`query1:`  
`interval: 5s`  
`databases: [db1]`  
`metrics: [delay, id]`  
`sql: SELECT delay AS delay, id as id from table`

These are metrics got from prometheus

id\_bucket{container=“prom-postgres-monitor”, database=“db1”, endpoint=“http”, instance=“0.0.0.0:9560”, job=“prom-postgres-monitor”, le="+Inf", namespace=“dev”, pod=“prom-postgres-monitor-g3g43g34g3g”, service=“prom-postgres-monitor”} 6141id\_bucket{container=“prom-postgres-monitor”, database=“db1”, endpoint=“http”, instance=“0.0.0.0:9560”, job=“prom-postgres-monitor”, le=“0.005”, namespace=“dev”, pod=“prom-postgres-monitor-g3g43g34g3g”, service=“prom-postgres-monitor”} 0id\_bucket{container=“prom-postgres-monitor”, database=“db1”, endpoint=“http”, instance=“0.0.0.0:9560”, job=“prom-postgres-monitor”, le=“0.005”, namespace=“dev”, pod=“prom-postgres-monitor-g3g43g34g3g”, service=“prom-postgres-monitor”} 0id\_bucket{container=“prom-postgres-monitor”, database=“db1”, endpoint=“http”, instance=“0.0.0.0:9560”, job=“prom-postgres-monitor”, le=“0.005”, namespace=“dev”, pod=“prom-postgres-monitor-g3g43g34g3g”, service=“prom-postgres-monitor”} 0

Most of them are zeros but some real values which i have in postgres are - 10024958860, 10027398870, 10027401148 etc…

What metric option should i use to get some real data - enum, histogram, summary etc…

Also does it matter what is the data type which i have in postgres - for example as i said now is big integer and i`m not shure if Prometheus is ok with this values ?
