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

Add service monitor for simple configuration of prometheus metrics #11

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

duartesaraiva98
Copy link

@duartesaraiva98 duartesaraiva98 commented Apr 16, 2024

The idea behind this pull request is to add a serviceMonitor configuration to the helm chart so that it can be used in combination with the prometheus operator.

The configuration allows for simple provision of the correct metric and offset endpoints.

Conceptually, the split was made between metrics and offsets. The options are:

  • get all metrics OR specific metrics for schemas and clusters
  • get all offsets OR specific offsets for topics and clusters
  • get group offsets OR not

Configuration examples

All metrics + Offsets

serviceMonitor:
  enabled: true
  metrics:
    clusters: []
    schemas: []
  offsets:
    groups: true
    topics: []
    clusters: []

Will generate:

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: release-name-kpow
spec:
  endpoints:
    - interval: 15s
       port: 3000
       path: /metrics/v1
    - interval: 15s
       port: 3000
       path: /offsets/v1
    - interval: 15s
       port: 3000
       path: /group-offsets/v1

Specific Metrics

serviceMonitor:
  enabled: true
  metrics:
    clusters: 
     - cluster-1
    schemas:
    - schema-1
  offsets:
    groups: true
    topics: []
    clusters: []

Will generate:

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: release-name-kpow
spec:
  endpoints:
    - interval: 15s
       port: 3000
       path: /metrics/v1/cluster/cluster-1   
    - interval: 15s
       port: 3000
       path: /metrics/v1/schema/schema-1
    - interval: 15s
       port: 3000
       path: /offsets/v1
    - interval: 15s
       port: 3000
       path: /group-offsets/v1

Specific Offsets

serviceMonitor:
  enabled: true
  metrics:
    clusters: []
    schemas: []
  offsets:
    groups: true
    topics: 
      - topic-1
    clusters: 
      - cluster-1

Will generate:

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: release-name-kpow
spec:
  endpoints:
    - interval: 15s
       port: 3000
       path: /metrics/v1
    - interval: 15s
       port: 3000
       path: /offsets/v1/topic/topic-1
    - interval: 15s
       port: 3000
       path: /offsets/v1/cluster/cluster-1
    - interval: 15s
       port: 3000
       path: /group-offsets/v1

Without group offsets

serviceMonitor:
  enabled: true
  metrics:
    clusters: []
    schemas: []
  offsets:
    groups: false
    topics: []
    clusters: []

Will generate:

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: release-name-kpow
spec:
  endpoints:
    - interval: 15s
       port: 3000
       path: /metrics/v1
    - interval: 15s
       port: 3000
       path: /offsets/v1

@d-t-w
Copy link
Member

d-t-w commented Apr 19, 2024

Hello @duartesaraiva98, thanks for your contribution!

I will review this next week and come back to you with any questions or comments, have a nice weekend.

@duartesaraiva98
Copy link
Author

Hi @d-t-w ! Any update on this pull request?

@d-t-w
Copy link
Member

d-t-w commented May 28, 2024

Hi @duartesaraiva98 we are paused on this one for a short while as we need to investigate:

  1. Should this be a part of OpenShift specific helm charts (many of our users are not on OS).
  2. Should we implement this after we release v2 of our metrics endpoints.

We have some upcoming work on metrics that might tie in with a slightly different implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants