PodMonitor.spec.podMetricsEndpoints[].portNumber
portNumber defines the `Pod` port number which exposes the endpoint. The `Pod` must declare the specified `Port` in its spec or the target will be dropped by Prometheus. This cannot be used to enable scraping of an undeclared port. To scrape targets on a port which isn't exposed, you need to use relabeling to override the `__address__` label (but beware of duplicate targets if the `Pod` has other declared ports). In practice Prometheus will select targets for which the matches the target's __meta_kubernetes_pod_container_port_number.
| Field / Type | Description |
|---|---|
PodMonitor.spec.podMetricsEndpoints[].portNumber | portNumber defines the `Pod` port number which exposes the endpoint. The `Pod` must declare the specified `Port` in its spec or the target will be dropped by Prometheus. This cannot be used to enable scraping of an undeclared port. To scrape targets on a port which isn't exposed, you need to use relabeling to override the `__address__` label (but beware of duplicate targets if the `Pod` has other declared ports). In practice Prometheus will select targets for which the matches the target's __meta_kubernetes_pod_container_port_number.
|