Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to configure PodMonitor via prometheus trait #2812

Closed
betonetotbo opened this issue Dec 3, 2021 · 3 comments
Closed

Be able to configure PodMonitor via prometheus trait #2812

betonetotbo opened this issue Dec 3, 2021 · 3 comments
Labels
area/observability Logging, monitoring and tracing status/stale

Comments

@betonetotbo
Copy link

Currently the only thing is possible to configure at the prometheus trait is the labels, as we can see here: https://camel.apache.org/camel-k/1.7.x/traits/prometheus.html

Would be a nice feature , if we would be able to configure prometheus PodMonitor specs (https://github.com/prometheus-operator/prometheus-operator/blob/release-0.39/Documentation/api.md#podmetricsendpoint).

For example: set a specific interval for the metrics endpoint scrape, in my case the default scrape interval in prometheus is 60s, but I need that my camel-k integrations to be scrape each 15 seconds.

A suggestion for use in command line:

kamel run Integration.java --trait prometheus.pod-monitor.spec.pod-metrics-endpoints.interval=15s

So this would be a nice pattern to customize any parameter in the PodMonitor definition.

@astefanutti
Copy link
Member

I wonder in that case whether creating a single bespoke PodMonitor matching all the integrations, would meet your need, e.g.:

apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: camel-k-integrations
  labels:
    # To match the Prometheus PodMonitor selector
spec:
  podTargetLabels:
    - camel.apache.org/integration
  selector:
    matchExpressions:
      - key: camel.apache.org/integration
        operator: Exists
  podMetricsEndpoints:
    - port: metrics
      path: /q/metrics
      interval: 15s

And you could configuration the prometheus trait globally on the IntegrationPlatform, e.g.:

apiVersion: camel.apache.org/v1
kind: IntegrationPlatform
spec:
  traits:
    - prometheus:
      configuration:
        enabled: true
        podMonitor: false

@astefanutti astefanutti added the area/observability Logging, monitoring and tracing label Dec 3, 2021
@betonetotbo
Copy link
Author

Yes, for that scenario.

But in the case if I need different intervals, this will not fit, or just about the simple case that I just not want to manually manage the PodMonitors.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2022

This issue has been automatically marked as stale due to 90 days of inactivity.
It will be closed if no further activity occurs within 15 days.
If you think that’s incorrect or the issue should never stale, please simply write any comment.
Thanks for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/observability Logging, monitoring and tracing status/stale
Projects
None yet
Development

No branches or pull requests

2 participants