0
votes

I have fixed this file and run it https://github.com/timescale/prometheus-postgresql-adapter/blob/master/docker-compose.yml

The services started ok, but then I receive the errors:

prometheus_1 | ts=2020-08-27T12:55:50.967Z caller=dedupe.go:112 component=remote level=warn remote_name=686501 url=http://prometheus_postgresql_adapter:9201/write msg="Failed to send batch, retrying" err="Post "http://prometheus_postgresql_adapter:9201/write": dial tcp: lookup prometheus_postgresql_adapter on 127.0.0.11:53: no such host"

How to fix it?

There is my prometheus.yml

global:  
  scrape_interval:     10s  
  evaluation_interval: 10s

scrape_configs:
 - job_name: prometheus    
   static_configs:
     - targets: ['node_exporter:9100']

remote_write:
  - url: "http://prometheus_postgresql_adapter:9201/write" 
remote_read:
  - url: "http://prometheus_postgresql_adapter:9201/read"
1

1 Answers

0
votes

Using underscores in the service name of your docker-compose file causes trouble (underscore is not a valid character of a hostname).

Try changing the name of the service in your docker-compose file to prometheus-postgresql-adapter:

services:

...

  prometheus-postgresql-adapter:
    build:
      context: .
      ...

and then change the prometheus.yml config file to:

remote_write:
  - url: "http://prometheus-postgresql-adapter:9201/write" 
remote_read:
  - url: "http://prometheus-postgresql-adapter:9201/read"

to use the proper prometheus-postgresql-adapter hostname.