Hyper Open Edge Cloud

How To Deploy Monitoring

How to deploy monitoring
  • Last Update:2021-06-08
  • Version:002
  • 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. Verify Monitoring Parameters
  2. Connect to Monitor APP

Verify Monitoring Parameters

To inspect the log of slapos node software:

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

To inspect the log of slapos node instance:

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

In slapos-node-instance.log, it happens that you are having an error about Invalid URL: 

slapos[41093] ERROR Promise 'monitor-http-frontend.py' failed with output: ERROR: Invalid URL '': No schema supplied. Perhaps you meant http://?

It is because that the instance is requesting a RapidSpace CDN to display the monitor. You have to wait untill the error is no longer present, meaning you  have your instance instanciated successfully. You can get the correct monitor-setup-url as soon as the frontend for your monitoring is responded. You can inspect slapos-node-instance.log to verify if the instance is ready. 

The parameters needed for accessing monitoring will be published. You can get the updated connection partameters by

$ cd ~/srv/project/slapos/software/html5as-base/
$ bash ../../../request-html5as-base.sh

You can then connect to the monitor App with monitor-setup-url from the connection parameters.

Connect to Monitor APP

You can connect to the monitor App with monitor-setup-url from the connection parameters.