Skip to content

Commit

Permalink
KairosDB support (fixes micrometer-metrics#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Schneider committed Oct 14, 2018
1 parent eb20e84 commit 6ad61a2
Show file tree
Hide file tree
Showing 12 changed files with 182 additions and 193 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2017 Pivotal Software, Inc.
* Copyright 2018 Pivotal Software, Inc.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,7 @@
package io.micrometer.kairos;

import io.micrometer.core.instrument.step.StepRegistryConfig;
import io.micrometer.core.lang.Nullable;

/**
* @author Anton Ilinchik
Expand All @@ -37,35 +38,30 @@ default String prefix() {
}

/**
* The host to send the metrics to
* Default is "http://localhost:8080"
* The URI to send the metrics to.
*
* @return host
* @return uri
*/
default String host() {
String v = get(prefix() + ".host");
default String uri() {
String v = get(prefix() + ".uri");
return v == null ? "http://localhost:8080/api/v1/datapoints" : v;
}

/**
* The Basic Authentication username.
* Default is: "" (= do not perform Basic Authentication)
*
* @return username for Basic Authentication
* @return Authenticate requests with this user. By default is {@code null}, and the registry will not
* attempt to present credentials to KairosDB.
*/
@Nullable
default String userName() {
String v = get(prefix() + ".userName");
return v == null ? "" : v;
return get(prefix() + ".userName");
}

/**
* The Basic Authentication password.
* Default is: "" (= do not perform Basic Authentication)
*
* @return password for Basic Authentication
* @return Authenticate requests with this password. By default is {@code null}, and the registry will not
* attempt to present credentials to KairosDB.
*/
@Nullable
default String password() {
String v = get(prefix() + ".password");
return v == null ? "" : v;
return get(prefix() + ".password");
}
}
Loading

0 comments on commit 6ad61a2

Please sign in to comment.