You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
None of the examples or documentation beyond the API reference demonstrate how to scrape the pod labels as metric labels. This makes it harder than necessary to get going.
For my future reference, and the reference of anyone else:
Specify from as the name of the pod label you wish to have added to the metric labels. You may also need to specify to to provide the name the label should be on the metric - this is necessary if the pod label is not compatible with the metric labels (e.g contains characters such as /)
The text was updated successfully, but these errors were encountered:
Thanks! Some of it is explained in field comment (e.g. readable via kubectl explain), but that nuance when to is useful and what remap means can be improved. Thanks, we will add more context to the commentary plus examples.
kubectl explain podmonitoring.spec.targetLabels.fromPod
GROUP: monitoring.googleapis.com
KIND: PodMonitoring
VERSION: v1
FIELD: fromPod <[]Object>
DESCRIPTION:
Labels to transfer from the Kubernetes Pod to Prometheus target labels.
Mappings are applied in order.
LabelMapping specifies how to transfer a label from a Kubernetes resource
onto a Prometheus target.
FIELDS:
from <string> -required-
Kubernetes resource label to remap.
to <string>
Remapped Prometheus target label.
Defaults to the same name as `From`.
None of the examples or documentation beyond the API reference demonstrate how to scrape the pod labels as metric labels. This makes it harder than necessary to get going.
For my future reference, and the reference of anyone else:
Specify
from
as the name of the pod label you wish to have added to the metric labels. You may also need to specifyto
to provide the name the label should be on the metric - this is necessary if the pod label is not compatible with the metric labels (e.g contains characters such as /)The text was updated successfully, but these errors were encountered: