diff --git a/common/src/main/java/com/usthe/common/entity/job/Configmap.java b/common/src/main/java/com/usthe/common/entity/job/Configmap.java index 388ad51..cc149d0 100644 --- a/common/src/main/java/com/usthe/common/entity/job/Configmap.java +++ b/common/src/main/java/com/usthe/common/entity/job/Configmap.java @@ -32,5 +32,5 @@ public class Configmap { * number,string,secret * 数字,非加密字符串,加密字符串 */ - private byte type; + private byte type = 1; } diff --git a/common/src/main/java/com/usthe/common/entity/job/Metrics.java b/common/src/main/java/com/usthe/common/entity/job/Metrics.java index 8b0542f..751e975 100644 --- a/common/src/main/java/com/usthe/common/entity/job/Metrics.java +++ b/common/src/main/java/com/usthe/common/entity/job/Metrics.java @@ -95,9 +95,9 @@ public class Metrics { */ private String field; /** - * 指标类型 number:数字 string:字符串 + * 指标类型 0-number:数字 1-string:字符串 */ - private String type; + private byte type = 1; /** * 此字段是否为实例主键 */ diff --git a/common/src/main/java/com/usthe/common/util/CommonConstants.java b/common/src/main/java/com/usthe/common/util/CommonConstants.java index bcbb043..92b7337 100644 --- a/common/src/main/java/com/usthe/common/util/CommonConstants.java +++ b/common/src/main/java/com/usthe/common/util/CommonConstants.java @@ -59,7 +59,22 @@ public interface CommonConstants { /** - * null空值占位符 + * 字段参数类型: 数字 + */ + byte TYPE_NUMBER = 0; + + /** + * 字段参数类型: 字符串 + */ + byte TYPE_STRING = 1; + + /** + * 字段参数类型: 加密字符串 + */ + byte TYPE_SECRET = 2; + + /** + * 采集指标值:null空值占位符 */ String NULL_VALUE = " "; } diff --git a/manager/src/main/resources/define/app/A-example.yml b/manager/src/main/resources/define/app/A-example.yml index 87f16d6..5245a15 100644 --- a/manager/src/main/resources/define/app/A-example.yml +++ b/manager/src/main/resources/define/app/A-example.yml @@ -20,17 +20,17 @@ metrics: priority: 0 # 指标组中的具体监控指标 fields: - # 指标信息 包括 field名称, type字段类型:number数字,string字符串,instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 - field: hostname - type: instance + type: 1 instance: true - field: usage - type: number + type: 0 unit: '%' - field: cores - type: number + type: 0 - field: waitTime - type: number + type: 0 unit: s # (非必须)监控指标别名,与上面的指标名映射。用于采集接口数据字段不直接是最终指标名称,需要此别名做映射转换 aliasFields: @@ -82,16 +82,16 @@ metrics: priority: 1 fields: - field: hostname - type: string + type: 1 instance: true - field: total - type: number + type: 0 unit: kb - field: usage - type: number + type: 0 unit: '%' - field: speed - type: number + type: 0 protocol: http http: host: ^_^host^_^