COLLECTOR

This element specifies the address of the Prometheus server and listening port of the GAS UDP agent.

Syntax

<COLLECTOR Address="prometheus_server" Port=port_number > </COLLECTOR>
  1. The Address attribute specifies the URL of the Prometheus server. It is set by the resource $(res.prometheus.address). The default address is 127.0.0.1.
  2. The Port attribute sets the listening port for collecting metric data sent by applications running in the GAS. It is set by the resource $(res.prometheus.port). The default port is 8451.

Child elements

There are no child elements.

Usage

You use the COLLECTOR element to configure the connection details for the Prometheus server, allowing your applications to send metric data for monitoring.

Usage example

<COLLECTOR Address="$(res.prometheus.address)" Port="$(res.prometheus.port)" />

In this example, the address and port are dynamically set based on the resources defined in your GAS configuration file (as.xcf). The port connects to the Genero UDP agent provided in the GAS, which listens for UDP messages from the dispatcher (httpdispatch, isapidispatch, or fastcgidispatch) as well as the proxies (UAProxy and GWSProxy). This agent manages various metrics, such as gauges, counters, and histograms, for these components and formats a Prometheus response when it receives a request from the Prometheus server at the specified address.

  • Ensure you update the $(res.prometheus.address) resource in your GAS configuration file to reflect the correct Prometheus server address.
  • Ensure you update the $(res.prometheus.port) if you are not using the default port number 8451.
  • Verify that the Prometheus server is running and configured to accept connections on the specified address and port to ensure successful metric collection.

Parent elements

This element is a child of PROMETHEUS.