How can i fetch ALB tag details from the exporter metrics
akilandt opened this issue · 1 comments
Hi
I am looking for ways to fetch ALB tag details along with other metrics. i am able to fetch other required metrics. how can i fetch the tag details of ALB.
I used below format but the tags are fetched as a separate resource which is not what i needed.
- aws_namespace: AWS/ApplicationELB
aws_metric_name: TargetResponseTime
aws_dimensions: [TargetGroup,LoadBalancer]
aws_dimension_select:
LoadBalancer: [LoadbalancerName]
aws_tag_select:
tag_selections:
Tags: [required tag here]
resource_type_selection: elasticloadbalancing:loadbalancer
resource_id_dimension: LoadBalancerName
aws_statistics: [Average]
Tag details as seperate resource:
TYPE aws_resource_info gauge aws_resource_info{job="aws_applicationelb",instance="",arn="arndetails",target_group_name="",tag_Name="tagname",} 1.0
I want the tags to be fetched with below metrics details instead of fetching separately like mentioned above.
Example metrics:
# TYPE aws_applicationelb_target_response_time_average gauge
aws_applicationelb_target_response_time_average{job="aws_applicationelb",instance="",target_group="targetgroup",load_balancer="loadbalancer",} 0.008573922485207101
Unfortunately this is impractical to do in the exporter. Adding tags directly into the metrics means different metrics can and will have different label dimensions, which makes them difficult to handle generically. The aws_resource_info
metric is a solution that contains this problem to one metric.
Fortunately, you can combine these metrics at query time. See for example this article on how to do that. As a general design rule in Prometheus, we prefer this split and combination at query time, because it avoids a lot of complexity, both in query writing and client design.