Browse code

Fix: metric needs a source so we can group by 'source'

Thomas Cataldo authored on 03/07/2018 04:48:28
Showing 2 changed files
... ...
@@ -39,7 +39,8 @@ public class DirectoryVerticle extends Verticle {
39 39
 				String domain = event.body().getString("domain");
40 40
 				String version = event.body().getString("version");
41 41
 				if (containsValidVersion(domain, version)) {
42
-					registry.gauge(idFactory.name("dirVersion", "domainUid", domain)).set(Long.parseLong(version));
42
+					registry.gauge(idFactory.name("dirVersion", "domainUid", domain, "source", "database"))
43
+							.set(Long.parseLong(version));
43 44
 				}
44 45
 			}
45 46
 		});
... ...
@@ -149,7 +149,8 @@ public class LdapExportService {
149 149
 
150 150
 			doSync(ldapCon, changeset);
151 151
 			setVersion(ldapCon, changeset.version);
152
-			registry.gauge(idFactory.name("dirVersion", "domainUid", domain.uid)).set(changeset.version);
152
+			registry.gauge(idFactory.name("dirVersion", "domainUid", domain.uid, "source", "ldap-export"))
153
+					.set(changeset.version);
153 154
 		} catch (Exception e) {
154 155
 			logger.error("Fail to update LDAP with changes from {} to {}", lastVersion,
155 156
 					(changeset == null) ? "unknown" : changeset.version);