- 
                Notifications
    
You must be signed in to change notification settings  - Fork 2.1k
 
Description
What would you like to be added:
Add an option to tag metrics with kubernetes labels
Why is this needed:
The case I'm working on involves otel-collector scraping prometheus metrics from KSM and exporting them into the commercial backend. The thing is that commercial backend charges for metric cardinality, so reporting metrics with such labels as pod_name and then do joins would cost a lot.
One of the possibility to avoid this excessive costs is to shrink cardinality by aggregating before exporting metrics (well, with acceptable loosing of visibility of keeping data for each pod) and it looks very promising to have this labelling on KSM and then remove extra labels (like pod_name, uid, etc) on otel-collector's processor.
Describe the solution you'd like
Have a feature toggle similar to metric-allowlist which will not add labels to kube-pod-labels metrics, but add labels for related metric timeseries, like kube_pod_container_resource_requests
Additional context
Follow up for #1758