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
{{ message }}
Repository navigation
Migrate from ServiceMonitor to PodMonitor in Prometheus trait #1555
The Prometheus creates a ServiceMonitor resource, so that a Prometheus operator instance can discover the integration metrics endpoints. In newer versions of the Prometheus operator, the PodMonitor resource has been introduced that seems more appropriate, as it would prevent the creation of an ah-hoc service for the sole monitoring purpose.
RBAC resources and documentation will have to be updated accordingly.
Is a composite resource that contains servicemonitor, alerts, etc?
As ServiceMonitor, PodMonitor purpose is to configure Prometheus operator discovery of metrics endpoints. The difference is that there is no intermediate service exposing these endpoints when using PodMonitor.
However, it seems it hits the limitation enforced by Knative Serving, that only a single container port can be declared. In that case, the work-around used with ServiceMonitor, that is, not declaring the metrics endpoint port, does not work with PodMonitor.
A couple of issues are already reported in Knative Serving:
Another option would be to use a single port serving both application and monitoring traffic. While this would be difficult for the main runtime, that relies on the JMX exporter Prometheus agent, this is the default with Quarkus. So it may become the preferred option when #1562 gets fixed.
Activity
heiko-braun commentedon Jun 25, 2020
Is a composite resource that contains servicemonitor, alerts, etc?
astefanutti commentedon Jun 25, 2020
As
ServiceMonitor,PodMonitorpurpose is to configure Prometheus operator discovery of metrics endpoints. The difference is that there is no intermediate service exposing these endpoints when usingPodMonitor.astefanutti commentedon Jun 29, 2020
A first implementation has been done at https://github.com/astefanutti/camel-k/commit/0cff2daafd4c2d4699ceef4bad074c7c83e6b547.
However, it seems it hits the limitation enforced by Knative Serving, that only a single container port can be declared. In that case, the work-around used with
ServiceMonitor, that is, not declaring the metrics endpoint port, does not work withPodMonitor.A couple of issues are already reported in Knative Serving:
Another option would be to use a single port serving both application and monitoring traffic. While this would be difficult for the main runtime, that relies on the JMX exporter Prometheus agent, this is the default with Quarkus. So it may become the preferred option when #1562 gets fixed.