summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorChris Baumbauer <cab@cabnetworks.net>2019-04-06 02:02:39 +0000
committerMike Greiling <mike@pixelcog.com>2019-04-06 02:02:39 +0000
commitb77fe7db3e885edca14c862f362e2bbd43f0e498 (patch)
treecd984b8bb900a6b3e37c8f6106101ba8617bf524 /config
parent8e33e7cf474b61bbc684d993d86cb5aa775a01d0 (diff)
downloadgitlab-ce-b77fe7db3e885edca14c862f362e2bbd43f0e498.tar.gz
Add Knative metrics to Prometheus
Diffstat (limited to 'config')
-rw-r--r--config/prometheus/common_metrics.yml10
-rw-r--r--config/routes/project.rb6
2 files changed, 15 insertions, 1 deletions
diff --git a/config/prometheus/common_metrics.yml b/config/prometheus/common_metrics.yml
index 9bdaf1575e9..884868c6336 100644
--- a/config/prometheus/common_metrics.yml
+++ b/config/prometheus/common_metrics.yml
@@ -259,3 +259,13 @@
label: Pod average
unit: "cores"
track: canary
+ - title: "Knative function invocations"
+ y_label: "Invocations"
+ required_metrics:
+ - istio_revision_request_count
+ weight: 1
+ queries:
+ - id: system_metrics_knative_function_invocation_count
+ query_range: 'floor(sum(rate(istio_revision_request_count{destination_configuration="%{function_name}", destination_namespace="%{kube_namespace}"}[1m])*30))'
+ label: invocations / minute
+ unit: requests
diff --git a/config/routes/project.rb b/config/routes/project.rb
index 1cb8f331f6f..93d168fc595 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -252,7 +252,11 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
namespace :serverless do
- get '/functions/:environment_id/:id', to: 'functions#show'
+ scope :functions do
+ get '/:environment_id/:id', to: 'functions#show'
+ get '/:environment_id/:id/metrics', to: 'functions#metrics', as: :metrics
+ end
+
resources :functions, only: [:index]
end