调整ES相关文件位置 & 补充connectESDAO相关类

This commit is contained in:
zengqiao
2022-12-06 17:59:39 +08:00
committed by EricZeng
parent cc2a590b33
commit 249fe7c700
74 changed files with 2640 additions and 967 deletions

View File

@@ -0,0 +1,35 @@
package com.xiaojukeji.know.streaming.km.common.bean.entity.metrics.connect;
import com.xiaojukeji.know.streaming.km.common.bean.entity.metrics.BaseMetrics;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
/**
* @author zengqiao
* @date 20/6/17
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class ConnectClusterMetrics extends BaseMetrics {
private Long connectClusterId;
public ConnectClusterMetrics(Long clusterPhyId, Long connectClusterId){
super(clusterPhyId);
this.connectClusterId = connectClusterId;
}
public static ConnectClusterMetrics initWithMetric(Long connectClusterId, String metric, Float value) {
ConnectClusterMetrics brokerMetrics = new ConnectClusterMetrics(connectClusterId, connectClusterId);
brokerMetrics.putMetric(metric, value);
return brokerMetrics;
}
@Override
public String unique() {
return "KCC@" + clusterPhyId + "@" + connectClusterId;
}
}

View File

@@ -0,0 +1,35 @@
package com.xiaojukeji.know.streaming.km.common.bean.entity.metrics.connect;
import com.xiaojukeji.know.streaming.km.common.bean.entity.metrics.BaseMetrics;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
/**
* @author wyb
* @date 2022/11/2
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class ConnectWorkerMetrics extends BaseMetrics {
private Long connectClusterId;
private String workerId;
public static ConnectWorkerMetrics initWithMetric(Long connectClusterId, String workerId, String metric, Float value) {
ConnectWorkerMetrics connectWorkerMetrics = new ConnectWorkerMetrics();
connectWorkerMetrics.setConnectClusterId(connectClusterId);
connectWorkerMetrics.setWorkerId(workerId);
connectWorkerMetrics.putMetric(metric, value);
return connectWorkerMetrics;
}
@Override
public String unique() {
return "KCC@" + clusterPhyId + "@" + connectClusterId + "@" + workerId;
}
}

View File

@@ -0,0 +1,39 @@
package com.xiaojukeji.know.streaming.km.common.bean.entity.metrics.connect;
import com.xiaojukeji.know.streaming.km.common.bean.entity.metrics.BaseMetrics;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
/**
* @author zengqiao
* @date 20/6/17
*/
@Data
@NoArgsConstructor
@ToString
public class ConnectorMetrics extends BaseMetrics {
private Long connectClusterId;
private String connectorName;
private String connectorNameAndClusterId;
public ConnectorMetrics(Long connectClusterId, String connectorName) {
super(null);
this.connectClusterId = connectClusterId;
this.connectorName = connectorName;
this.connectorNameAndClusterId = connectorName + "#" + connectClusterId;
}
public static ConnectorMetrics initWithMetric(Long connectClusterId, String connectorName, String metricName, Float value) {
ConnectorMetrics metrics = new ConnectorMetrics(connectClusterId, connectorName);
metrics.putMetric(metricName, value);
return metrics;
}
@Override
public String unique() {
return "KCOR@" + connectClusterId + "@" + connectorName;
}
}

View File

@@ -0,0 +1,39 @@
package com.xiaojukeji.know.streaming.km.common.bean.entity.metrics.connect;
import com.xiaojukeji.know.streaming.km.common.bean.entity.metrics.BaseMetrics;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
/**
* @author wyb
* @date 2022/11/4
*/
@Data
@NoArgsConstructor
@ToString
public class ConnectorTaskMetrics extends BaseMetrics {
private Long connectClusterId;
private String connectorName;
private Integer taskId;
public ConnectorTaskMetrics(Long connectClusterId, String connectorName, Integer taskId) {
this.connectClusterId = connectClusterId;
this.connectorName = connectorName;
this.taskId = taskId;
}
public static ConnectorTaskMetrics initWithMetric(Long connectClusterId, String connectorName, Integer taskId, String metricName, Float value) {
ConnectorTaskMetrics metrics = new ConnectorTaskMetrics(connectClusterId, connectorName, taskId);
metrics.putMetric(metricName,value);
return metrics;
}
@Override
public String unique() {
return "KCOR@" + connectClusterId + "@" + connectorName + "@" + taskId;
}
}

View File

@@ -0,0 +1,30 @@
package com.xiaojukeji.know.streaming.km.common.bean.po.metrice.connect;
import com.xiaojukeji.know.streaming.km.common.bean.po.metrice.BaseMetricESPO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import static com.xiaojukeji.know.streaming.km.common.utils.CommonUtils.monitorTimestamp2min;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ConnectClusterMetricPO extends BaseMetricESPO {
private Long connectClusterId;
public ConnectClusterMetricPO(Long kafkaClusterPhyId, Long connectClusterId){
super(kafkaClusterPhyId);
this.connectClusterId = connectClusterId;
}
@Override
public String getKey() {
return "KCC@" + clusterPhyId + "@" + connectClusterId + "@" + monitorTimestamp2min(timestamp);
}
@Override
public String getRoutingValue() {
return String.valueOf(connectClusterId);
}
}

View File

@@ -0,0 +1,39 @@
package com.xiaojukeji.know.streaming.km.common.bean.po.metrice.connect;
import com.xiaojukeji.know.streaming.km.common.bean.po.metrice.BaseMetricESPO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import static com.xiaojukeji.know.streaming.km.common.utils.CommonUtils.monitorTimestamp2min;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ConnectorMetricPO extends BaseMetricESPO {
private Long connectClusterId;
private String connectorName;
/**
* 用于es内部排序
*/
private String connectorNameAndClusterId;
public ConnectorMetricPO(Long kafkaClusterPhyId, Long connectClusterId, String connectorName){
super(kafkaClusterPhyId);
this.connectClusterId = connectClusterId;
this.connectorName = connectorName;
this.connectorNameAndClusterId = connectorName + "#" + connectClusterId;
}
@Override
public String getKey() {
return "KCOR@" + clusterPhyId + "@" + connectClusterId + "@" + connectorName + "@" + monitorTimestamp2min(timestamp);
}
@Override
public String getRoutingValue() {
return String.valueOf(connectClusterId);
}
}

View File

@@ -1,709 +0,0 @@
package com.xiaojukeji.know.streaming.km.common.constant;
public class ESIndexConstant {
public final static String TOPIC_INDEX = "ks_kafka_topic_metric";
public final static String TOPIC_TEMPLATE = "{\n" +
" \"order\" : 10,\n" +
" \"index_patterns\" : [\n" +
" \"ks_kafka_topic_metric*\"\n" +
" ],\n" +
" \"settings\" : {\n" +
" \"index\" : {\n" +
" \"number_of_shards\" : \"10\"\n" +
" }\n" +
" },\n" +
" \"mappings\" : {\n" +
" \"properties\" : {\n" +
" \"brokerId\" : {\n" +
" \"type\" : \"long\"\n" +
" },\n" +
" \"routingValue\" : {\n" +
" \"type\" : \"text\",\n" +
" \"fields\" : {\n" +
" \"keyword\" : {\n" +
" \"ignore_above\" : 256,\n" +
" \"type\" : \"keyword\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"topic\" : {\n" +
" \"type\" : \"keyword\"\n" +
" },\n" +
" \"clusterPhyId\" : {\n" +
" \"type\" : \"long\"\n" +
" },\n" +
" \"metrics\" : {\n" +
" \"properties\" : {\n" +
" \"BytesIn_min_15\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"Messages\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"BytesRejected\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"PartitionURP\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"HealthCheckTotal\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"ReplicationCount\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"ReplicationBytesOut\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"ReplicationBytesIn\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"FailedFetchRequests\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"BytesIn_min_5\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"HealthScore\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"LogSize\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"BytesOut\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"BytesOut_min_15\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"FailedProduceRequests\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"BytesIn\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"BytesOut_min_5\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"MessagesIn\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"TotalProduceRequests\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"HealthCheckPassed\" : {\n" +
" \"type\" : \"float\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"brokerAgg\" : {\n" +
" \"type\" : \"keyword\"\n" +
" },\n" +
" \"key\" : {\n" +
" \"type\" : \"text\",\n" +
" \"fields\" : {\n" +
" \"keyword\" : {\n" +
" \"ignore_above\" : 256,\n" +
" \"type\" : \"keyword\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"timestamp\" : {\n" +
" \"format\" : \"yyyy-MM-dd HH:mm:ss Z||yyyy-MM-dd HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS Z||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd HH:mm:ss,SSS||yyyy/MM/dd HH:mm:ss||yyyy-MM-dd HH:mm:ss,SSS Z||yyyy/MM/dd HH:mm:ss,SSS Z||epoch_millis\",\n" +
" \"index\" : true,\n" +
" \"type\" : \"date\",\n" +
" \"doc_values\" : true\n" +
" }\n" +
" }\n" +
" },\n" +
" \"aliases\" : { }\n" +
" }";
public final static String CLUSTER_INDEX = "ks_kafka_cluster_metric";
public final static String CLUSTER_TEMPLATE = "{\n" +
" \"order\" : 10,\n" +
" \"index_patterns\" : [\n" +
" \"ks_kafka_cluster_metric*\"\n" +
" ],\n" +
" \"settings\" : {\n" +
" \"index\" : {\n" +
" \"number_of_shards\" : \"10\"\n" +
" }\n" +
" },\n" +
" \"mappings\" : {\n" +
" \"properties\" : {\n" +
" \"routingValue\" : {\n" +
" \"type\" : \"text\",\n" +
" \"fields\" : {\n" +
" \"keyword\" : {\n" +
" \"ignore_above\" : 256,\n" +
" \"type\" : \"keyword\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"clusterPhyId\" : {\n" +
" \"type\" : \"long\"\n" +
" },\n" +
" \"metrics\" : {\n" +
" \"properties\" : {\n" +
" \"Connections\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"BytesIn_min_15\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"PartitionURP\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"HealthScore_Topics\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"EventQueueSize\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"ActiveControllerCount\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"GroupDeads\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"BytesIn_min_5\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"HealthCheckTotal_Topics\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"Partitions\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"BytesOut\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"Groups\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"BytesOut_min_15\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"TotalRequestQueueSize\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"HealthCheckPassed_Groups\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"TotalProduceRequests\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"HealthCheckPassed\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"TotalLogSize\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"GroupEmptys\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"PartitionNoLeader\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"HealthScore_Brokers\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"Messages\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"Topics\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"PartitionMinISR_E\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"HealthCheckTotal\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"Brokers\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"Replicas\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"HealthCheckTotal_Groups\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"GroupRebalances\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"MessageIn\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"HealthScore\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"HealthCheckPassed_Topics\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"HealthCheckTotal_Brokers\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"PartitionMinISR_S\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"BytesIn\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"BytesOut_min_5\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"GroupActives\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"MessagesIn\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"GroupReBalances\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"HealthCheckPassed_Brokers\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"HealthScore_Groups\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"TotalResponseQueueSize\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"Zookeepers\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"LeaderMessages\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"HealthScore_Cluster\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"HealthCheckPassed_Cluster\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"HealthCheckTotal_Cluster\" : {\n" +
" \"type\" : \"double\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"key\" : {\n" +
" \"type\" : \"text\",\n" +
" \"fields\" : {\n" +
" \"keyword\" : {\n" +
" \"ignore_above\" : 256,\n" +
" \"type\" : \"keyword\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"timestamp\" : {\n" +
" \"format\" : \"yyyy-MM-dd HH:mm:ss Z||yyyy-MM-dd HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS Z||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd HH:mm:ss,SSS||yyyy/MM/dd HH:mm:ss||yyyy-MM-dd HH:mm:ss,SSS Z||yyyy/MM/dd HH:mm:ss,SSS Z||epoch_millis\",\n" +
" \"type\" : \"date\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"aliases\" : { }\n" +
" }";
public final static String BROKER_INDEX = "ks_kafka_broker_metric";
public final static String BROKER_TEMPLATE = "{\n" +
" \"order\" : 10,\n" +
" \"index_patterns\" : [\n" +
" \"ks_kafka_broker_metric*\"\n" +
" ],\n" +
" \"settings\" : {\n" +
" \"index\" : {\n" +
" \"number_of_shards\" : \"10\"\n" +
" }\n" +
" },\n" +
" \"mappings\" : {\n" +
" \"properties\" : {\n" +
" \"brokerId\" : {\n" +
" \"type\" : \"long\"\n" +
" },\n" +
" \"routingValue\" : {\n" +
" \"type\" : \"text\",\n" +
" \"fields\" : {\n" +
" \"keyword\" : {\n" +
" \"ignore_above\" : 256,\n" +
" \"type\" : \"keyword\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"clusterPhyId\" : {\n" +
" \"type\" : \"long\"\n" +
" },\n" +
" \"metrics\" : {\n" +
" \"properties\" : {\n" +
" \"NetworkProcessorAvgIdle\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"UnderReplicatedPartitions\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"BytesIn_min_15\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"HealthCheckTotal\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"RequestHandlerAvgIdle\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"connectionsCount\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"BytesIn_min_5\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"HealthScore\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"BytesOut\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"BytesOut_min_15\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"BytesIn\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"BytesOut_min_5\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"TotalRequestQueueSize\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"MessagesIn\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"TotalProduceRequests\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"HealthCheckPassed\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"TotalResponseQueueSize\" : {\n" +
" \"type\" : \"float\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"key\" : {\n" +
" \"type\" : \"text\",\n" +
" \"fields\" : {\n" +
" \"keyword\" : {\n" +
" \"ignore_above\" : 256,\n" +
" \"type\" : \"keyword\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"timestamp\" : {\n" +
" \"format\" : \"yyyy-MM-dd HH:mm:ss Z||yyyy-MM-dd HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS Z||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd HH:mm:ss,SSS||yyyy/MM/dd HH:mm:ss||yyyy-MM-dd HH:mm:ss,SSS Z||yyyy/MM/dd HH:mm:ss,SSS Z||epoch_millis\",\n" +
" \"index\" : true,\n" +
" \"type\" : \"date\",\n" +
" \"doc_values\" : true\n" +
" }\n" +
" }\n" +
" },\n" +
" \"aliases\" : { }\n" +
" }";
public final static String PARTITION_INDEX = "ks_kafka_partition_metric";
public final static String PARTITION_TEMPLATE = "{\n" +
" \"order\" : 10,\n" +
" \"index_patterns\" : [\n" +
" \"ks_kafka_partition_metric*\"\n" +
" ],\n" +
" \"settings\" : {\n" +
" \"index\" : {\n" +
" \"number_of_shards\" : \"10\"\n" +
" }\n" +
" },\n" +
" \"mappings\" : {\n" +
" \"properties\" : {\n" +
" \"brokerId\" : {\n" +
" \"type\" : \"long\"\n" +
" },\n" +
" \"partitionId\" : {\n" +
" \"type\" : \"long\"\n" +
" },\n" +
" \"routingValue\" : {\n" +
" \"type\" : \"text\",\n" +
" \"fields\" : {\n" +
" \"keyword\" : {\n" +
" \"ignore_above\" : 256,\n" +
" \"type\" : \"keyword\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"clusterPhyId\" : {\n" +
" \"type\" : \"long\"\n" +
" },\n" +
" \"topic\" : {\n" +
" \"type\" : \"keyword\"\n" +
" },\n" +
" \"metrics\" : {\n" +
" \"properties\" : {\n" +
" \"LogStartOffset\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"Messages\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"LogEndOffset\" : {\n" +
" \"type\" : \"float\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"key\" : {\n" +
" \"type\" : \"text\",\n" +
" \"fields\" : {\n" +
" \"keyword\" : {\n" +
" \"ignore_above\" : 256,\n" +
" \"type\" : \"keyword\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"timestamp\" : {\n" +
" \"format\" : \"yyyy-MM-dd HH:mm:ss Z||yyyy-MM-dd HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS Z||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd HH:mm:ss,SSS||yyyy/MM/dd HH:mm:ss||yyyy-MM-dd HH:mm:ss,SSS Z||yyyy/MM/dd HH:mm:ss,SSS Z||epoch_millis\",\n" +
" \"index\" : true,\n" +
" \"type\" : \"date\",\n" +
" \"doc_values\" : true\n" +
" }\n" +
" }\n" +
" },\n" +
" \"aliases\" : { }\n" +
" }";
public final static String GROUP_INDEX = "ks_kafka_group_metric";
public final static String GROUP_TEMPLATE = "{\n" +
" \"order\" : 10,\n" +
" \"index_patterns\" : [\n" +
" \"ks_kafka_group_metric*\"\n" +
" ],\n" +
" \"settings\" : {\n" +
" \"index\" : {\n" +
" \"number_of_shards\" : \"10\"\n" +
" }\n" +
" },\n" +
" \"mappings\" : {\n" +
" \"properties\" : {\n" +
" \"group\" : {\n" +
" \"type\" : \"keyword\"\n" +
" },\n" +
" \"partitionId\" : {\n" +
" \"type\" : \"long\"\n" +
" },\n" +
" \"routingValue\" : {\n" +
" \"type\" : \"text\",\n" +
" \"fields\" : {\n" +
" \"keyword\" : {\n" +
" \"ignore_above\" : 256,\n" +
" \"type\" : \"keyword\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"clusterPhyId\" : {\n" +
" \"type\" : \"long\"\n" +
" },\n" +
" \"topic\" : {\n" +
" \"type\" : \"keyword\"\n" +
" },\n" +
" \"metrics\" : {\n" +
" \"properties\" : {\n" +
" \"HealthScore\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"Lag\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"OffsetConsumed\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"HealthCheckTotal\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"HealthCheckPassed\" : {\n" +
" \"type\" : \"float\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"groupMetric\" : {\n" +
" \"type\" : \"keyword\"\n" +
" },\n" +
" \"key\" : {\n" +
" \"type\" : \"text\",\n" +
" \"fields\" : {\n" +
" \"keyword\" : {\n" +
" \"ignore_above\" : 256,\n" +
" \"type\" : \"keyword\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"timestamp\" : {\n" +
" \"format\" : \"yyyy-MM-dd HH:mm:ss Z||yyyy-MM-dd HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS Z||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd HH:mm:ss,SSS||yyyy/MM/dd HH:mm:ss||yyyy-MM-dd HH:mm:ss,SSS Z||yyyy/MM/dd HH:mm:ss,SSS Z||epoch_millis\",\n" +
" \"index\" : true,\n" +
" \"type\" : \"date\",\n" +
" \"doc_values\" : true\n" +
" }\n" +
" }\n" +
" },\n" +
" \"aliases\" : { }\n" +
" }";
public final static String REPLICATION_INDEX = "ks_kafka_replication_metric";
public final static String REPLICATION_TEMPLATE = "{\n" +
" \"order\" : 10,\n" +
" \"index_patterns\" : [\n" +
" \"ks_kafka_replication_metric*\"\n" +
" ],\n" +
" \"settings\" : {\n" +
" \"index\" : {\n" +
" \"number_of_shards\" : \"10\"\n" +
" }\n" +
" },\n" +
" \"mappings\" : {\n" +
" \"properties\" : {\n" +
" \"brokerId\" : {\n" +
" \"type\" : \"long\"\n" +
" },\n" +
" \"partitionId\" : {\n" +
" \"type\" : \"long\"\n" +
" },\n" +
" \"routingValue\" : {\n" +
" \"type\" : \"text\",\n" +
" \"fields\" : {\n" +
" \"keyword\" : {\n" +
" \"ignore_above\" : 256,\n" +
" \"type\" : \"keyword\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"clusterPhyId\" : {\n" +
" \"type\" : \"long\"\n" +
" },\n" +
" \"topic\" : {\n" +
" \"type\" : \"keyword\"\n" +
" },\n" +
" \"metrics\" : {\n" +
" \"properties\" : {\n" +
" \"LogStartOffset\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"Messages\" : {\n" +
" \"type\" : \"float\"\n" +
" },\n" +
" \"LogEndOffset\" : {\n" +
" \"type\" : \"float\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"key\" : {\n" +
" \"type\" : \"text\",\n" +
" \"fields\" : {\n" +
" \"keyword\" : {\n" +
" \"ignore_above\" : 256,\n" +
" \"type\" : \"keyword\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"timestamp\" : {\n" +
" \"format\" : \"yyyy-MM-dd HH:mm:ss Z||yyyy-MM-dd HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS Z||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd HH:mm:ss,SSS||yyyy/MM/dd HH:mm:ss||yyyy-MM-dd HH:mm:ss,SSS Z||yyyy/MM/dd HH:mm:ss,SSS Z||epoch_millis\",\n" +
" \"index\" : true,\n" +
" \"type\" : \"date\",\n" +
" \"doc_values\" : true\n" +
" }\n" +
" }\n" +
" },\n" +
" \"aliases\" : { }\n" +
" }";
public final static String ZOOKEEPER_INDEX = "ks_kafka_zookeeper_metric";
public final static String ZOOKEEPER_TEMPLATE = "{\n" +
" \"order\" : 10,\n" +
" \"index_patterns\" : [\n" +
" \"ks_kafka_zookeeper_metric*\"\n" +
" ],\n" +
" \"settings\" : {\n" +
" \"index\" : {\n" +
" \"number_of_shards\" : \"10\"\n" +
" }\n" +
" },\n" +
" \"mappings\" : {\n" +
" \"properties\" : {\n" +
" \"routingValue\" : {\n" +
" \"type\" : \"text\",\n" +
" \"fields\" : {\n" +
" \"keyword\" : {\n" +
" \"ignore_above\" : 256,\n" +
" \"type\" : \"keyword\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"clusterPhyId\" : {\n" +
" \"type\" : \"long\"\n" +
" },\n" +
" \"metrics\" : {\n" +
" \"properties\" : {\n" +
" \"AvgRequestLatency\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"MinRequestLatency\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"MaxRequestLatency\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"OutstandingRequests\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"NodeCount\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"WatchCount\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"NumAliveConnections\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"PacketsReceived\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"PacketsSent\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"EphemeralsCount\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"ApproximateDataSize\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"OpenFileDescriptorCount\" : {\n" +
" \"type\" : \"double\"\n" +
" },\n" +
" \"MaxFileDescriptorCount\" : {\n" +
" \"type\" : \"double\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"key\" : {\n" +
" \"type\" : \"text\",\n" +
" \"fields\" : {\n" +
" \"keyword\" : {\n" +
" \"ignore_above\" : 256,\n" +
" \"type\" : \"keyword\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"timestamp\" : {\n" +
" \"format\" : \"yyyy-MM-dd HH:mm:ss Z||yyyy-MM-dd HH:mm:ss||yyyy-MM-dd HH:mm:ss.SSS Z||yyyy-MM-dd HH:mm:ss.SSS||yyyy-MM-dd HH:mm:ss,SSS||yyyy/MM/dd HH:mm:ss||yyyy-MM-dd HH:mm:ss,SSS Z||yyyy/MM/dd HH:mm:ss,SSS Z||epoch_millis\",\n" +
" \"type\" : \"date\"\n" +
" }\n" +
" }\n" +
" },\n" +
" \"aliases\" : { }\n" +
" }";
}