coreos / etcd-operator

etcd operator creates/configures/manages etcd clusters atop Kubernetes
https://coreos.com/blog/introducing-the-etcd-operator.html
Apache License 2.0
1.75k stars 741 forks source link

metrics for etcd cluster objects #1197

Open brancz opened 7 years ago

brancz commented 7 years ago

The etcd-operator already exposes some Prometheus metrics which is great!

To be able to know the expected number of memers of an etcd cluster, it would be great to expose metrics about the etcd cluster object that exist in the Kubernetes cluster.

For example the Prometheus Operator exposes metrics in this form:

prometheus_operator_prometheus_spec_replicas

@xiang90 @heyitsanthony

/cc @fabxc @mxinden @Gouthamve

xiang90 commented 7 years ago

@brancz the metrics is labeled with prometheus statefulset name?

fabxc commented 7 years ago

With the Prometheus resource name, IIRC, as stateful set is that name plus a common suffix.

On Fri, Jun 16, 2017 at 6:58 AM Xiang Li notifications@github.com wrote:

@brancz https://github.com/brancz the metrics is labeled with prometheus statefulset name?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/coreos/etcd-operator/issues/1197#issuecomment-308933379, or mute the thread https://github.com/notifications/unsubscribe-auth/AEuA8iGviFrPJP-DJE26jWskcW_Rn0Ulks5sEguEgaJpZM4N63EJ .

brancz commented 7 years ago

For example this manifest:

apiVersion: monitoring.coreos.com/v1alpha1
kind: Prometheus
metadata:
  name: k8s
  namespace: tectonic-system
spec:
  replicas: 1

Once created in your Kubernetes cluster, produces this metric:

# HELP prometheus_operator_prometheus_spec_replicas Number of expected Prometheus replicas for the Prometheus object.
# TYPE prometheus_operator_prometheus_spec_replicas gauge
prometheus_operator_prometheus_spec_replicas{namespace="tectonic-system",prometheus="k8s"} 1

Which is exposed by the Prometheus Operator.