-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat: add a Prometheus HTTP service discovery end-point #575
Conversation
cgrinds
commented
Oct 17, 2021
- add documentation for HTTP SD
- updated harvest.yml with admin node info
- simplified some of the config code by removing pointers - also less code and easier to read
- removed a node-based getter that didn't merge correctly if called out of order
- removed some cmd.Exec code that is replacable with gopsutil
- feat: add admin start
- feat: add poller heartbeat and expiration
- feat: add TLS
- feat: add admin tls create certs
- refactor: clean-up conf
- add documentation for HTTP SD - updated harvest.yml with admin node info - simplified some of the config code by removing pointers - also less code and easier to read - removed a node-based getter that didn't merge correctly if called out of order - removed some cmd.Exec code that is replacable with gopsutil - feat: add admin start - feat: add poller heartbeat and expiration - feat: add TLS - feat: add admin tls create certs - refactor: clean-up conf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great!
Consul *Consul `yaml:"consul,omitempty"` | ||
|
||
// Prometheus specific | ||
HeartBeatUrl string `yaml:"heart_beat_url,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this field in documentation?
|
||
HTTP service discovery is the more flexible of the two. It is also less error-prone, and easier to manage. Combined with the port_range configuration described above, SD is the least effort to configure Prometheus and the easiest way to keep both Harvest and Prometheus in sync. | ||
|
||
**NOTE** HTTP service discovery does not work with Docker yet. With Docker, you will need to list each poller individually or if possible, use the [Docker Compose](https://github.com/NetApp/harvest/tree/main/docker) workflow that uses file service discovery to achieve a similar ease-of-use as HTTP service discovery. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docker would work now right with new approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will, but requires some changes since the docker image, at the moment, only runs bin/poller
cmd/exporters/prometheus/README.md
Outdated
@@ -39,7 +34,7 @@ An overview of all parameters: | |||
| `allow_addrs_regex` | list of strings, optional | allow access only if host address matches at least one of the regular expressions | | | |||
| `cache_max_keep` | string (Go duration format), optional | maximum amount of time metrics are cached (in case Prometheus does not timely collect the metrics) | `180s` | | |||
| `add_meta_tags` | bool, optional | add `HELP` and `TYPE` [metatags](https://prometheus.io/docs/instrumenting/exposition_formats/#comments-help-text-and-type-information) to metrics (currently no useful information, but required by some tools) | `false` | | |||
|
|||
| `heart_beat_url | string, optional only used with [httpsd](#prometheus-http-service-discovery) | end-point used to PUT exporter name and ip address | https://127.0.0.1:8887/api/v1/sd when TLS is enabled, http:// otherwise | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it needed when port/address is already defined under admin?