prometheus-operator / kube-prometheus

Use Prometheus to monitor Kubernetes and applications running on Kubernetes
https://prometheus-operator.dev/
Apache License 2.0
6.73k stars 1.93k forks source link

etcd-grafana dashboard from etcd-io-mixin no longer included #942

Open wjentner opened 3 years ago

wjentner commented 3 years ago

What happened?

In previous versions of kube-prometheus, a grafana-dashboard for etcd has been added automatically.

The dashboard is defined here: https://github.com/etcd-io/etcd/blob/master/contrib/mixin/mixin.libsonnet#L236 It is however not included in the compiled YAML.

How to reproduce it (as minimally and precisely as possible):

static-etcd example.

pschulten commented 3 years ago

@wjentner as a workaround I currently add it manually

Dashboard:

local kp = (import 'kube-prometheus/main.libsonnet') +
           (import 'kube-prometheus/addons/anti-affinity.libsonnet') +
           (import 'kube-prometheus/platforms/kubeadm.libsonnet') +
           (import 'kube-prometheus/addons/all-namespaces.libsonnet') +
           (import 'kube-prometheus/addons/static-etcd.libsonnet') {

             values+:: {
               // ...
               grafana+:: {
                 config: {},
                 rawDashboards+:: {},
                 dashboards+:: (import 'github.com/etcd-io/etcd/contrib/mixin/mixin.libsonnet').grafanaDashboards,
               },

PrometheusRule:

local kp = (import 'kube-prometheus/main.libsonnet') +
           (import 'kube-prometheus/addons/anti-affinity.libsonnet') +
           (import 'kube-prometheus/platforms/kubeadm.libsonnet') +
           (import 'kube-prometheus/addons/all-namespaces.libsonnet') +
           (import 'kube-prometheus/addons/static-etcd.libsonnet') {

             values+:: {},
             // ...
             etcd: {
               prometheusRule: {
                 apiVersion: 'monitoring.coreos.com/v1',
                 kind: 'PrometheusRule',
                 metadata: {
                   labels: {
                     prometheus: 'k8s',
                     role: 'alert-rules',
                   },
                   name: 'etcd-rules',
                   namespace: $.values.common.namespace,
                 },
                 spec+: (import 'github.com/etcd-io/etcd/contrib/mixin/mixin.libsonnet').prometheusAlerts,
               },
             },
             // ...
{ ['etcd-' + name]: kp.etcd[name] for name in std.objectFields(kp.etcd) } +
// ...
paulfantom commented 3 years ago

This should be partially fixed when https://github.com/prometheus-operator/kube-prometheus/pull/1107 is merged. After that, we can fix part when it is automatically added with etcd addon.

jcpunk commented 1 year ago

I'll confess interest in this.