Hi,
I am trying to set up postgresql as a remote storage for prometheus. I have the following configuration.
Looks like the data from scrapes is written to postgresql db. However, when I inserted data into the database, prometheus is not picking it up.
It seems to only show the data scraped. How can I enable remote read from the database?
thanks,
Imran
INSERT INTO metrics VALUES ('cpu_usage{service="nginx",host="machine1"} 34.6 1494595898000');
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Attach these labels to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
external_labels:
monitor: 'zodiac-external'
remote_write:
- url: "http://prometheus_postgresql_adapter:9201/write"
remote_read:
- url: "http://prometheus_postgresql_adapter:9201/read"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'zodiac'
honor_labels: true
scrape_interval: 5s
metrics_path: '/metrics'
static_configs:
- targets:
- 'docker.for.mac.localhost:9091'