From 0ac0607826d714448537083ec386642d67de2e75 Mon Sep 17 00:00:00 2001 From: Kyrre Havik Eriksen Date: Fri, 6 Apr 2018 09:06:00 +0200 Subject: [PATCH 1/2] Prometheus annotation for redis-export service Also added a nice app alias for the redis-exporter. Makes it easier to filter the data in Grafana. --- operator/redisfailover/service/generator.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/operator/redisfailover/service/generator.go b/operator/redisfailover/service/generator.go index dedbc1ff0..3b277c692 100644 --- a/operator/redisfailover/service/generator.go +++ b/operator/redisfailover/service/generator.go @@ -54,6 +54,11 @@ func generateRedisService(rf *redisfailoverv1alpha2.RedisFailover, labels map[st Namespace: namespace, Labels: labels, OwnerReferences: ownerRefs, + Annotations: map[string]string{ + "prometheus.io/scrape": "true", + "prometheus.io/port": "http", + "prometheus.io/path": "/metrics", + }, }, Spec: corev1.ServiceSpec{ Type: corev1.ServiceTypeClusterIP, @@ -409,6 +414,17 @@ func createRedisExporterContainer() corev1.Container { Name: exporterContainerName, Image: exporterImage, ImagePullPolicy: "Always", + Env: []corev1.EnvVar{ + { + Name: "REDIS_ALIAS", + ValueFrom: + &corev1.EnvVarSource{ + FieldRef: &corev1.ObjectFieldSelector{ + FieldPath: "metadata.name", + }, + }, + }, + }, Ports: []corev1.ContainerPort{ { Name: "metrics", From 1f196ab6d9da2c824183a3243168cc9c90449b94 Mon Sep 17 00:00:00 2001 From: Kyrre Havik Eriksen Date: Fri, 6 Apr 2018 09:06:55 +0200 Subject: [PATCH 2/2] Bump version to 0.2.2 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 75205e803..0a82efcc6 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION := 0.2.1 +VERSION := 0.2.2 # Name of this service/application SERVICE_NAME := redis-operator