Installation – Prometheus

The ImageMaster Metrics Gateway for Prometheus requires a Prometheus installation. The newest version of Prometheus is available here: https://prometheus.io/download/.

The Prometheus monitoring software collects data. You can create a job in its configuration which will query data from the Metrics Gateway (the “language” which Prometheus understands). To do this download Prometheus and unpack it. You will find a file “prometheus.yml”. Adjust and insert the following lines to set up the job which will collect the data from the ImageMaster Metrics Gateway:

# These lines exist in prometheus.yml, this is a job which helps Prometheus monitor itself
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
      - targets: ['localhost:9090']

# these are the lines which should be added
	# Job which gets data from the ImaFSA metrics bridge. 
    - job_name: 'metrics_gateway'
			
    # Override the global default and scrape targets from this job
    # scrape_interval should be greater than scrape_timeout. 
    # scrape_timeout should be 2 or more seconds (doesn’t work with lower values)
    scrape_interval: 3s
    scrape_timeout: 2s

    static_configs:
      - targets: ['MetricsGatewayHostName:30100'] # update these values!!!
          node: 'some_node'

You can omit all the comments, which start with the hash symbol “#”.

Don’t forget to update the host name (MetricsGatewayHostName above) and the port (30100 above) according to the data stored in the configuration file of the Metrics Gateway. After all configurations are completed, start Prometheus just by double-clicking or using the following script (Windows version):

@echo off
c:
cd C:\prometheus-path\
prometheus.exe --web.enable-lifecycle
pause

The pause command at the end or an execution from the command line (cmd.exe) will help to see any error messages in case of a failure.

The flag “web.enable-lifecycle” enables the change of a Prometheus configuration without a reboot. It is not necessarily needed but may be handy when experimenting with various scrape interval values to find the most suitable one.

To force Prometheus to update its configuration once “prometheus.yml” was changed, you need to send an HTTP POST request to “http://localhost:9090/-/reload”. This can be done, for example, using the Postman application.