Skip to content

Add Knative metrics to Prometheus

Chris Baumbauer requested to merge (removed):knative-prometheus into master

What does this MR do?

The initial work on the detailed view for the serverless page left out one requirement, and that was for a mechanism to display the number of invocations a given serverless function had experienced over a period of time. This MR attempts to address it by using a cluster's pre-installed Prometheus configuration to populate a graph highlighting the total number of calls for a given function in an environment over time. The query range covers 8 hours with each sample being made every 6 minutes or 0.1 hours.

In addition to adding support on the UI side, a new Prometheus query is introduced as well as support within the Prometheus Metrics library. The serverless function finder is modified as well to call the Prometheus Service to retrieve the data. Lastly, due to the nature of the current Prometheus Service, a new stub model is introduced to pass the serverless function and kubernetes namespace details to the prometheus query.

What the user will see in case they don't have Prometheus configured is: function-details-missing-raw

When the user has Prometheus installed, but no data has been collected at the time: function-details-no-data-raw

Lastly, when the user has data: function-details-raw

What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ce/issues/53404

https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/9959 - EE MR to resolve conflicts

Does this MR meet the acceptance criteria?

Edited by Chris Baumbauer

Merge request reports