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

Missing Feature: Prometheus ServiceMonitor for [[outputs.prometheus_client]] in telegraf chart #417

Open
RalfWenzel opened this issue Feb 3, 2022 · 2 comments

Comments

@RalfWenzel
Copy link

We are using the [[outputs.prometheus_client]] plugin in telegraf. The plugin itself is working as expected.

From my experience, most installations use the prometheus-operator when deploying prometheus on k8s.
prometheus-operator uses a ServiceMonitor CRD to automatically detect metric endpoints (here: endpoint exposed by [outputs.prometheus_client]])

This ServiceMonitor is normally deployed with the application to be monitored. As an example see ServiceMonitor template in Grafana Chart. So it would be desirable to have a ServiceMonitor template added to the chart.

As a workaround i manually deployed a ServiceMonitor manifest after deploying the telegraf chart.

# Prometheus ServiceMonitor for telegraf
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: telegraf
  namespace: monitoring
  labels:
    app: telegraf
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: telegraf
  namespaceSelector:
    matchNames:
    - monitoring
  endpoints:
    - port: prometheus-client
      path: /metrics

See also:

Let me note that i did not read your ``Contributing" section yet. If it helps i can provide a suggestion for ServiceMonitor template, just let me know.

@alespour
Copy link
Contributor

Hello, a pull request or a suggestion would be appreciated for sure. Thank you.

@RalfWenzel
Copy link
Author

@alespour , thx for comment, i'll have a look at it.

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

No branches or pull requests

2 participants