retrieving metrics data from postgres via a client
Haybu opened this issue · 2 comments
I am using kubernetes, and I'm able to use the adapter just fine to write to postgres. In prometheus, all metrics are retrievable. I exposed my database service via a LoadBalancer type and connected to it using a client from my laptop. Connection is successful, and I can see the schema with all tables/view. However, all my "select' queries are coming with empty results.
I also try to connect from within the database pod (with username postgres and empty password), connection is fine, yet no data is retrievable via my select statement.
I am writing a simple select statement such as "select * form metrics fetch first 3 rows only".
Also, I have setup logging to true, yet no logging out for the metric messages written out.
containers:
- name: pg-adapter
image: timescale/prometheus-postgresql-adapter:master
args:
- "-pg-host=pgprometheus"
- "-pg-prometheus-log-samples=true"
Any suggestion or advise ?
it turns out to be the sequence in which I created the services in kubernetes. I needed first to create the DB service then the adapter service before creating the prometheus service, as I reference the DB adapter service name (DNS name) in the "writer" url inside prometheus configmap. No issue, everything works fine after I fix the sequence of how I created the services.