Monitoring the Garbage collection of a basic http server collected via Prometheus
This repository contains a simple Go web server application.
It demonstrates basic HTTP request handling in Go and includes features to monitor system metrics like garbage collection.
- Basic HTTP server implementation in Go.
- Endpoints for testing load and monitoring server responses.
- Integration examples for system metrics monitoring (garbage collection, memory usage, disk I/O).
Go (version 1.x or later)
curl (for testing endpoints)
Monitoring tools : Prometheus and Grafana
Clone the repository.
Run the server (go run gColl.go
).
The server will start and listen on a predefined port (e.g., 8084).
You can test the server's endpoints using curl. For example: curl http://localhost:8084
If you have set up Prometheus and Grafana, you can monitor the server's performance and system metrics.
The server exposes several endpoints for metrics collection.
Prometheus can natively collect various memory-related statistics, including those provided by the Go runtime.
The go_memstats_alloc_bytes
is one such native metric. It represents the current number of bytes allocated in the heap, which is updated at each GC cycle & is similar to `mem.Alloc' present in our Go codebase .