Description
Is there an existing issue for this?
- I have searched the existing issues
Feature description
For AWS/ApplicationELB metrics, it would be useful to be able to discover tags that are associated to the target group, in order to export these as prometheus labels.
I believe the current logic will discover's tags that belong to the top level Loadbalancer object only, and will apply them to all the metrics including the ones with dimension target group, it does not attempt to lookup the target group specific tags. Potentially this is intentional as it could end up being quite heavy, or a more generic solution for dimension based tag discovery is required.
A use case where this would be particular useful is when using the AWS Load Balancer ingress controller for kubernetes:
Example use case for ingress objects:
The target group names that are created via the ingress controller are dynamically created and are abbreviated to ensure they are under the 32 character limit:
- Format:
k8s-<namespace>-<service>-<id>
namespace
andservice
will be truncated after 8 characters, e.g.mynamespace
andtestapplication
will become:k8s-mynamesp-testappl-5ec48ae0ab
So it is hard to use the name alone as a consistent format without some aggressive abbreviation when defining the naming. They do however have an AWS tag attached ingress.k8s.aws/resource
, which is of the unabbreviated format <namespace>/<ingress>-<service>:<port>
e.g. mynamespace/testapplication-ingress-testapplication:80
The Loadbalancer also has this tag, it is alaways set to ingress.k8s.aws/resource:Loadbalancer
I have tried adding the ingress.k8s.aws/resource
to exportedTagsOnMetrics
. However the target group specific metrics show the Loadbalancers label for this metric:
aws_applicationelb_target_response_time_average{dimension_TargetGroup="targetgroup/`k8s-mynamesp-testappl-5ec48ae0ab/475240e2c2f0644a", tag_ingress_k8s_aws_resource="LoadBalancer"} # <--- Loadbalancer tag is discovered
On a closer look, it seems it is not possible to obtain the labels of these metric dimensions that relate to a top level AWS resource, I think it could be useful to allow a way to discover these nested labels in some form, or produce info metrics for the target groups so they can be linked that way instead.
Has anyone else ever needed to do something similar?
Thanks!
What might the configuration look like?
No response
Anything else?
No response