COLLECTOR

This element specifies the address and port that the GAS UDP collector listens on.

Syntax

<COLLECTOR Address="listen_address" Port=port_number > </COLLECTOR>
  1. The Address attribute specifies the local address that the GAS UDP collector listens on. It is set by the resource $(res.prometheus.address). The default address is 127.0.0.1. Most installations do not need to change it, because the dispatcher and the proxies are on the GAS host. The address must belong to the GAS host. Otherwise the dispatcher does not start, and writes the following message to the daily log:
    "UDP Collector" Failed to bind server socket
  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 address and port that the GAS UDP collector listens on, so that the dispatcher and the proxies can send metric data to it.

Where Prometheus is enabled, each dispatcher (httpdispatch, isapidispatch, or fastcgidispatch) runs its own GAS UDP collector. The dispatcher and the proxies, UAProxy and GWSProxy, send metric data to the collector over UDP. The collector is part of the Genero Application Server (GAS) and always listens on an address of the GAS host, by default the loopback address 127.0.0.1 on port 8451. Adding a web server in front of the GAS, Apache for instance, does not change this. The web server carries the Prometheus request to the metrics endpoint and has no part in how the collector receives metric data.

Table 1. How metric data reaches the Prometheus server
Into the GAS UDP collector Out to the Prometheus server
Who connects The dispatcher, UAProxy, and GWSProxy The Prometheus server
Where The Address and Port of this element, by default 127.0.0.1 on port 8451 The GAS metrics endpoint
Protocol UDP HTTP
Access control None Set by ACCESS_CONTROL

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 GAS UDP collector listens for UDP messages from the dispatcher (httpdispatch, isapidispatch, or fastcgidispatch) as well as the proxies (UAProxy and GWSProxy). The collector manages various metrics, such as gauges, counters, and histograms, for these components, and formats a Prometheus response when the Prometheus server scrapes the GAS metrics endpoint.

  • Where you change the $(res.prometheus.address) resource in your GAS configuration file, set it to an address that belongs to the GAS host.
  • Ensure you update the $(res.prometheus.port) if you are not using the default port number 8451.
  • You can override these resources from the command line when starting the dispatcher, without editing as.xcf. For example: httpdispatch -E res.prometheus.port=8452. For details, go to Override configuration resources.
  • Verify that the Prometheus server is running and configured to scrape the GAS metrics endpoint. The Port attribute carries only metric data sent to the agent. The Prometheus server does not use that port. For the scrape configuration, go to Configure Prometheus to gather GAS metrics.

Parent elements

This element is a child of PROMETHEUS.