Skip to content

Commit

Permalink
Further improvements on elastic implementation.
Browse files Browse the repository at this point in the history
* Index _type is always 'doc'
* Remove Jackson from Elastic implementation
* Separate percentiles/histogram into separate time series with tags.
  • Loading branch information
Jon Schneider committed Mar 14, 2018
1 parent f233715 commit 3ec44d9
Show file tree
Hide file tree
Showing 13 changed files with 317 additions and 605 deletions.
4 changes: 1 addition & 3 deletions implementations/micrometer-registry-elastic/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ apply plugin: 'org.junit.platform.gradle.plugin'

dependencies {
compile project(':micrometer-core')
compile 'com.fasterxml.jackson.core:jackson-core:latest.release'
compile 'com.fasterxml.jackson.core:jackson-databind:latest.release'
compile 'com.fasterxml.jackson.module:jackson-module-afterburner:latest.release'
compile 'commons-io:commons-io:latest.release'

testCompile project(':micrometer-test')
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

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

import java.util.concurrent.TimeUnit;

/**
* @author Nicolas Portmann
*/
Expand All @@ -32,10 +30,8 @@ public interface ElasticConfig extends StepRegistryConfig {
/**
* Get the value associated with a key.
*
* @param key
* Key to lookup in the config.
* @return
* Value for the key or null if no key is present.
* @param key Key to lookup in the config.
* @return Value for the key or null if no key is present.
*/
String get(String key);

Expand All @@ -55,42 +51,6 @@ default String[] hosts() {
return v == null ? new String[]{"http://localhost:9200"} : v.split(",");
}

/**
* Prefix all metrics with a given {@link String}.
* Default is ""
*/
default String metricPrefix() {
String v = get(prefix() + ".metricPrefix");
return v == null ? "" : v;
}

/**
* Convert all durations to a certain {@link TimeUnit}
* Default is {@link TimeUnit#SECONDS}
*/
default TimeUnit rateUnits() {
String v = get(prefix() + ".rateUnits");
return v == null ? TimeUnit.SECONDS : TimeUnit.valueOf(v.toUpperCase());
}

/**
* Convert all durations to a certain {@link TimeUnit}
* Default is {@link TimeUnit#MILLISECONDS}
*/
default TimeUnit durationUnits() {
String v = get(prefix() + ".durationUnits");
return v == null ? TimeUnit.MILLISECONDS : TimeUnit.valueOf(v.toUpperCase());
}

/**
* The timeout to wait for until a connection attempt is and the next host is tried.
* Default is: 1000
*/
default int timeout() {
String v = get(prefix() + ".timeout");
return v == null ? 1000 : Integer.parseInt(v);
}

/**
* The index name to write metrics to.
* Default is: "metrics"
Expand All @@ -110,15 +70,6 @@ default String indexDateFormat() {
return v == null ? "yyyy-MM" : v;
}

/**
* The bulk size per request.
* Default is: 2500
*/
default int bulkSize() {
String v = get(prefix() + ".bulkSize");
return v == null ? 2500 : Integer.parseInt(v);
}

/**
* The name of the timestamp field.
* Default is: "@timestamp"
Expand Down
Loading

0 comments on commit 3ec44d9

Please sign in to comment.