Add Knative metrics to Prometheus
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:
When the user has Prometheus installed, but no data has been collected at the time:
Lastly, when the user has data:
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?
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
Security reports checked/validated by reviewer