ContainerSolutions / prometheus-swarm-discovery

This is a POC for Prometheus service discovery on Docker Swarm
76 stars 34 forks source link

Prometheus Native Docker Swarm integration #11

Closed roidelapluie closed 4 years ago

roidelapluie commented 4 years ago

Dear community

The coming prometheus release, Prometheus 2.20, contains native support for Docker Swarm.

Please try it and provide us with your feedback. This is highly appreciated.

https://prometheus.io/docs/prometheus/2.20/configuration/configuration/#dockerswarm_sd_config

amouat commented 4 years ago

Congrats on integrating native support!

This project was started a long-time ago and is no longer maintained. I'll add a deprecation notice and point people to the native support.

prologic commented 4 years ago

Hi, (hope I can ask this here, there are very example of this I can find :/)

I'm trying to get the following to work: https://gist.github.com/prologic/af36ce1b173081c9452759b7478215da#file-prometheus1-yml

And keep running into this error:

mon_prometheus.1.nr1vclob3amx@dm2.mills.io    | level=error ts=2020-08-28T06:23:29.044Z caller=refresh.go:98 component="discovery manager scrape" discovery=dockerswarm msg="Unable to refresh target groups" err="error while parsing address : invalid CIDR address: 

What I was hoping to be able to do is scrape by service names so I can have service names as the instance label. If I scrape tasks using dns_sd_config I'm pretty sure I can only get the IPv4 addresses of each task in the overlay network.

Hope someone can help :)

prologic commented 4 years ago

Just so we're clear:

$ docker exec  -t "$(docker ps | grep prometheus | awk '{ print $1 }')" /bin/sh -c 'nslookup -type=A twtxt_dev_twtd'
Server:     127.0.0.11
Address:    127.0.0.11:53

Non-authoritative answer:
Name:   twtxt_dev_twtd
Address: 10.0.2.228

(for example)

amouat commented 4 years ago

@prologic I'm sorry, I have no idea and the author of this repository left Container Solutions. You might have more luck on the prometheus slack or GitHub repo.

roidelapluie commented 4 years ago

That would be a bug for the prometheus repo

amouat commented 4 years ago

Thanks @roidelapluie. I'm archiving this project now and closing this issue. I'm a bit sad we never maintained it properly :(