Closed ghost closed 5 years ago
Hi @RomanSytnik the default value for returnData
is false, so for the first query that you have (elb_request_count_per_instance
), you will need to specify returnData: true
@chankh Thanks for the suggestion. In this case, I`m receiving zero as well.
Also I want to pay attention that I need to get the math "elb_external_request_count / elb_external_healthy_host_count"
but not the values of any separate two metrics.
you can leave the returnData
for the other queries as false
and only the one you wish to receive as true
kind: ExternalMetric
metadata:
name: elb-request-count-per-instance
spec:
name: elb-request-count-per-instance
resource:
resource: "deployment"
queries:
- id: elb_request_count_per_instance
expression: "elb_external_request_count / elb_external_healthy_host_count"
returnData: true
- id: elb_external_request_count
metricLabels: "elb_external_request_count"
metricStat:
metric:
namespace: "AWS/ELB"
metricName: "RequestCount"
dimensions:
- name: LoadBalancerName
value: "my-load-balancer"
period: 60
stat: Sum
unit: Count
returnData: false
- id: elb_external_healthy_host_count
metricStat:
metric:
namespace: "AWS/ELB"
metricName: "HealthyHostCount"
dimensions:
- name: LoadBalancerName
value: "my-load-balancer"
period: 60
stat: Average
unit: Count
returnData: false
I`ve also tried this suggestion as well. Unfortunately, the request returns 0.
{
"kind": "ExternalMetricValueList",
"apiVersion": "external.metrics.k8s.io/v1beta1",
"metadata": {
"selfLink": "/apis/external.metrics.k8s.io/v1beta1/namespaces/default/elb-request-count-per-instance"
},
"items": [
{
"metricName": "elb-request-count-per-instance",
"metricLabels": null,
"timestamp": "2019-08-12T12:05:15Z",
"value": "0"
}
]
}
Could it be related to the hardcoded first value which is not always first? https://github.com/awslabs/k8s-cloudwatch-adapter/blob/v0.4.0/pkg/provider/provider_external.go#L36
@chankh I`ve checked the PR https://github.com/awslabs/k8s-cloudwatch-adapter/pull/9 and as can I see it fixes this issue. When will it be merged?
@RomanSytnik PR #9 is merged, latest release is v0.6.0
@RomanSytnik does the latest release solve your issue?
@chankh yes, this issue is solved now. Thanks!
The following configuration returns 0 while each of metric returns valid values: