Skip to content
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

Merged
merged 4 commits into from
Oct 19, 2021
Merged

Conversation

cgrinds
Copy link
Collaborator

@cgrinds 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
Copy link
Contributor

@rahulguptajss rahulguptajss left a 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"`
Copy link
Contributor

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.
Copy link
Contributor

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?

Copy link
Collaborator Author

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

@@ -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 |
Copy link
Contributor

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?

@cgrinds cgrinds merged commit a0019c1 into main Oct 19, 2021
@cgrinds cgrinds deleted the cbg-register branch October 19, 2021 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants