OCI Cloud Native services come with seemingly integrated Monitoring service. But what if a bit older services, like API Platform CS, are used? There are a few approaches that can be utilized, depending on the metrics we are interesting in.
This repo showcases one of the approaches, based on the REST APIs exposed by the API Platform service. It's by no means the complete solution, just a demo to get a feel of a concept.
- Application checks the last polling time for the list of configured gateways
- If defined threshold is not met for any of them - email notification is sent to defined receipients
Please note that monitoring part of the solution can be deployed free of cost for many use cases:
- Compute Node - Oracle Free Tier can be utilized.
- Notification Service - first 1000 emails per month free. See this link for details.
-
Install and configure CLI
-
Download SDK for GO
-
Configure Notification Service:
- Create Topic. This can be done in the OCI Console or using CLI:
oci ons topic create --name <name of topic> --compartment-id <id of compartment>
- Create Subscritpion. This can be done in the OCI Console or using CLI:
oci ons subscription create --topic-id <id of created topic> --compartment-id <id of compartment> --protocol email --subscription-endpoint <address to which email is going to be sent>
- Clone the repository/download the code
- Create configuration file based on the template stored in
configuration/configuration_test.json
. All configuration parametes have to be specified. - Compile and run application:
./apics_monitoring -cf <configuration file>