Skip to content

Commit

Permalink
Add prometheus annotation to tf serving service (kubeflow#1958)
Browse files Browse the repository at this point in the history
  • Loading branch information
lluunn authored and k8s-ci-robot committed Nov 15, 2018
1 parent f725807 commit 2ea26eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions kubeflow/tf-serving/prototypes/tf-serving-service.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// @optionalParam modelName string null The model name
// @optionalParam trafficRule string v1:100 The traffic rule, in the format of version:percentage,version:percentage,..
// @optionalParam injectIstio string false Whether to inject istio sidecar; should be true or false.
// @optionalParam enablePrometheus string true Whether to enable prometheus endpoint (requires TF 1.11)

local k = import "k.libsonnet";
local tfservingService = import "kubeflow/tf-serving/tf-serving-service-template.libsonnet";
Expand Down
6 changes: 5 additions & 1 deletion kubeflow/tf-serving/tf-serving-service-template.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@
"method: GET",
"service: " + name + "." + namespace + ":8500",
]),
}, //annotations
} + if util.toBool(params.enablePrometheus) then {
"prometheus.io/scrape": "true",
"prometheus.io/path": "/monitoring/prometheus/metrics",
"prometheus.io/port": "8500",
} else {}, //annotations
},
spec: {
ports: [
Expand Down

0 comments on commit 2ea26eb

Please sign in to comment.