The web section

The next step is to configure what address users are going to utilize to get to the Prometheus server. The --web.external-url flag sets this base URL so that weblinks generated both in the web user interface and in outgoing alerts link back to the Prometheus server or servers correctly. This might be the DNS name for a load balancer/reverse proxy, a Kubernetes service, or, in the simplest deployments, the publicly accessible, fully qualified domain name of the host running the server. For completeness, and as stated in the official documentation, a URL path can also be supplied here when Prometheus is behind some layer seven reverse proxy with content switching (also referred to as location-based switching or URL prefix routing).

The Prometheus server behaves as a conventional *nix daemon by reloading its configuration file (along with rules files) when it receives a SIGHUP. However, there are situations where sending this signal isn't convenient (for example, when running in a container orchestration system such as Kubernetes or using custom-built automation) or even impossible (when running Prometheus on Windows). In these situations, the --web.enable-lifecycle flag can be used to enable the /-/reload and /-/quit HTTP endpoints, which can be used to control, reload, and shut down, respectively. To prevent accidental triggering of these endpoints, and because a GET wouldn't be semantically correct, a POST request is needed. This flag is turned off by default as unfettered access to these endpoints pose a security concern.

Similarly, the --web.enable-admin-api flag is also turned off by default for the same reason. This flag enables HTTP endpoints that provide some advanced administration actions, such as creating snapshots of data, deleting time series, and cleaning tombstones.

As you may have noticed in Chapter 3, Setting Up a Test Environment, the official Prometheus tarballs also bring two additional directories, consoles and console_libraries. These are needed to enable the native dashboarding capabilities of Prometheus, which are often overlooked. These directories contain some preconfigured dashboards (referred to as consoles) and support template libraries, written in the Go templating language. Prometheus can be configured to load these by using the --web.console.templates and --web.console.libraries flags. After that, those dashboards will be available at the /consoles endpoint (a link will be available in the main web UI if an index.html file exists).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.128.129