chop-dbhi / prometheus-sql

Service that exposes Prometheus metrics for a SQL result set.
BSD 2-Clause "Simplified" License
202 stars 55 forks source link

getting incorrect query results #53

Closed dsielert closed 4 years ago

dsielert commented 4 years ago

I cannot figure this out for the life of me all of the sudden one of my queries started returning seemingly random results

select count(*) as ct from batch_service.batch_record_status_history where batch_record_status in ('ERROR','PENDING_RETRY') AND entered_at >= current_timestamp - interval '1 minutes';

Query consistenly returns 0 when I check it . but prometheus-sql is returning

HELP query_result_batch_record_error Result of an SQL query
 # TYPE query_result_batch_record_error gauge
query_result_batch_record_error 7660
dsielert commented 4 years ago

user error.. postgres timestamp without timezone