feat: expose metrics for prometheus to scrape #164
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Do not merge: This still needs to be tested
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:
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.