-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamically add hosts #37
Comments
Currently on the command line. I have some ideas to add a yaml config with additional options per target. But it's only an idea at this point. |
@SuperQ @freedomwarrior May be this is a good solution: https://github.com/google/cloudprober |
+1 |
@cleonello care to take a shot at adding the feature? |
@SuperQ, Sorry didn't see your reply. I unfortunately don't know go. I found a reasonable work around (for my deployments) for this issue, however. I specify an environment configuration file where I define the hosts to scrape which is then read in by my systemd smokeping_prober service. I do have to restart the service when the config is updated but it is suitable for my purposes. For me to implement in production I still need to address issue #35. I need to add a custom label to my metrics in addition to IP address. We identify monitored equipment by unique ID's, not by IP address. |
Hi!
|
Would be great to have Consul support. |
@SuperQ what about adding hosts/config in a similar way as it is done in blackbox-exporter? This way the existing Prober mechanism from prometheus-operator could be re-used to include smokeping_prober as another type of prober. |
@paulfantom My current idea is something like this: targets:
- host: foo.example.com
network: ip4
protocol: icmp
labels:
name: Loadbalancer VIP1 DC1 v4
- host: foo.example.com
network: ip6
protocol: udp
labels:
name: Loadbalancer VIP1 DC1 v6
- host: 10.0.0.1
network: ip # Automatic ip4/ip6
# protocol: icmp # Defaults to ICMP Or maybe something like this: targets:
- hosts:
- foo.example.com
- bar.example.com
network: ip4
protocol: icmp
labels:
name: Loadbalancer VIP1 DC1 v4
- hosts:
- foo.example.com
network: ip6
protocol: udp
labels:
name: Loadbalancer VIP1 DC1 v6
- hosts:
- 10.0.0.1
network: ip # Automatic ip4/ip6
# protocol: icmp # Defaults to ICMP The blackbox-exporter takes the discovery from the Prometheus side via |
Not dynamically adding, but the first step to allow config from a file. Once that is done and available, I'll re-work the pinger goroutine management in order to start/stop pingers on the fly. |
One additional thought, on a reload/SIGHUP. I think the easiest / sanest behavior is that all pingers are stopped, and new ones are started. This would reset all counters to zero, even those that existed before. Please comment if you think this is ok/not ok. |
Dynamic hosts via a file (similar to file_sd in prometheus) would be great, that is:
Additional benefit of this format is that, for example it might be common to use Of course the tricky part is to persist the counter values for the existing targets, if the content of the file changes, but effectively the target has same options and target. Having breaks in counters, on file reload, would be not good, as many people might be updating these files continuously every few minutes. |
It's highly unlikely I will implement any kind of persistence. The most likely case is that the config reloader will be smart enough to not reset running probers that aren't changed. |
Yes, this is exactly what I meant. Not persist on disk, just not restart probers that did not change. I will take a look into code on weekend, and see if I can implement a prototype for this. |
Could we also have this integrate with some form of service-discovery? There's an example of |
Is it possible to add host from file like
hosts.yml
or something? Or only way is command args?The text was updated successfully, but these errors were encountered: