Configure GAS for Prometheus
Although the Genero Application Server can provide metrics to Prometheus, it is disabled by default. You must enable metrics in the GAS configuration file.
The Genero Application Server supports Prometheus metrics from all proxies, Genero applications, and Genero web services started by the GAS via the Genero BDL Prometheus API and the dispatcher itself.
The Genero BDL Prometheus API works only via the GAS; it is not activated for direct connections.
You enable Prometheus in the GAS configuration file (as.xcf) by setting resources. Once enabled, metrics from Genero applications and services launched by this GAS are automatically enabled if the BDL Prometheus API is used in the code.
You can also override these resources from the command line when starting the dispatcher, without
editing as.xcf. For example: httpdispatch -E
res.prometheus.enabled=TRUE. For details, go to Override configuration resources.
Steps to configure the GAS for Prometheus
With the Prometheus feature enabled, the GAS opens an endpoint
for the Prometheus server to fetch all metrics. The metrics endpoint is in the form
http[s]://host:port/gas/metrics,
where "gas" specifies the connector.uri part of the URL provided by the GAS when
accessed through a web server (IIS, Apache, and so on). Applications running on standalone GAS
(httpdispatch) have no connector.uri in the URL; on a standalone dispatcher, the
endpoint is http://localhost:6394/metrics by default.
To confirm the GAS is producing metrics, you can open the endpoint in a browser. The response is the metric data in Prometheus text format. For a worked example with sample output, go to Prometheus Quick Start.
To restrict which hosts can reach the endpoint, you can use the ACCESS_CONTROL
element in the PROMETHEUS configuration. For details, go to ACCESS_CONTROL.
Ensure that access to http://localhost:6394/metrics is restricted to prevent
unauthorized scraping. For example, set the address the dispatcher
listens on with the LISTEN element, add a firewall rule, or
place the endpoint behind a reverse proxy with authentication or TLS.