Hello all,

>From the docs (https://prometheus.io/docs/guides/dockerswarm/) you can 
easily use the Docker UNIX Socket like so:

  - job_name: 'docker'
    dockerswarm_sd_configs:
      - host: unix:///var/run/docker.sock

However I'm struggling to work with a Docker API that is exposed over HTTP 
with a custom port and path. For example:

  - job_name: 'docker'
    dockerswarm_sd_configs:
      - host: http://docker_proxy:8000/proxy

This doesn't work and results in a dns resolution failure.

I've also tried relabel_configs like:

  - job_name: 'docker'
    dockerswarm_sd_configs:
      - host: http://docker_proxy
        role: nodes
    relabel_configs:
      - source_labels: [__address__]
        regex: ".*"
        target_label: __address__
        replacement: $1:8000/proxy

But this doesn't work either, the error suggests that the port isn'g being 
used to connect to the Docker API at all, nor the path.

I must be doing something wrong, or using a custom port + path isn't 
supproted?

The reason btw I'm doing this is because the upstream prom/prometheus image 
(*rightfully so*) now runs as the "nobody" user making it quite difficult 
to bind-mount the Docker UNIX socket in a consistent way. So running a 
proxy that re-exposes it over HTTP and drops privileges seems to be the 
best approach here.

Kind regards

James

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/82c16918-b027-4e75-b2c3-910fe7b4037bn%40googlegroups.com.

Reply via email to