-
Notifications
You must be signed in to change notification settings - Fork 97
Doesn't work with multi-dimensions metrics #11
Comments
Just to endorse it, I get the same result here. My apiVersion: metrics.aws/v1alpha1
kind: ExternalMetric
metadata:
name: aws-mq-propileu-destination-externalmetric
namespace: production
spec:
name: aws-mq-propileu-destination-externalmetric
resource:
resource: deployment
queries:
- id: "mq_1_propileu_destination_length"
metricStat:
metric:
dimensions:
- name: "Broker"
value: "jsm-amq-prd2-1"
- name: "Queue"
value: "propileu-destination"
metricName: "QueueSize"
namespace: "AWS/AmazonMQ"
period: 60
stat: Sum
unit: Count
returnData: true
- id: "mq_2_propileu_destination_length"
metricStat:
metric:
dimensions:
- name: "Broker"
value: "jsm-amq-prd2-2"
- name: "Queue"
value: "propileu-destination"
metricName: "QueueSize"
namespace: "AWS/AmazonMQ"
period: 60
stat: Sum
unit: Count
returnData: true And the HPA: kind: HorizontalPodAutoscaler
apiVersion: autoscaling/v2beta1
metadata:
name: propileu-pubsub-consumer-hpa
namespace: production
spec:
scaleTargetRef:
apiVersion: apps/v1beta1
kind: Deployment
name: propileu-from-tower-consumer-deployment
minReplicas: 1
maxReplicas: 100
metrics:
- type: External
external:
metricName: aws-mq-propileu-destination-externalmetric
targetValue: 1 When I do If I configured a setup with SQS, like the sample usage, it works properly. |
Pull requests are welcomed. |
@chankh Can you take look at the PR. |
@chankh Tested .7.0 Didn't work The HPA
it shows this |
@rahulttn Metrics Statistics API
Can you try using the unit as "Percent" instead of "Count" (unit: Count) or remove it entirely (GetMetricStatistics API will be used to get the Unit). Below are my test files
kubectl get hpa/httpd-cpu -w
|
@arunbhagyanath yeah, removing the unit makes it work, value seems to be percent. this works for cpu , memory etc but ContainerInsights provides pod based metrics like network tx or service based, those metrics would be useful as count imo . If the value could be get as count, that would be great. |
Now it's working 100% as expected for me! Thank you the one who applied #14! |
Hi there,
On CloudWatch we had a metric named
queuedepth
with dimensionsenv
,app
andqueue
on the namespaceSidekiq
.env
described the environment likestaging
,production
anddevelopment
.app
have the application name. Andqueue
the queue from which this data came from. We have a Lambda that we use to gather the data and send it to CloudWatch.If we try to use this metric as an
ExternalMetric
, as in the example below, it doesn't work.If we
kubectl logs -f
the cloudwatch adapter pod we can see that it cannot find the metric :/To make it work, we had to change our Lambda to create another metric (
depth
) with a single dimension (queue
).And, as soon as we applied this new configuration, the metrics were fetched and the HPA began scaling immediately.
Is this expected? As we had
dimensions
in plural and accepting a list, we thought that we could use multi-dimension metrics. Also, we realized that in all the examples only single-dimension metrics are being used.Our cluster is on EKS
1.14
and usingchankh/k8s-cloudwatch-adapter:v0.6.0
.Thanks
The text was updated successfully, but these errors were encountered: