laurentknauss / GC_metrics_in_Prometheus

Monitoring the metrics of the Garbage Collector of a basic http server via Prometheus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GC_metrics_in_Prometheus

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.

Features

  • 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).

Getting Started / Prerequisites

Go (version 1.x or later)
curl (for testing endpoints)
Monitoring tools : Prometheus and Grafana

Installation.

Clone the repository.
Run the server (go run gColl.go).
The server will start and listen on a predefined port (e.g., 8084).

Test the endpoints.

You can test the server's endpoints using curl. For example: curl http://localhost:8084

Monitor.

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 .

About

Monitoring the metrics of the Garbage Collector of a basic http server via Prometheus


Languages

Language:Go 97.0%Language:Shell 3.0%