flipt-io / flipt

Enterprise-ready, GitOps enabled, CloudNative feature management solution
https://flipt.io
GNU General Public License v3.0
3.54k stars 197 forks source link

[FLI-712] Epic: Flag Metrics in UI (Prometheus) #2500

Open markphelps opened 9 months ago

markphelps commented 9 months ago

Opening this up for community feedback/discussion/ideas/etc. Please feel free to comment 👇

Problem

Because of the distributed nature in which people can run Flipt (multiple instances for evaluation), we dont currently have a great solution for showing how 'live' a flag is (how often it is evaluated).

It would be great if we could show relatively how often a flag is queried, of if its even queried at all.

Potential Solution

One idea is to use something like sparklines to show this data on the Flag overview page

We could use a library like mux for this, which seems very good

Other than design of how this would look in the UI, we also need to determine where to get the data from.

One idea is to allow users to configure Flipt with read access to their prometheus (or similar) instances to query this data that Flipt already publishes.

For example, you can query the rate of a flag evaluation using the Prometheus API like:

http://localhost:9090/api/v1/query_range?query=rate(flipt_evaluations_requests_total%7Bflag%3D%22abdc%22,%20namespace%3D%22default%22%7D%5B1m%5D)&start=2023-12-04T17%3A47%3A46Z&end=2023-12-04T18%3A47%3A46Z&step=60

We could also potentially show a quick overview of 'live' flags on the flags list view with some indicator that data has been received recently.

Details

I'm opening this as an 'Epic' because it needs to be broken down more as there are several components involved, namely:

I think we could build this in a way that can extend beyond just Prometheus, for example if users use DataDog as their metrics dashboard and dont expose prometheus, then we could write a DataDog impl that queries the DataDog API

In order to accomplish this, we would need to come up with a common format to map the values to that we send to our UI.

From SyncLinear.com | FLI-712

erka commented 8 months ago

What about client Evaluation SDKs?

markphelps commented 8 months ago

What about client Evaluation SDKs?

Goood question @erka !

We would likely need to capture evaluation metrics client-side in the new SDKs and then batch send them somewhere on an interval.... the question is where though. I guess there's always the PushGateway.. but not sure how many people run that for Prometheus.

markphelps commented 7 months ago

I came up with a potential mockup screenshot of changes that could be made to the Flag Details page if we had this information

Untitled