Skip to end of metadata
Go to start of metadata

Prometheus is the open source monitoring system and time series database. WCS supports Prometheus metric format since build 5.2.416, no WCS setup is needed to integrate with Prometheus monitoring.

WCS metrics collection 

To set up Prometheus to collect WCS metrics, the following scrape configuration should be described in prometheus.yml

scrape_configs:
  - job_name: 'flashphoner'
    metrics_path: '/'
    params:
      action: [stat]
      format: [prometheus]
    static_configs:
      - targets: ['WCS_address:8081']

Where

  • WCS_address - WCS server address
  • 8081 - WCS server port to request metrics

As a result, Prometheus should form the following query

http://WCS_address:8081/?action=stat&format=prometheus

and receive WCS statistics metrics in its format.

Since build 5.2.518, metrics of published streams can be requested by the following query

http://WCS_address:8081/?action=stat&format=prometheus&groups=publish_streams

Server instance metrics collection

Server instance on which WCS is installed operating system metrics can be collected to Prometheus using Prometheus Node Exporter module. To install the module, use the following script

Prometheus Node Exporter install script
#!/bin/bash
wget https://github.com/prometheus/node_exporter/releases/download/v1.0.1/node_exporter-1.0.1.linux-amd64.tar.gz
tar zxvf node_exporter-*.linux-amd64.tar.gz
cd node_exporter-*.linux-amd64
cp node_exporter /usr/local/bin/
sudo useradd --no-create-home --shell /bin/false nodeusr
sudo chown -R nodeusr:nodeusr /usr/local/bin/node_exporter

echo "[Unit]" >> /etc/systemd/system/node_exporter.service
echo "Description=Node Exporter Service ">> /etc/systemd/system/node_exporter.service
echo "After=network.target" >> /etc/systemd/system/node_exporter.service
echo "" >> /etc/systemd/system/node_exporter.service
echo "[Service]" >> /etc/systemd/system/node_exporter.service
echo "User=nodeusr" >> /etc/systemd/system/node_exporter.service
echo "Group=nodeusr" >> /etc/systemd/system/node_exporter.service
echo "Type=simple" >> /etc/systemd/system/node_exporter.service
echo "ExecStart=/usr/local/bin/node_exporter" >> /etc/systemd/system/node_exporter.service
echo "ExecReload=/bin/kill -HUP $MAINPID" >> /etc/systemd/system/node_exporter.service
echo "Restart=on-failure ">> /etc/systemd/system/node_exporter.service
echo "">> /etc/systemd/system/node_exporter.service
echo "[Install]" >> /etc/systemd/system/node_exporter.service
echo "WantedBy=multi-user.target ">> /etc/systemd/system/node_exporter.service
sudo systemctl daemon-reload
sudo systemctl enable node_exporter
sudo systemctl start node_exporter