kube-prometheus icon indicating copy to clipboard operation
kube-prometheus copied to clipboard

Supporting general monitor-mixins ?

Open KlavsKlavsen opened this issue 3 years ago • 4 comments

This project is GREAT for monitoring my Kubernetes cluster.

But how do you expect users to handle monitoring of the services ON the cluster? Should they install a different prometheus instance - to do this? or is it possible to use the mixins from https://monitoring.mixins.dev/ - and plugin to this? and perhaps extending https://github.com/prometheus-community/helm-charts to have an "enable" option ?

KlavsKlavsen avatar Mar 19 '21 13:03 KlavsKlavsen

Hey 👋 We already allow customizing, we have some docs around how to achieve this https://github.com/prometheus-operator/kube-prometheus#customizing-kube-prometheus and https://github.com/prometheus-operator/kube-prometheus#customization-examples.

Its up to you how you want your architecture setup to look like, you can use one instance of Prometheus to achieve that or multiple instances, it depends on your needs entirely. The current setup monitors k8s and monitoring stack out of the box. For any extra services or workloads you would just have to create a ServiceMonitor or PodMonitor and Prometheus operator deployed with this stack will pick up monitoring of those workloads.

I am not sure what you mean by the website plugins, maybe you can extend on that part a bit more?

lilic avatar Mar 19 '21 13:03 lilic

In case you are looking for other examples. I have a repo that uses kube-prometheus but add some custom made mixins for our own services: https://github.com/gitpod-io/pluggable-o11y-stack

Another example is Openshift's cluster-monitoring operator, which is a little bit more complex: https://github.com/openshift/cluster-monitoring-operator/blob/master/jsonnet/main.jsonnet

ArthurSens avatar Mar 19 '21 14:03 ArthurSens

You can also take a look at how I am including a monitoring mixin for coredns with kube-prometheus in my deployment at https://github.com/thaum-xyz/ankhmorpork/blob/master/apps/monitoring/jsonnet/main.jsonnet#L425-L445 :)

To shine a bit more light - since mixins are just a collection of rules and dashboards there are 2 things you need to do:

  1. wrap alerting and recording rules into PrometheusRule object
  2. somehow load dashboard into grafana

First thing is fairly easy and can be done either in kube-prometheus or separately. Second thing depends on how dashboards are managed in your infra. If you use stateless grafana from kube-prometheus then you need to append your dashboard here (or maybe you want to contribute a more automated solution? :) ) and if you use stateful grafana, then you need to render json file and load it in your preferred way.

paulfantom avatar Mar 19 '21 15:03 paulfantom

This issue has been automatically marked as stale because it has not had any activity in the last 60 days. Thank you for your contributions.

github-actions[bot] avatar Nov 13 '21 02:11 github-actions[bot]

This issue was closed because it has not had any activity in the last 120 days. Please reopen if you feel this is still valid.

github-actions[bot] avatar Jan 13 '23 03:01 github-actions[bot]