Prometheus Quick Start
Follow these steps to quickly set up Prometheus monitoring for Genero Application Server (GAS).
-
Download and install Prometheus.
Download the latest release from the Prometheus website (external link). Extract the archive and follow the installation instructions for your operating system.
For more details about Prometheus integration, see Monitoring the GAS with Prometheus.
-
Enable Prometheus in GAS.
Update the GAS configuration file (as.xcf).
Set
res.prometheus.enabledtoTRUE(case sensitive).After configuration, GAS exposes metrics at the endpoint http://localhost:6394/metrics.Need something other than the default? Go to Configure GAS for Prometheus.
-
Configure Prometheus to scrape GAS metrics.
Navigate to your Prometheus installation directory and edit the prometheus.yml file to add a scrape configuration for the GAS:
# ... scrape_configs: - job_name: "gas" metrics_path: "/metrics" static_configs: - targets: ["localhost:6394"] # ...Adjust
metrics_pathandtargetsas needed for your environment. For HTTPS, setschemeto "https" and configuretls_configas required.For more details, see Configure Prometheus to gather GAS metrics.
-
Start Prometheus locally.
For more details, see Prometheus website—getting started (external link).
- Open the command line interface and navigate to the Prometheus directory.
-
Start Prometheus by typing:
prometheus --config.file=prometheus.yml
Prometheus will start and listen on port 9090 by default.
-
Start the Genero Application Server and open the demos application.
For information about the demo applications, see The demo applications.
- Open a command line interface and navigate to the GAS installation directory.
-
Start the standalone dispatcher by typing:
httpdispatch -
Open your browser and go to
http://localhost:6394/demos.htmlto access the GAS welcome page. -
Click the Genero demos link, or enter
http://localhost:6394/ua/r/demoto launch the demos application.
-
Open a browser tab and go to
http://localhost:6394/metricsto view the metrics collected by the GAS for Prometheus.Warning:Ensure that access to
http://localhost:6394/metricsis restricted to prevent unauthorized scraping. For example, bind the service to localhost, use a firewall rule, or place the endpoint behind a reverse proxy with authentication or TLS.The endpoint returns metrics in Prometheus format. This is a snippet of Prometheus text-format metric output. It contains metric metadata lines and samples. For example:fourjs_gas_dvm_started_count— represents the built-in metric that measures the number of DVMs started.- A sample with value
0means no DVMs started for that application/service at scrape time; a sample with value4means four DVMs started for that application.
# TYPE fourjs_gas_dvm_started_count gauge fourjs_gas_dvm_started_count{url="/ws/r",service="services/OpenIDConnectServiceProvider"} 0 fourjs_gas_dvm_started_count{url="/ua/r",application="admin/ConsoleApp"} 1 fourjs_gas_dvm_started_count{url="/ws/r",service="admin/GeneroProfileService"} 0 fourjs_gas_dvm_started_count{url="/ua/r",application="demo"} 4 fourjs_gas_dvm_started_count{url="/ws/r",service="services/GeneroAccessService"} 0 fourjs_gas_dvm_started_count{url="/ws/r",service="services/GeneroIdentityProvider"} 0 # HELP udp_collector_rq_count UDP Collector request countCheck for metrics and labels to find the series relevant to your app or endpoint — for a full list of built‑in Genero metrics, go to Supported metrics. For an introduction to how metrics work, go to Understanding metrics.
To make monitoring easier, we recommend viewing Prometheus metrics in graph form — a visualization tool like Grafana can provide this. For examples using Grafana with GAS metrics, go to Using Grafana with Prometheus metrics. For details of working with Grafana, refer to Grafana documentation (external link).