-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[prometheus-to-sd] Allow adding a prefix/suffix to the metrics names #198
Comments
Have you tried to:
|
Hi Shun, |
Thanks for your response @kawych, and @loburm. I tried both. As additional information, I'm working with Horizontal Pod Autoscaler using custom metrics on GKE. In both ways, I couldn't accomplish my goal as Kubernetes doesn't accept slashes as a metric's name.
Am I wrong at some point? |
TLDR: the correct metric name to use with HPA in your case is This is explained here for autoscaling with External Metrics: https://cloud.google.com/kubernetes-engine/docs/tutorials/external-metrics-autoscaling#writing_external_metric_specification |
That's surprising. Thanks! I'm trying that. |
I've tried with Some more restrictions exist? |
Please make sure that you're using the newest image of Custom Metrics - Stackdriver Adapter. There used to be a limitation where you are not allowed to use '/' in the metric name. Also, please share
|
As you pointed, I was using an older image of the Adapter: As a context, detail of my environment is:
|
Custom metrics-based autoscaling just worked fine. But I'm not sure why an error occurred:
While applying the following YAML snippet (a part of the YAML: https://raw.githubusercontent.com/GoogleCloudPlatform/k8s-stackdriver/master/custom-metrics-stackdriver-adapter/deploy/production/adapter.yaml): ---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: external-metrics-reader
rules:
- apiGroups:
- "external.metrics.k8s.io"
resources:
- "*"
verbs:
- list
- get
- watch |
You may be missing a prerequisite to Custom Metrics - Stackdriver Adapter installation as described here: https://cloud.google.com/kubernetes-engine/docs/tutorials/custom-metrics-autoscaling#step1, i.e.
|
I had already completed the step. So the output of apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
creationTimestamp: 2018-08-23T06:46:49Z
name: cluster-admin-binding
resourceVersion: "67281612"
selfLink: /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/cluster-admin-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: User
name: my-email-address |
I'm seeing the same issue as well. The one difference is that if I use my own account everything works if I use a service account with the exact same permissions it does not.
Edit: |
This is a feature request. I'd like to add prefix or suffix to the scraped metrics' names. Since in a case when collecting metrics from some components whose names of metrics are difficult to change, I'd like to distinguish such metrics on Stackdriver; especially by the environment the metrics are collected (e.g., staging or production).
The text was updated successfully, but these errors were encountered: