Allow specifying additionalLabels sourced from pod labels
Is your feature request related to a problem? Please describe.
We would love to expose some pod metadata in the metrics reported by Retina pods, but we are limited to working with the (IP, port, direction, pod_name) set. Can we make it possible to specify any pod label name in additionalLabels to instruct Retina to populate that label as the metric label?
Describe the solution you'd like
For example, if my pod has a label importantData: 123 that I want to report alongside the pod name, I would add a customLabel_importantData entry under the additionalLabels key in the MetricsConfigurationCRD and will in return start receiving Prometheus metrics annotated with {importantData="123"} labels.
Describe alternatives you've considered N/A
Additional context Sometimes a pod name does not contain all information needed to attribute a time series to a source.
@rbtr Do you have any plans to deliver this feature in the near future? Can I contribute?
@ibezrukavyi can help triage here?
or @anubhabMajumdar
@SRodi Could you please triage and help @y0zg to contribute.
Hi @y0zg, I'm happy to assign this issue to you if you like to contribute! Retina’s current implementation stores all pod labels in metadata, but only exposes a fixed set of labels in metrics. Supporting this enhancement would require adding logic to the metrics collector to dynamically include user-specified pod label keys from additionalLabels in the CRD, fetching their values from the pod metadata, and annotating metrics accordingly.