Hyper Open Edge Cloud

How To Deploy Monitoring

How to deploy monitoring
  • Last Update:2021-03-15
  • Version:001
  • Language:en

Agenda

  • Prerequisite
  • Monitor Web Service
  • Deploy monitoring Web Service
  • Verification

Being able to access the status of all the promises in your instance without the need to access Rapid.Space panel or the local SlapOS master is the necesity.

This tutorial explains how to deploy the monitor web service inside the instances of your software release for remote monitoring.

Here is the commit introducing this functionality to html5as Software release: commit diff.

Prerequisites

  1. Read: Understanding SlapOS Promises
  2. Extend Monitor Stack
  3. Use Promises

Monitor App

Monitor app for a Service

In the monitor app that uses the monitor webservices to aggregate data, you can see the history of failing services.

Define Monitoring Portal

In instance_html5as.cfg.in, overwrite the default listening port for your monitoring service. To do, it needed to add a [monitor-instance-parameter] section in the instance profile and use the key monitor-httpd-port for the port. You can referer to the monitor README to get the full list of keys that can be customized.

# Use a port different from the default one in order to be able to
# use it in a SlapOS webrunner or a Theia SlapOS Runner
[monitor-instance-parameter]
monitor-httpd-port = 8197

Add dependency to Monitoring service

Use a macro extension to include the content of the publish section of the monitor service in the [publish-connection-information] section of instance_html5as.cfg.in.

[publish-connection-information]
...
# By extending monitor publish, all the section deploying monitoring will
# be deployed. The parameters needed for accessing monitoring will be published
<= monitor-publish
...

Update md5sums

Refer How To Move to md5sum automatic update to update md5sum:

$ cd ~/srv/project/slapos/software/html5as-base
$ ../../update-hash

Validation

  1. Inspect the logs
  2. verify port connection promise

Verify port connection promise

To inspect the log of slapos node software:

$ tail -fn 100  ~/srv/runner/var/log/slapos-node-software.log

To inspect the log of slapos node instance:

$ tail -fn 100  ~/srv/runner/var/log/slapos-node-instance.log

Observe the log of slapos node Instance. It now contains the promise info at the end:

2021-03-11 17:46:04 slapos[28239] INFO Checking slappart0 promises...
2021-03-11 17:46:04 slapos[28239] INFO Checking promise nginx-port-listening.py...
2021-03-11 17:46:04 nginx-port-listening.py[28239] INFO port connection OK (('2001:67c:1254:45:a9d5::dd2e', 8086))