Skip to content

Migrate from ServiceMonitor to PodMonitor in Prometheus trait #1555

Closed

Description

@astefanutti

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.

Activity

  1. added
    area/observability
    on Jun 24, 2020
  2. self-assigned this
    on Jun 24, 2020
  3. heiko-braun commented on Jun 25, 2020

    @heiko-braun

    Is a composite resource that contains servicemonitor, alerts, etc?

  4. astefanutti commented on Jun 25, 2020

    @astefanutti
    MemberAuthor

    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.

  5. astefanutti commented on Jun 29, 2020

    @astefanutti
    MemberAuthor

    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 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/observability

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions