I'm searching for some monitor & alert solutions for my services. I found following nice related works.
Both works use dns service discovery to monitor multiple replicas of services.
I've tried to replay these work, but I found I can only get single backend container ip.
# dig A node-exporter
; <<>> DiG 9.10.4-P8 <<>> A node-exporter
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18749
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;node-exporter. IN A
;; ANSWER SECTION:
node-exporter. 600 IN A 10.0.0.42
;; Query time: 0 msec
;; SERVER: 127.0.0.11#53(127.0.0.11)
;; WHEN: Mon Jan 29 02:57:51 UTC 2018
;; MSG SIZE rcvd: 60
When I inspect the service, I found the endpoint mode of node-exporter is vip.
> docker inspect 242pn4obqsly
...
"Endpoint": {
"Spec": {
"Mode": "vip"
},
"VirtualIPs": [
{
"NetworkID": "61fn8hmgwg0n7rhg49ju2fdld",
"Addr": "10.0.0.3/24"
}
]
...
This means when contact with dns, prometheus can only get a single delegate service ip. Then the inner lbs strategy will route the income request to different backend instances.
Then how does the related works succeeded?
Thx!