mc-observability

FOSSA Status

This repository provides a Monitoring system of M-CMP.

A sub-system of M-CMP platform to deploy and manage Multi-Cloud Infrastructures.

Overview

System architecture

접기/펼치기 ```mermaid C4Context Enterprise_Boundary(boundary0, "M-CMP") { Person(customer0, "M-CMP User") Boundary(boundary1, "M-CMP Observability") { Container(container0, "M-CMP Observability Manager") Deployment_Node(deploy10, "Azure") { Deployment_Node(deploy11, "VM 1") { Container(container11, "M-CMP Observability Agent Manager") } Deployment_Node(deploy12, "VM 2") { Container(container12, "M-CMP Observability Agent") } Deployment_Node(deploy13, "VM 3") { Container(container13, "M-CMP Observability Agent") } ContainerDb(database11, "MariaDB") ContainerDb(database12, "InfluxDB") } Deployment_Node(deploy20, "AWS") { Deployment_Node(deploy21, "VM 1") { Container(container21, "M-CMP Observability Agent Manager") } Deployment_Node(deploy22, "VM 2") { Container(container22, "M-CMP Observability Agent") } Deployment_Node(deploy23, "VM 3") { Container(container23, "M-CMP Observability Agent") } ContainerDb(database21, "MariaDB") ContainerDb(database22, "InfluxDB") } Deployment_Node(deploy30, "Openstack") { Deployment_Node(deploy31, "VM 1") { Container(container31, "M-CMP Observability Agent Manager") } Deployment_Node(deploy32, "VM 2") { Container(container32, "M-CMP Observability Agent") } Deployment_Node(deploy33, "VM 3") { Container(container33, "M-CMP Observability Agent") } ContainerDb(database31, "MariaDB") ContainerDb(database32, "InfluxDB") } BiRel(container0, container11, "REST API") BiRel(container0, container21, "") BiRel(container0, container31, "") } } BiRel(customer0, container0, "REST API") UpdateRelStyle(customer0, container0, $offsetY="-50") UpdateRelStyle(container0, container11, $offsetY="-150") ``` ```mermaid C4Context Deployment_Node(deploy10, "Cloud Service Provider") { Deployment_Node(deploy11, "VM 1") { Container(container11, "M-CMP Observability Agent Manager") } Deployment_Node(deploy12, "VM 2") { Container(container12, "M-CMP Observability Agent") } Deployment_Node(deploy13, "VM 3") { Container(container13, "M-CMP Observability Agent") } ContainerDb(database11, "MariaDB", "Monitoring config Database") ContainerDb(database12, "InfluxDB", "Metrics Database") BiRel(container11, database11, "") BiRel(container12, database11, "") BiRel(container13, database11, "") Rel(database12, container11, "") Rel(container12, database12, "") Rel(container13, database12, "") } UpdateRelStyle(container11, database11, $lineColor="orange") UpdateRelStyle(container12, database11, $lineColor="orange") UpdateRelStyle(container13, database11, $lineColor="orange") UpdateRelStyle(database12, container11, $lineColor="green") UpdateRelStyle(container12, database12, $lineColor="green") UpdateRelStyle(container13, database12, $lineColor="green") ```

How to Use

Development environment

1. Install Docker to CSP’s VM

sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli docker-compose-plugin

2. Clone observability source to CSP’s VM

git clone https://github.com/m-cmp/mc-observability.git

3. Go to Java folder

cd mc-observability/java-module

4. set .env (edit .env) (Or skip this step for use defaults.)

cp .env.sample .env

5. Run docker services

sudo mkdir -p /docker/opensearch
sudo chown -R 1000:1000 /docker/opensearch
sudo docker compose up -d

6. Check network listen states

sudo ss -nltp | grep docker                                                                                                       12:03:20 PM
LISTEN 0      4096              0.0.0.0:1024       0.0.0.0:*    users:(("docker-proxy",pid=21828,fd=4))
LISTEN 0      4096              0.0.0.0:1324       0.0.0.0:*    users:(("docker-proxy",pid=18004,fd=4))
LISTEN 0      4096              0.0.0.0:1325       0.0.0.0:*    users:(("docker-proxy",pid=17943,fd=4))
LISTEN 0      4096              0.0.0.0:1323       0.0.0.0:*    users:(("docker-proxy",pid=18311,fd=4))
LISTEN 0      4096              0.0.0.0:3306       0.0.0.0:*    users:(("docker-proxy",pid=21737,fd=4))
LISTEN 0      4096              0.0.0.0:5601       0.0.0.0:*    users:(("docker-proxy",pid=22105,fd=4))
LISTEN 0      4096              0.0.0.0:8086       0.0.0.0:*    users:(("docker-proxy",pid=21771,fd=4))
LISTEN 0      4096              0.0.0.0:8082       0.0.0.0:*    users:(("docker-proxy",pid=21805,fd=4))
LISTEN 0      4096              0.0.0.0:8888       0.0.0.0:*    users:(("docker-proxy",pid=21951,fd=4))
LISTEN 0      4096              0.0.0.0:9200       0.0.0.0:*    users:(("docker-proxy",pid=22183,fd=4))
LISTEN 0      4096              0.0.0.0:9600       0.0.0.0:*    users:(("docker-proxy",pid=22160,fd=4))
LISTEN 0      4096              0.0.0.0:18080      0.0.0.0:*    users:(("docker-proxy",pid=21915,fd=4))
LISTEN 0      4096              0.0.0.0:18081      0.0.0.0:*    users:(("docker-proxy",pid=21863,fd=4))
LISTEN 0      4096                 [::]:1024          [::]:*    users:(("docker-proxy",pid=21834,fd=4))
LISTEN 0      4096                 [::]:1324          [::]:*    users:(("docker-proxy",pid=18012,fd=4))
LISTEN 0      4096                 [::]:1325          [::]:*    users:(("docker-proxy",pid=17950,fd=4))
LISTEN 0      4096                 [::]:1323          [::]:*    users:(("docker-proxy",pid=18322,fd=4))
LISTEN 0      4096                 [::]:3306          [::]:*    users:(("docker-proxy",pid=21745,fd=4))
LISTEN 0      4096                 [::]:5601          [::]:*    users:(("docker-proxy",pid=22111,fd=4))
LISTEN 0      4096                 [::]:8086          [::]:*    users:(("docker-proxy",pid=21778,fd=4))
LISTEN 0      4096                 [::]:8082          [::]:*    users:(("docker-proxy",pid=21812,fd=4))
LISTEN 0      4096                 [::]:8888          [::]:*    users:(("docker-proxy",pid=21959,fd=4))
LISTEN 0      4096                 [::]:9200          [::]:*    users:(("docker-proxy",pid=22189,fd=4))
LISTEN 0      4096                 [::]:9600          [::]:*    users:(("docker-proxy",pid=22167,fd=4))
LISTEN 0      4096                 [::]:18080         [::]:*    users:(("docker-proxy",pid=21922,fd=4))
LISTEN 0      4096                 [::]:18081         [::]:*    users:(("docker-proxy",pid=21873,fd=4))

7. Clone tumblebug source (Run on the same CSP’s VM)

git clone https://github.com/m-cmp/mc-observability.git
cd cb-tumblebug

8. Initialize tumblebug (Run on the same CSP’s VM)

Initialize CB-Tumblebug to configure Multi-Cloud info

9. Create namespace to tumblebug (Run on the same CSP’s VM)

curl -u default:default -X 'POST' \
  'http://127.0.0.1:1323/tumblebug/ns' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "description": "First namespace",
  "name": "ns01"
}'

10. Create MCI dynamically (Run on the same CSP’s VM)

curl -u default:default -X 'POST' \
  'http://127.0.0.1:1323/tumblebug/ns/ns01/mciDynamic' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "description": "Made in CB-TB",
  "installMonAgent": "no",
  "label": "DynamicVM",
  "name": "mci01",
  "systemLabel": "",
  "vm": [
    {
      "commonImage": "azure+koreacentral+ubuntu22.04",
      "commonSpec": "azure+koreacentral+standard_b4ls_v2",
      "connectionName": "azure-koreacentral",
      "description": "Description",
      "label": "DynamicVM",
      "name": "g1-1",
      "rootDiskSize": "default",
      "rootDiskType": "default",
      "subGroupSize": "3",
      "vmUserPassword": "string"
    }
  ]
}'

11. Register monitoring targets to observability manager (Run on any host)

curl --location 'observability_VM_PUBLIC_IP:18080/api/o11y/monitoring/ns01/mci01/target/g1-1-1' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--data '{
  "description": "vm1",
  "aliasName": "g1"
}'
curl --location 'observability_VM_PUBLIC_IP:18080/api/o11y/monitoring/ns01/mci01/target/g1-1-2' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--data '{
  "description": "vm2",
  "aliasName": "g2"
}'
curl --location 'observability_VM_PUBLIC_IP:18080/api/o11y/monitoring/ns01/mci01/target/g1-1-3' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--data '{
  "description": "vm3",
  "aliasName": "g3"
}'

12. Check registered monitoring targets from observability (Run on any host)

curl --location 'observability_VM_PUBLIC_IP:18080/api/o11y/monitoring/ns01/mci01/target' \
--header 'Accept: */*' | jq

13. Register tail monitoring item to the VM (Run on any host)

g1-1-1 example)

14. Register opensearch monitoring item to the VM (Run on any host)

g1-1-1 example)

15. Check registered OpenSearch servers

curl --location 'observability_VM_PUBLIC_IP:18080/api/o11y/monitoring/opensearch' \
--header 'Accept: */*' | jq

16. Check VM’s syslog (Run on any host)

g1-1-1 example)

curl --location 'observability_VM_PUBLIC_IP:18080/api/o11y/monitoring/opensearch/1/logs' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--data '{
  "range": "1d/d",
  "limit": "3"
}' | jq

17. Check VM’s monitoring data

g1-1-1 cpu_usage example)

curl --location 'observability_VM_PUBLIC_IP:18080/api/o11y/monitoring/ns01/mci01/target/g1-1-1/csp/cpu_usage' \
--header 'Accept: */*' | jq

Swagger Docs

v0.3.0 swagger api

API Use guide (swagger docs linked mermaid contents)

Observability Monitoring target setting guide

sequenceDiagram
participant M-CMP User
participant MC-O11y-Manager
participant MC-O11y-Agent-Manager
participant CB-Tumblebug
participant MariaDB
participant MC-O11y-Agent

Note over M-CMP User: run docker-image
M-CMP User ->> MC-O11y-Manager: Request install agent<br>param: nsId, targetId
MC-O11y-Manager ->> MC-O11y-Agent-Manager: Check installed target
alt Already install target?
  MC-O11y-Agent-Manager ->> MC-O11y-Manager: Response installed
  MC-O11y-Manager ->> M-CMP User: Response installed
else
  MC-O11y-Agent-Manager ->> CB-Tumblebug: Request target connection info
  CB-Tumblebug ->> MC-O11y-Agent-Manager: Response connection info
  MC-O11y-Agent-Manager ->> MC-O11y-Agent: Connect target
  MC-O11y-Agent-Manager ->> MC-O11y-Agent: Install agent
  MC-O11y-Agent ->> MariaDB: Regist managed target
  MC-O11y-Agent ->> MC-O11y-Agent-Manager: Installation complete
  MC-O11y-Agent-Manager ->> MC-O11y-Manager: Installation complete
  MC-O11y-Manager ->> M-CMP User: Installation complete
end

How to Contribute

License

FOSSA Status