kuzzleio / kuzzle

Open-source Back-end, self-hostable & ready to use - Real-time, storage, advanced search - Web, Apps, Mobile, IoT -
https://kuzzle.io
Apache License 2.0
1.44k stars 124 forks source link

Add metrics exposure to kuzzle core #2467

Closed kuzzle closed 11 months ago

kuzzle commented 1 year ago

Feature Description

Kuzzle is a backend. Each backend is intended to be deployed in scalable environments. These environments create a need for monitoring and metrology.

It is possible today to use Kuzzle with one of the technologies already implemented in the monitoring world:

https://github.com/kuzzleio/kuzzle-plugin-prometheus

But we want to push the approach even further.
So we decided to implement a native way in Kuzzle to monitor the backend and make it accessible for the most standard tools of today, but also to open the field for future implementations.

The first technologies to be made available will be:

https://prometheus.io/ and https://opentelemetry.io/

Example Use Case

When installing Kuzzle on a docker-compose or docker swarm, or even Kubernetes we need monitoring.

For some of our infrastructures, we need a native way (without plugin installation) to be able to perform these actions.

The tools we use are not always the classic prometheus \/ Grafana and for that we need a system that is extensible to use other tools and formats

Possible Solution (optional)

In the metrics controller there will be an onAsk that will aggregate information from the core

Add a categorisation level

Have a separation in the metrics

Allow users to add new metrics via the framework

Add a function that would format the metrics according to formats supported by Kuzzle.


Point of attention in the code

index.js level controller

In the funnel, import the controller

set the controller in the funnel

httpsRoutes -> add the new routes after the others

Spec OpenAPI → openapi\/component\/

Do the tests with Jest in api\/controller\/

kuzzle commented 1 year ago

Link to feature: https://kuzzle.productboard.com/feature-board/planning/features/20053272

rolljee commented 11 months ago

Followed on JIRA