Infra-Mon or Infrastructure Monitoring is a metric ingestion server. It records the cpu and memory percentage utilization against IP address of the client in-memory. It also generates the report with list of all the unique IP addresses/machines with it's highest CPU and memory utilization.
It exposes two endpoints
/metrics
- methods:
POST
- methods:
/report
- methods:
GET
- methods:
By default, this server serves on port 8080
, but can be configured on the basis of environment variable PORT
.
Running make
will automatically generate a Docker image. Dockerfile is multi-staged build and exposes the server at port 8080
Method: POST
Path: /metrics
Headers: content-type: application/json
Request Payload:
{
"percentage_cpu_used": 80,
"percentage_memory_used": 45
}
Method: GET
Path: /report
Headers: content-type: application/json
ResponsePayload:
[
{
"ip": "10.20.30.40",
"max_cpu": 65,
"max_memory": 85
},
{
"ip": "49.37.83.70",
"max_cpu": 71,
"max_memory": 90
}
]
Running the below command will start the local server at port 8080
go run main.go