Skip to content

Commit

Permalink
feat: add extended settings mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
gcusnieux committed Nov 23, 2020
1 parent 91c7166 commit dcf2b1f
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 184 deletions.
Expand Up @@ -203,32 +203,11 @@ public class ReporterConfiguration {
@Value("${reporters.elasticsearch.lifecycle.policy_property_name:index.lifecycle.name}")
private String indexLifecyclePolicyPropertyName;

@Value("${reporters.elasticsearch.slowlog.threshold.query.warn:10s}")
private String slowLogThresholdQueryWarn;

@Value("${reporters.elasticsearch.slowlog.threshold.query.info:5s}")
private String slowLogThresholdQueryInfo;

@Value("${reporters.elasticsearch.slowlog.threshold.query.debug:2s}")
private String slowLogThresholdQueryDebug;

@Value("${reporters.elasticsearch.slowlog.threshold.query.trace:500ms}")
private String slowLogThresholdQueryTrace;

@Value("${reporters.elasticsearch.slowlog.threshold.fetch.warn:1s}")
private String slowLogThresholdFetchWarn;

@Value("${reporters.elasticsearch.slowlog.threshold.fetch.info:800ms}")
private String slowLogThresholdFetchInfo;

@Value("${reporters.elasticsearch.slowlog.threshold.fetch.debug:500ms}")
private String slowLogThresholdFetchDebug;

@Value("${reporters.elasticsearch.slowlog.threshold.fetch.trace:200ms}")
private String slowLogThresholdFetchTrace;

@Value("${reporters.elasticsearch.slowlog.level:info}")
private String slowLogLevel;
/**
* Extended settings template
*/
@Value("${reporters.elasticsearch.template_mapping.extended_settings:#{null}}")
private String extendedSettingsTemplate;

public List<Endpoint> getEndpoints() {
if(endpoints == null){
Expand Down Expand Up @@ -514,75 +493,11 @@ public boolean isProxyConfigured() {
"reporters.elasticsearch.http.proxy").isEmpty();
}

public String getSlowLogThresholdQueryWarn() {
return slowLogThresholdQueryWarn;
}

public void setSlowLogThresholdQueryWarn(String slowLogThresholdQueryWarn) {
this.slowLogThresholdQueryWarn = slowLogThresholdQueryWarn;
}

public String getSlowLogThresholdQueryInfo() {
return slowLogThresholdQueryInfo;
}

public void setSlowLogThresholdQueryInfo(String slowLogThresholdQueryInfo) {
this.slowLogThresholdQueryInfo = slowLogThresholdQueryInfo;
}

public String getSlowLogThresholdQueryDebug() {
return slowLogThresholdQueryDebug;
}

public void setSlowLogThresholdQueryDebug(String slowLogThresholdQueryDebug) {
this.slowLogThresholdQueryDebug = slowLogThresholdQueryDebug;
}

public String getSlowLogThresholdQueryTrace() {
return slowLogThresholdQueryTrace;
}

public void setSlowLogThresholdQueryTrace(String slowLogThresholdQueryTrace) {
this.slowLogThresholdQueryTrace = slowLogThresholdQueryTrace;
}

public String getSlowLogThresholdFetchWarn() {
return slowLogThresholdFetchWarn;
}

public void setSlowLogThresholdFetchWarn(String slowLogThresholdFetchWarn) {
this.slowLogThresholdFetchWarn = slowLogThresholdFetchWarn;
}

public String getSlowLogThresholdFetchInfo() {
return slowLogThresholdFetchInfo;
}

public void setSlowLogThresholdFetchInfo(String slowLogThresholdFetchInfo) {
this.slowLogThresholdFetchInfo = slowLogThresholdFetchInfo;
}

public String getSlowLogThresholdFetchDebug() {
return slowLogThresholdFetchDebug;
}

public void setSlowLogThresholdFetchDebug(String slowLogThresholdFetchDebug) {
this.slowLogThresholdFetchDebug = slowLogThresholdFetchDebug;
}

public String getSlowLogThresholdFetchTrace() {
return slowLogThresholdFetchTrace;
}

public void setSlowLogThresholdFetchTrace(String slowLogThresholdFetchTrace) {
this.slowLogThresholdFetchTrace = slowLogThresholdFetchTrace;
}

public String getSlowLogLevel() {
return slowLogLevel;
public String getExtendedSettingsTemplate() {
return extendedSettingsTemplate;
}

public void setSlowLogLevel(String slowLogLevel) {
this.slowLogLevel = slowLogLevel;
public void setExtendedSettingsTemplate(String extendedSettingsTemplate) {
this.extendedSettingsTemplate = extendedSettingsTemplate;
}
}
Expand Up @@ -55,17 +55,7 @@ protected Map<String, Object> getTemplateData() {
data.put("indexLifecyclePolicyRequest", this.configuration.getIndexLifecyclePolicyRequest());
data.put("indexLifecyclePolicyLog", this.configuration.getIndexLifecyclePolicyLog());
data.put("extendedRequestMappingTemplate", this.configuration.getExtendedRequestMappingTemplate());

data.put("slowLogLevel", this.configuration.getSlowLogLevel());
data.put("slowLogThresholdFetchDebug", this.configuration.getSlowLogThresholdFetchDebug());
data.put("slowLogThresholdFetchInfo", this.configuration.getSlowLogThresholdFetchInfo());
data.put("slowLogThresholdFetchTrace", this.configuration.getSlowLogThresholdFetchTrace());
data.put("slowLogThresholdFetchWarn", this.configuration.getSlowLogThresholdFetchWarn());
data.put("slowLogThresholdQueryDebug", this.configuration.getSlowLogThresholdQueryDebug());
data.put("slowLogThresholdQueryInfo", this.configuration.getSlowLogThresholdQueryInfo());
data.put("slowLogThresholdQueryTrace", this.configuration.getSlowLogThresholdQueryTrace());
data.put("slowLogThresholdQueryWarn", this.configuration.getSlowLogThresholdQueryWarn());

data.put("extendedSettingsTemplate", this.configuration.getExtendedSettingsTemplate());
return data;
}

Expand Down
Expand Up @@ -4,16 +4,8 @@
"settings": {
"index.number_of_shards":${numberOfShards},
"index.number_of_replicas":${numberOfReplicas},
"index.refresh_interval": "${refreshInterval}",
"index.search.slowlog.threshold.query.warn": "${slowLogThresholdQueryWarn}",
"index.search.slowlog.threshold.query.info": "${slowLogThresholdQueryInfo}",
"index.search.slowlog.threshold.query.debug": "${slowLogThresholdQueryDebug}",
"index.search.slowlog.threshold.query.trace": "${slowLogThresholdQueryTrace}",
"index.search.slowlog.threshold.fetch.warn": "${slowLogThresholdFetchWarn}",
"index.search.slowlog.threshold.fetch.info": "${slowLogThresholdFetchInfo}",
"index.search.slowlog.threshold.fetch.debug": "${slowLogThresholdFetchDebug}",
"index.search.slowlog.threshold.fetch.trace": "${slowLogThresholdFetchTrace}",
"index.search.slowlog.level": "${slowLogLevel}"
"index.refresh_interval": "${refreshInterval}"
<#if extendedSettingsTemplate??>,<#include "/${extendedSettingsTemplate}"></#if>
},
"mappings": {
"health": {
Expand Down
Expand Up @@ -4,16 +4,8 @@
"settings": {
"index.number_of_shards":${numberOfShards},
"index.number_of_replicas":${numberOfReplicas},
"index.refresh_interval": "${refreshInterval}",
"index.search.slowlog.threshold.query.warn": "${slowLogThresholdQueryWarn}",
"index.search.slowlog.threshold.query.info": "${slowLogThresholdQueryInfo}",
"index.search.slowlog.threshold.query.debug": "${slowLogThresholdQueryDebug}",
"index.search.slowlog.threshold.query.trace": "${slowLogThresholdQueryTrace}",
"index.search.slowlog.threshold.fetch.warn": "${slowLogThresholdFetchWarn}",
"index.search.slowlog.threshold.fetch.info": "${slowLogThresholdFetchInfo}",
"index.search.slowlog.threshold.fetch.debug": "${slowLogThresholdFetchDebug}",
"index.search.slowlog.threshold.fetch.trace": "${slowLogThresholdFetchTrace}",
"index.search.slowlog.level": "${slowLogLevel}"
"index.refresh_interval": "${refreshInterval}"
<#if extendedSettingsTemplate??>,<#include "/${extendedSettingsTemplate}"></#if>
},
"mappings": {
"log": {
Expand Down
Expand Up @@ -4,16 +4,8 @@
"settings": {
"index.number_of_shards":${numberOfShards},
"index.number_of_replicas":${numberOfReplicas},
"index.refresh_interval": "${refreshInterval}",
"index.search.slowlog.threshold.query.warn": "${slowLogThresholdQueryWarn}",
"index.search.slowlog.threshold.query.info": "${slowLogThresholdQueryInfo}",
"index.search.slowlog.threshold.query.debug": "${slowLogThresholdQueryDebug}",
"index.search.slowlog.threshold.query.trace": "${slowLogThresholdQueryTrace}",
"index.search.slowlog.threshold.fetch.warn": "${slowLogThresholdFetchWarn}",
"index.search.slowlog.threshold.fetch.info": "${slowLogThresholdFetchInfo}",
"index.search.slowlog.threshold.fetch.debug": "${slowLogThresholdFetchDebug}",
"index.search.slowlog.threshold.fetch.trace": "${slowLogThresholdFetchTrace}",
"index.search.slowlog.level": "${slowLogLevel}"
"index.refresh_interval": "${refreshInterval}"
<#if extendedSettingsTemplate??>,<#include "/${extendedSettingsTemplate}"></#if>
},
"mappings": {
"monitor": {
Expand Down
Expand Up @@ -4,16 +4,8 @@
"settings": {
"index.number_of_shards":${numberOfShards},
"index.number_of_replicas":${numberOfReplicas},
"index.refresh_interval": "${refreshInterval}",
"index.search.slowlog.threshold.query.warn": "${slowLogThresholdQueryWarn}",
"index.search.slowlog.threshold.query.info": "${slowLogThresholdQueryInfo}",
"index.search.slowlog.threshold.query.debug": "${slowLogThresholdQueryDebug}",
"index.search.slowlog.threshold.query.trace": "${slowLogThresholdQueryTrace}",
"index.search.slowlog.threshold.fetch.warn": "${slowLogThresholdFetchWarn}",
"index.search.slowlog.threshold.fetch.info": "${slowLogThresholdFetchInfo}",
"index.search.slowlog.threshold.fetch.debug": "${slowLogThresholdFetchDebug}",
"index.search.slowlog.threshold.fetch.trace": "${slowLogThresholdFetchTrace}",
"index.search.slowlog.level": "${slowLogLevel}"
"index.refresh_interval": "${refreshInterval}"
<#if extendedSettingsTemplate??>,<#include "/${extendedSettingsTemplate}"></#if>
},
"mappings": {
"request": {
Expand Down
Expand Up @@ -5,16 +5,8 @@
<#if indexLifecyclePolicyHealth??>"${indexLifecyclePolicyPropertyName}": "${indexLifecyclePolicyHealth}",</#if>
"index.number_of_shards":${numberOfShards},
"index.number_of_replicas":${numberOfReplicas},
"index.refresh_interval": "${refreshInterval}",
"index.search.slowlog.threshold.query.warn": "${slowLogThresholdQueryWarn}",
"index.search.slowlog.threshold.query.info": "${slowLogThresholdQueryInfo}",
"index.search.slowlog.threshold.query.debug": "${slowLogThresholdQueryDebug}",
"index.search.slowlog.threshold.query.trace": "${slowLogThresholdQueryTrace}",
"index.search.slowlog.threshold.fetch.warn": "${slowLogThresholdFetchWarn}",
"index.search.slowlog.threshold.fetch.info": "${slowLogThresholdFetchInfo}",
"index.search.slowlog.threshold.fetch.debug": "${slowLogThresholdFetchDebug}",
"index.search.slowlog.threshold.fetch.trace": "${slowLogThresholdFetchTrace}",
"index.search.slowlog.level": "${slowLogLevel}"
"index.refresh_interval": "${refreshInterval}"
<#if extendedSettingsTemplate??>,<#include "/${extendedSettingsTemplate}"></#if>
},
"mappings": {
"properties": {
Expand Down
Expand Up @@ -6,15 +6,7 @@
"index.number_of_shards":${numberOfShards},
"index.number_of_replicas":${numberOfReplicas},
"index.refresh_interval": "${refreshInterval}",
"index.search.slowlog.threshold.query.warn": "${slowLogThresholdQueryWarn}",
"index.search.slowlog.threshold.query.info": "${slowLogThresholdQueryInfo}",
"index.search.slowlog.threshold.query.debug": "${slowLogThresholdQueryDebug}",
"index.search.slowlog.threshold.query.trace": "${slowLogThresholdQueryTrace}",
"index.search.slowlog.threshold.fetch.warn": "${slowLogThresholdFetchWarn}",
"index.search.slowlog.threshold.fetch.info": "${slowLogThresholdFetchInfo}",
"index.search.slowlog.threshold.fetch.debug": "${slowLogThresholdFetchDebug}",
"index.search.slowlog.threshold.fetch.trace": "${slowLogThresholdFetchTrace}",
"index.search.slowlog.level": "${slowLogLevel}"
<#if extendedSettingsTemplate??>,<#include "/${extendedSettingsTemplate}"></#if>
},
"mappings": {
"properties": {
Expand Down
Expand Up @@ -5,16 +5,8 @@
<#if indexLifecyclePolicyMonitor??>"${indexLifecyclePolicyPropertyName}": "${indexLifecyclePolicyMonitor}",</#if>
"index.number_of_shards":${numberOfShards},
"index.number_of_replicas":${numberOfReplicas},
"index.refresh_interval": "${refreshInterval}",
"index.search.slowlog.threshold.query.warn": "${slowLogThresholdQueryWarn}",
"index.search.slowlog.threshold.query.info": "${slowLogThresholdQueryInfo}",
"index.search.slowlog.threshold.query.debug": "${slowLogThresholdQueryDebug}",
"index.search.slowlog.threshold.query.trace": "${slowLogThresholdQueryTrace}",
"index.search.slowlog.threshold.fetch.warn": "${slowLogThresholdFetchWarn}",
"index.search.slowlog.threshold.fetch.info": "${slowLogThresholdFetchInfo}",
"index.search.slowlog.threshold.fetch.debug": "${slowLogThresholdFetchDebug}",
"index.search.slowlog.threshold.fetch.trace": "${slowLogThresholdFetchTrace}",
"index.search.slowlog.level": "${slowLogLevel}"
"index.refresh_interval": "${refreshInterval}"
<#if extendedSettingsTemplate??>,<#include "/${extendedSettingsTemplate}"></#if>
},
"mappings": {
"properties": {
Expand Down
Expand Up @@ -5,16 +5,8 @@
<#if indexLifecyclePolicyRequest??>"${indexLifecyclePolicyPropertyName}": "${indexLifecyclePolicyRequest}",</#if>
"index.number_of_shards":${numberOfShards},
"index.number_of_replicas":${numberOfReplicas},
"index.refresh_interval": "${refreshInterval}",
"index.search.slowlog.threshold.query.warn": "${slowLogThresholdQueryWarn}",
"index.search.slowlog.threshold.query.info": "${slowLogThresholdQueryInfo}",
"index.search.slowlog.threshold.query.debug": "${slowLogThresholdQueryDebug}",
"index.search.slowlog.threshold.query.trace": "${slowLogThresholdQueryTrace}",
"index.search.slowlog.threshold.fetch.warn": "${slowLogThresholdFetchWarn}",
"index.search.slowlog.threshold.fetch.info": "${slowLogThresholdFetchInfo}",
"index.search.slowlog.threshold.fetch.debug": "${slowLogThresholdFetchDebug}",
"index.search.slowlog.threshold.fetch.trace": "${slowLogThresholdFetchTrace}",
"index.search.slowlog.level": "${slowLogLevel}"
"index.refresh_interval": "${refreshInterval}"
<#if extendedSettingsTemplate??>,<#include "/${extendedSettingsTemplate}"></#if>
},
"mappings": {
"properties": {
Expand Down

0 comments on commit dcf2b1f

Please sign in to comment.