File-based service discovery
Similar to the webhook notifier being the solution for integrating with unsupported notification systems (as explained in Chapter 11, Understanding and Extending Alertmanager), file-based integration provides the same type of solution for service discovery. It works by loading a list of valid JSON or YAML files, which in turn are used to generate the required targets and their labels. Reloading or restarting Prometheus after discovery files change is not necessary as they are watched for changes and automatically reread, depending on the operating system. Additionally, and as a fallback, the discovery files are also read on a schedule (every 5 minutes, by default).
The following JSON snippet shows a valid Prometheus ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access