From 4e4016c382a0daf38e331e556e34518c233c2acd Mon Sep 17 00:00:00 2001 From: Karol Wychowaniec Date: Wed, 3 Jun 2020 12:50:01 +0200 Subject: [PATCH] Update Custom Metrics Adapter docs with more current information about metrics naming --- custom-metrics-stackdriver-adapter/README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/custom-metrics-stackdriver-adapter/README.md b/custom-metrics-stackdriver-adapter/README.md index fb182b70d..232c1401e 100644 --- a/custom-metrics-stackdriver-adapter/README.md +++ b/custom-metrics-stackdriver-adapter/README.md @@ -117,6 +117,15 @@ Metrics - Stackdriver Adapter: adapter exposes *rate* of the metric - the metric change per second computed over last 5 minutes. +#### Metric names + +Stackdriver metrics have a form of pahths separated by "/" character, but Custom +Metrics API forbids using "/" character. When using Custom Metrics - Stackdriver +Adapter either directly via Custom Metrics API or by specifying a custom metric +in HPA, replace "/" character with "|". For example, to use +`custom.googleapis.com/my/custom/metric`, specify +`custom.googleapis.com|my|custom|metric`. + ### Export custom metrics to Stackdriver To learn how to create your custom metric and write your data to Stackdriver, @@ -124,9 +133,6 @@ follow [Stackdriver custom metrics documentation]. You can also follow [Prometheus to Stackdriver documentation] to export metrics exposed by your pods in Prometheus format. -The name of your metric must start with custom.googleapis.com/ prefix followed -by a simple name, as defined in [custom metric naming rules]. - You will report your metric against a appropriate monitored resource for Kubernetes objects. To use **legacy resource model**, use monitored resource `gke_container`. To use **new resource model**, use one of monitored resources: `k8s_pod` or