You have to use "|" instead of "/".
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: custom-metrics-gmp-hpa
namespace: default
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: custom-metrics-gmp
minReplicas: 1
maxReplicas: 5
metrics:
- type: Pods
pods:
metric:
name: prometheus.googleapis.com|custom_prometheus|gauge
target:
type: AverageValue
averageValue: 20
Check the official docs example:
https://cloud.google.com/kubernetes-engine/docs/tutorials/autoscaling-metrics#custom-metric