omec-project / pcf

1 stars 16 forks source link

feat: expose metrics for prometheus to scrape #102

Closed gruyaume closed 4 months ago

gruyaume commented 4 months ago

Description

Here we expose a metrics endpoint for Prometheus to scrape the network function. Right now, we are only exposing the default Go metrics, allowing users to know whether the service is running or not in addition to valuable information (ex. memory usage, num. of goroutines, etc).

Screenshot

For example, we can now have a dashboard that tells us the status of the network function:

image

Implementation

We take the same approach to metrics as is done in the AMF, we create a metrics/telemetry.go file and we instantiate the server during the service startup.

Notes

If approved, we will make similar PR's in every network function.

Future Considerations

With this in place, it will be straightforward to add bespoke metrics to the network function.