diff --git a/README.md b/README.md index d215236f6f2..a7fc49c5d49 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,9 @@ ### Features * Combines **monitoring, alarm, and notification** features into one platform, and supports monitoring for web service, program, database, cache, os, webserver, middleware, bigdata, cloud-native, network, custom and more. -* Easy to use and agentless, offering full web-based operations for monitoring and alerting with just a few clicks, all at zero learning cost. +* Easy to use and agentless, offering full gui operations for monitoring and alerting with just a few clicks, all at zero learning cost. * Makes protocols such as `Http, Jmx, Ssh, Snmp, Jdbc, Prometheus` configurable, allowing you to collect any metrics by simply configuring the template `YML` file online. Imagine being able to quickly adapt to a new monitoring type like K8s or Docker simply by configuring online with HertzBeat. +* Compatible with the `Prometheus` ecosystem and more, can monitoring what `Prometheus` can monitoring with few clicks on gui. * High performance, supports horizontal expansion of multi-collector clusters, multi-isolated network monitoring and cloud-edge collaboration. * Provides flexible alarm threshold rules and timely notifications delivered via `Discord` `Slack` `Telegram` `Email` `Dingtalk` `WeChat` `FeiShu` `Webhook` `SMS` `ServerChan`. @@ -435,10 +436,10 @@ HertzBeat is a top project under the [Dromara Open Source Community](https://dro ##### Open-Source Project Build From Open-Source -> HertzBeat is built on so many great open source projects, thanks to them! +HertzBeat is built on so many great open source projects, thanks to them! -- Java Spring SpringBoot Jpa Maven Assembly Netty Lombok Sureness Aviator Protobuf HttpClient Guava SnakeYaml JsonPath ... -- TypeScript Angular NG-ZORRO NG-ALAIN NodeJs Npm Html Less Echarts Rxjs ZoneJs MonacoEditor SlickCarousel Docusaurus ... +- `Java Spring SpringBoot Jpa Maven Assembly Netty Lombok Sureness Aviator Protobuf HttpClient Guava SnakeYaml JsonPath ...` +- `TypeScript Angular NG-ZORRO NG-ALAIN NodeJs Npm Html Less Echarts Rxjs ZoneJs MonacoEditor SlickCarousel Docusaurus ...` ## Star History diff --git a/README_CN.md b/README_CN.md index a28799b933d..a2371d793cb 100644 --- a/README_CN.md +++ b/README_CN.md @@ -32,6 +32,7 @@ - 集 **监控+告警+通知** 为一体,支持对应用服务,应用程序,数据库,缓存,操作系统,大数据,中间件,Web服务器,云原生,网络,自定义等监控阈值告警通知一步到位。 - 易用友好,无需 `Agent`,全 `WEB` 页面操作,鼠标点一点就能监控告警,零上手学习成本。 - 将 `Http, Jmx, Ssh, Snmp, Jdbc, Prometheus` 等协议规范可配置化,只需在浏览器配置监控模版 `YML` 就能使用这些协议去自定义采集想要的指标。您相信只需配置下就能立刻适配一款 `K8s` 或 `Docker` 等新的监控类型吗? +- 兼容 `Prometheus` 的系统生态并且更多,只需页面操作就可以监控 `Prometheus` 所能监控的。 - 高性能,支持多采集器集群横向扩展,支持多隔离网络监控,云边协同。 - 自由的告警阈值规则,`邮件` `Discord` `Slack` `Telegram` `钉钉` `微信` `飞书` `短信` `Webhook` `Server酱` 等方式消息及时送达。 @@ -449,5 +450,13 @@ HertzBeat 赫兹跳动是 [Dromara开源社区](https://dromara.org/) 下顶级 - TypeScript Angular NG-ZORRO NG-ALAIN NodeJs Npm Html Less Echarts Rxjs ZoneJs MonacoEditor SlickCarousel Docusaurus ... +##### Open-Source Project Build From Open-Source + +HertzBeat is built on so many great open source projects, thanks to them! + +- `Java Spring SpringBoot Jpa Maven Assembly Netty Lombok Sureness Aviator Protobuf HttpClient Guava SnakeYaml JsonPath ...` +- `TypeScript Angular NG-ZORRO NG-ALAIN NodeJs Npm Html Less Echarts Rxjs ZoneJs MonacoEditor SlickCarousel Docusaurus ...` + + ## 🛡️ License [`Apache License, Version 2.0`](https://www.apache.org/licenses/LICENSE-2.0.html) diff --git a/alerter/src/main/java/org/dromara/hertzbeat/alert/calculate/CalculateAlarm.java b/alerter/src/main/java/org/dromara/hertzbeat/alert/calculate/CalculateAlarm.java index ec59bd29aad..7bdd7ea2960 100644 --- a/alerter/src/main/java/org/dromara/hertzbeat/alert/calculate/CalculateAlarm.java +++ b/alerter/src/main/java/org/dromara/hertzbeat/alert/calculate/CalculateAlarm.java @@ -183,10 +183,7 @@ private void calculate(CollectRep.MetricsData metricsData) { } fieldValueMap.clear(); fieldValueMap.put(SYSTEM_VALUE_ROW_COUNT, valueRowCount); - String instance = valueRow.getInstance(); - if (!"".equals(instance)) { - fieldValueMap.put("instance", instance); - } + StringBuilder instanceBuilder = new StringBuilder(); for (int index = 0; index < valueRow.getColumnsList().size(); index++) { String valueStr = valueRow.getColumns(index); if (CommonConstants.NULL_VALUE.equals(valueStr)) { @@ -204,6 +201,9 @@ private void calculate(CollectRep.MetricsData metricsData) { fieldValueMap.put(field.getName(), valueStr); } } + if (field.getLabel()) { + instanceBuilder.append(valueStr).append("-"); + } } try { boolean match = execAlertExpression(fieldValueMap, expr); @@ -214,7 +214,7 @@ private void calculate(CollectRep.MetricsData metricsData) { // 若此阈值已被触发,则其它数据行的触发忽略 break; } else if (define.isRecoverNotice()) { - String notResolvedAlertKey = String.valueOf(monitorId) + define.getId() + (!"".equals(instance) ? instance : null); + String notResolvedAlertKey = String.valueOf(monitorId) + define.getId() + (instanceBuilder.length() == 0 ? null : instanceBuilder.toString()); handleRecoveredAlert(currentTimeMilli, monitorId, app, define, expr, notResolvedAlertKey); } } catch (Exception e) { diff --git a/collector/src/main/java/org/dromara/hertzbeat/collector/collect/prometheus/PrometheusAutoCollectImpl.java b/collector/src/main/java/org/dromara/hertzbeat/collector/collect/prometheus/PrometheusAutoCollectImpl.java index a44d35d0dd4..05366d7467a 100644 --- a/collector/src/main/java/org/dromara/hertzbeat/collector/collect/prometheus/PrometheusAutoCollectImpl.java +++ b/collector/src/main/java/org/dromara/hertzbeat/collector/collect/prometheus/PrometheusAutoCollectImpl.java @@ -206,9 +206,11 @@ private List parseResponseByPrometheusExporter(String re if (index == 0) { metric.getLabelPair().forEach(label -> { metricsFields.add(label.getName()); - builder.addFields(CollectRep.Field.newBuilder().setName(label.getName()).setType(CommonConstants.TYPE_STRING).build()); + builder.addFields(CollectRep.Field.newBuilder().setName(label.getName()) + .setType(CommonConstants.TYPE_STRING).setLabel(true).build()); }); - builder.addFields(CollectRep.Field.newBuilder().setName("value").setType(CommonConstants.TYPE_NUMBER).build()); + builder.addFields(CollectRep.Field.newBuilder().setName("value") + .setType(CommonConstants.TYPE_NUMBER).setLabel(false).build()); } Map labelMap = metric.getLabelPair() .stream() diff --git a/collector/src/main/java/org/dromara/hertzbeat/collector/dispatch/MetricsCollect.java b/collector/src/main/java/org/dromara/hertzbeat/collector/dispatch/MetricsCollect.java index db33f6a0973..3b4e6b71358 100644 --- a/collector/src/main/java/org/dromara/hertzbeat/collector/dispatch/MetricsCollect.java +++ b/collector/src/main/java/org/dromara/hertzbeat/collector/dispatch/MetricsCollect.java @@ -201,7 +201,7 @@ private void calculateFields(Metrics metrics, CollectRep.MetricsData.Builder col List fieldList = new LinkedList<>(); for (Metrics.Field field : metrics.getFields()) { CollectRep.Field.Builder fieldBuilder = CollectRep.Field.newBuilder(); - fieldBuilder.setName(field.getField()).setType(field.getType()); + fieldBuilder.setName(field.getField()).setType(field.getType()).setLabel(field.isLabel()); if (field.getUnit() != null) { fieldBuilder.setUnit(field.getUnit()); } @@ -326,13 +326,8 @@ private void calculateFields(Metrics metrics, CollectRep.MetricsData.Builder col } realValueRowBuilder.addColumns(value); fieldValueMap.clear(); - if (field.isInstance() && !CommonConstants.NULL_VALUE.equals(value)) { - instanceBuilder.append(value); - } } aliasFieldValueMap.clear(); - // set instance - realValueRowBuilder.setInstance(instanceBuilder.toString()); collectData.addValues(realValueRowBuilder.build()); realValueRowBuilder.clear(); } @@ -377,20 +372,6 @@ private Object[] transformUnit(String unit) { return new Object[]{field, Pair.of(originUnit, newUnit)}; } - /** - * build CollectRep.Field - * @param field - * @return - */ - private CollectRep.Field doCollectRepField(Metrics.Field field) { - CollectRep.Field.Builder fieldBuilder = CollectRep.Field.newBuilder(); - fieldBuilder.setName(field.getField()).setType(field.getType()); - if (field.getUnit() != null) { - fieldBuilder.setUnit(field.getUnit()); - } - return fieldBuilder.build(); - } - private boolean fastFailed() { return this.timeout == null || this.timeout.isCancelled(); } diff --git a/common/src/main/java/org/dromara/hertzbeat/common/entity/dto/Field.java b/common/src/main/java/org/dromara/hertzbeat/common/entity/dto/Field.java index 6babac93244..8d23bf933d0 100644 --- a/common/src/main/java/org/dromara/hertzbeat/common/entity/dto/Field.java +++ b/common/src/main/java/org/dromara/hertzbeat/common/entity/dto/Field.java @@ -46,5 +46,8 @@ public class Field { @Schema(title = "是否是实例字段") private Boolean instance; + + @Schema(title = "是否是标签字段") + private Boolean label; } diff --git a/common/src/main/java/org/dromara/hertzbeat/common/entity/dto/ValueRow.java b/common/src/main/java/org/dromara/hertzbeat/common/entity/dto/ValueRow.java index 59b99f112f2..2817d984439 100644 --- a/common/src/main/java/org/dromara/hertzbeat/common/entity/dto/ValueRow.java +++ b/common/src/main/java/org/dromara/hertzbeat/common/entity/dto/ValueRow.java @@ -24,9 +24,10 @@ import lombok.NoArgsConstructor; import java.util.List; +import java.util.Map; /** - * 监控指标组的一行指标数据 + * 监控指标集合的一行指标数据 * @author tom * */ @@ -34,12 +35,12 @@ @Builder @AllArgsConstructor @NoArgsConstructor -@Schema(description = "监控指标组的一行指标数据") +@Schema(description = "监控指标集合的一行指标数据") public class ValueRow { + + @Schema(title = "Value Row Labels") + private Map labels; - @Schema(title = "此行数据唯一实例") - private String instance; - - @Schema(description = "监控指标组指标值") + @Schema(description = "监控指标集合指标值") private List values; } diff --git a/common/src/main/java/org/dromara/hertzbeat/common/entity/job/Metrics.java b/common/src/main/java/org/dromara/hertzbeat/common/entity/job/Metrics.java index 361a53dde3b..7cd51b7eb78 100644 --- a/common/src/main/java/org/dromara/hertzbeat/common/entity/job/Metrics.java +++ b/common/src/main/java/org/dromara/hertzbeat/common/entity/job/Metrics.java @@ -273,9 +273,12 @@ public static class Field { private byte type = 1; /** * Whether this field is the instance primary key - * 此字段是否为实例主键 */ private boolean instance = false; + /** + * Whether this field is the label + */ + private boolean label = false; /** * Indicator unit * 指标单位 diff --git a/common/src/main/java/org/dromara/hertzbeat/common/entity/message/CollectRep.java b/common/src/main/java/org/dromara/hertzbeat/common/entity/message/CollectRep.java index 08149242883..391681fe2b4 100644 --- a/common/src/main/java/org/dromara/hertzbeat/common/entity/message/CollectRep.java +++ b/common/src/main/java/org/dromara/hertzbeat/common/entity/message/CollectRep.java @@ -5,4877 +5,4407 @@ @SuppressWarnings("PMD") public final class CollectRep { - private CollectRep() { - } + private CollectRep() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code org.dromara.hertzbeat.common.entity.message.Code} + */ + public enum Code + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * collect success
+     * 
+ * + * SUCCESS = 0; + */ + SUCCESS(0), + /** + *
+     * collector not available
+     * 
+ * + * UN_AVAILABLE = 1; + */ + UN_AVAILABLE(1), + /** + *
+     * peer network un reachable(icmp)
+     * 
+ * + * UN_REACHABLE = 2; + */ + UN_REACHABLE(2), + /** + *
+     * peer network server un connectable(tcp,udp...)
+     * 
+ * + * UN_CONNECTABLE = 3; + */ + UN_CONNECTABLE(3), + /** + *
+     * collect metrics data failed(http,ssh,snmp...)
+     * 
+ * + * FAIL = 4; + */ + FAIL(4), + /** + *
+     * collect metrics data timeout
+     * 
+ * + * TIMEOUT = 5; + */ + TIMEOUT(5), + UNRECOGNIZED(-1), + ; - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } + /** + *
+     * collect success
+     * 
+ * + * SUCCESS = 0; + */ + public static final int SUCCESS_VALUE = 0; + /** + *
+     * collector not available
+     * 
+ * + * UN_AVAILABLE = 1; + */ + public static final int UN_AVAILABLE_VALUE = 1; + /** + *
+     * peer network un reachable(icmp)
+     * 
+ * + * UN_REACHABLE = 2; + */ + public static final int UN_REACHABLE_VALUE = 2; + /** + *
+     * peer network server un connectable(tcp,udp...)
+     * 
+ * + * UN_CONNECTABLE = 3; + */ + public static final int UN_CONNECTABLE_VALUE = 3; + /** + *
+     * collect metrics data failed(http,ssh,snmp...)
+     * 
+ * + * FAIL = 4; + */ + public static final int FAIL_VALUE = 4; + /** + *
+     * collect metrics data timeout
+     * 
+ * + * TIMEOUT = 5; + */ + public static final int TIMEOUT_VALUE = 5; - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; } /** - * Protobuf enum {@code org.dromara.hertzbeat.common.entity.message.Code} + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. */ - public enum Code - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
-         * 采集成功
-         * 
- * - * SUCCESS = 0; - */ - SUCCESS(0), - /** - *
-         * 采集器不可用
-         * 
- * - * UN_AVAILABLE = 1; - */ - UN_AVAILABLE(1), - /** - *
-         * 对端不可达(网络层icmp)
-         * 
- * - * UN_REACHABLE = 2; - */ - UN_REACHABLE(2), - /** - *
-         * 对端连接失败(传输层tcp,udp)
-         * 
- * - * UN_CONNECTABLE = 3; - */ - UN_CONNECTABLE(3), - /** - *
-         * 数据采集失败(应用层http,ssh,snmp)
-         * 
- * - * FAIL = 4; - */ - FAIL(4), - /** - *
-         * 采集超时
-         * 
- * - * TIMEOUT = 5; - */ - TIMEOUT(5), - UNRECOGNIZED(-1), - ; - - /** - *
-         * 采集成功
-         * 
- * - * SUCCESS = 0; - */ - public static final int SUCCESS_VALUE = 0; - /** - *
-         * 采集器不可用
-         * 
- * - * UN_AVAILABLE = 1; - */ - public static final int UN_AVAILABLE_VALUE = 1; - /** - *
-         * 对端不可达(网络层icmp)
-         * 
- * - * UN_REACHABLE = 2; - */ - public static final int UN_REACHABLE_VALUE = 2; - /** - *
-         * 对端连接失败(传输层tcp,udp)
-         * 
- * - * UN_CONNECTABLE = 3; - */ - public static final int UN_CONNECTABLE_VALUE = 3; - /** - *
-         * 数据采集失败(应用层http,ssh,snmp)
-         * 
- * - * FAIL = 4; - */ - public static final int FAIL_VALUE = 4; - /** - *
-         * 采集超时
-         * 
- * - * TIMEOUT = 5; - */ - public static final int TIMEOUT_VALUE = 5; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @Deprecated - public static Code valueOf(int value) { - return forNumber(value); - } + @Deprecated + public static Code valueOf(int value) { + return forNumber(value); + } - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static Code forNumber(int value) { - switch (value) { - case 0: - return SUCCESS; - case 1: - return UN_AVAILABLE; - case 2: - return UN_REACHABLE; - case 3: - return UN_CONNECTABLE; - case 4: - return FAIL; - case 5: - return TIMEOUT; - default: - return null; - } - } + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Code forNumber(int value) { + switch (value) { + case 0: return SUCCESS; + case 1: return UN_AVAILABLE; + case 2: return UN_REACHABLE; + case 3: return UN_CONNECTABLE; + case 4: return FAIL; + case 5: return TIMEOUT; + default: return null; + } + } - public static com.google.protobuf.Internal.EnumLiteMap + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { - return internalValueMap; - } - - private static final com.google.protobuf.Internal.EnumLiteMap< - Code> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public Code findValueByNumber(int number) { - return Code.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Code> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Code findValueByNumber(int number) { + return Code.forNumber(number); } - return getDescriptor().getValues().get(ordinal()); - } + }; - public final com.google.protobuf.Descriptors.EnumDescriptor + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { - return getDescriptor(); - } - - public static final com.google.protobuf.Descriptors.EnumDescriptor + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return CollectRep.getDescriptor().getEnumTypes().get(0); - } + return CollectRep.getDescriptor().getEnumTypes().get(0); + } - private static final Code[] VALUES = values(); + private static final Code[] VALUES = values(); + + public static Code valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } - public static Code valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } + private final int value; - private final int value; + private Code(int value) { + this.value = value; + } - private Code(int value) { - this.value = value; - } + // @@protoc_insertion_point(enum_scope:org.dromara.hertzbeat.common.entity.message.Code) + } - // @@protoc_insertion_point(enum_scope:org.dromara.hertzbeat.common.entity.message.Code) - } - - public interface MetricsDataOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.dromara.hertzbeat.common.entity.message.MetricsData) - com.google.protobuf.MessageOrBuilder { - - /** - *
-         * 监控的ID
-         * 
- * - * uint64 id = 1; - * - * @return The id. - */ - long getId(); - - /** - *
-         * 所属租户ID
-         * 
- * - * uint64 tenantId = 2; - * - * @return The tenantId. - */ - long getTenantId(); - - /** - *
-         * 监控的类型 eg: linux | mysql | jvm
-         * 
- * - * string app = 3; - * - * @return The app. - */ - String getApp(); - - /** - *
-         * 监控的类型 eg: linux | mysql | jvm
-         * 
- * - * string app = 3; - * - * @return The bytes for app. - */ - com.google.protobuf.ByteString + public interface MetricsDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.dromara.hertzbeat.common.entity.message.MetricsData) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * monitoring id
+     * 
+ * + * uint64 id = 1; + * @return The id. + */ + long getId(); + + /** + *
+     * tenant id
+     * 
+ * + * uint64 tenantId = 2; + * @return The tenantId. + */ + long getTenantId(); + + /** + *
+     * monitoring app eg: linux | mysql | jvm
+     * 
+ * + * string app = 3; + * @return The app. + */ + String getApp(); + /** + *
+     * monitoring app eg: linux | mysql | jvm
+     * 
+ * + * string app = 3; + * @return The bytes for app. + */ + com.google.protobuf.ByteString getAppBytes(); - /** - *
-         * 监控采集的指标集合 eg: cpu | memory | health
-         * 
- * - * string metrics = 4; - * - * @return The metrics. - */ - String getMetrics(); - - /** - *
-         * 监控采集的指标集合 eg: cpu | memory | health
-         * 
- * - * string metrics = 4; - * - * @return The bytes for metrics. - */ - com.google.protobuf.ByteString + /** + *
+     * monitoring metrics eg: cpu | memory | health
+     * 
+ * + * string metrics = 4; + * @return The metrics. + */ + String getMetrics(); + /** + *
+     * monitoring metrics eg: cpu | memory | health
+     * 
+ * + * string metrics = 4; + * @return The bytes for metrics. + */ + com.google.protobuf.ByteString getMetricsBytes(); - /** - *
-         * 监控采集指标集合的采集优先级>=0
-         * 
- * - * uint32 priority = 5; - * - * @return The priority. - */ - int getPriority(); - - /** - *
-         * 采集时间
-         * 
- * - * uint64 time = 6; - * - * @return The time. - */ - long getTime(); - - /** - *
-         * 采集响应码
-         * 
- * - * .org.dromara.hertzbeat.common.entity.message.Code code = 7; - * - * @return The enum numeric value on the wire for code. - */ - int getCodeValue(); - - /** - *
-         * 采集响应码
-         * 
- * - * .org.dromara.hertzbeat.common.entity.message.Code code = 7; - * - * @return The code. - */ - Code getCode(); - - /** - *
-         * 采集响应信息
-         * 
- * - * string msg = 8; - * - * @return The msg. - */ - String getMsg(); - - /** - *
-         * 采集响应信息
-         * 
- * - * string msg = 8; - * - * @return The bytes for msg. - */ - com.google.protobuf.ByteString + /** + *
+     * monitoring collect priority >=0
+     * 
+ * + * uint32 priority = 5; + * @return The priority. + */ + int getPriority(); + + /** + *
+     * collect timestamp
+     * 
+ * + * uint64 time = 6; + * @return The time. + */ + long getTime(); + + /** + *
+     * collect response code
+     * 
+ * + * .org.dromara.hertzbeat.common.entity.message.Code code = 7; + * @return The enum numeric value on the wire for code. + */ + int getCodeValue(); + /** + *
+     * collect response code
+     * 
+ * + * .org.dromara.hertzbeat.common.entity.message.Code code = 7; + * @return The code. + */ + Code getCode(); + + /** + *
+     * collect response error message
+     * 
+ * + * string msg = 8; + * @return The msg. + */ + String getMsg(); + /** + *
+     * collect response error message
+     * 
+ * + * string msg = 8; + * @return The bytes for msg. + */ + com.google.protobuf.ByteString getMsgBytes(); - /** - *
-         * 采集指标名
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - java.util.List + /** + *
+     * monitoring collect metric field
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + java.util.List getFieldsList(); - - /** - *
-         * 采集指标名
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - Field getFields(int index); - - /** - *
-         * 采集指标名
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - int getFieldsCount(); - - /** - *
-         * 采集指标名
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - java.util.List + /** + *
+     * monitoring collect metric field
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + Field getFields(int index); + /** + *
+     * monitoring collect metric field
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + int getFieldsCount(); + /** + *
+     * monitoring collect metric field
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + java.util.List getFieldsOrBuilderList(); + /** + *
+     * monitoring collect metric field
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + FieldOrBuilder getFieldsOrBuilder( + int index); - /** - *
-         * 采集指标名
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - FieldOrBuilder getFieldsOrBuilder( - int index); - - /** - *
-         * 采集指标值集合(fields作为字段名称与ValueRow映射)
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - java.util.List + /** + *
+     * monitoring collect metric data, mapping with the fields
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + java.util.List getValuesList(); - - /** - *
-         * 采集指标值集合(fields作为字段名称与ValueRow映射)
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - ValueRow getValues(int index); - - /** - *
-         * 采集指标值集合(fields作为字段名称与ValueRow映射)
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - int getValuesCount(); - - /** - *
-         * 采集指标值集合(fields作为字段名称与ValueRow映射)
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - java.util.List + /** + *
+     * monitoring collect metric data, mapping with the fields
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + ValueRow getValues(int index); + /** + *
+     * monitoring collect metric data, mapping with the fields
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + int getValuesCount(); + /** + *
+     * monitoring collect metric data, mapping with the fields
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + java.util.List getValuesOrBuilderList(); - - /** - *
-         * 采集指标值集合(fields作为字段名称与ValueRow映射)
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - ValueRowOrBuilder getValuesOrBuilder( - int index); - } - /** - * Protobuf type {@code org.dromara.hertzbeat.common.entity.message.MetricsData} + *
+     * monitoring collect metric data, mapping with the fields
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; */ - public static final class MetricsData extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:org.dromara.hertzbeat.common.entity.message.MetricsData) - MetricsDataOrBuilder { - private static final long serialVersionUID = 0L; - - // Use MetricsData.newBuilder() to construct. - private MetricsData(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private MetricsData() { - app_ = ""; - metrics_ = ""; - code_ = 0; - msg_ = ""; - fields_ = java.util.Collections.emptyList(); - values_ = java.util.Collections.emptyList(); - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new MetricsData(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } + ValueRowOrBuilder getValuesOrBuilder( + int index); + } + /** + * Protobuf type {@code org.dromara.hertzbeat.common.entity.message.MetricsData} + */ + public static final class MetricsData extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.dromara.hertzbeat.common.entity.message.MetricsData) + MetricsDataOrBuilder { + private static final long serialVersionUID = 0L; + // Use MetricsData.newBuilder() to construct. + private MetricsData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private MetricsData() { + app_ = ""; + metrics_ = ""; + code_ = 0; + msg_ = ""; + fields_ = java.util.Collections.emptyList(); + values_ = java.util.Collections.emptyList(); + } - private MetricsData( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - id_ = input.readUInt64(); - break; - } - case 16: { - - tenantId_ = input.readUInt64(); - break; - } - case 26: { - String s = input.readStringRequireUtf8(); - - app_ = s; - break; - } - case 34: { - String s = input.readStringRequireUtf8(); - - metrics_ = s; - break; - } - case 40: { - - priority_ = input.readUInt32(); - break; - } - case 48: { - - time_ = input.readUInt64(); - break; - } - case 56: { - int rawValue = input.readEnum(); - - code_ = rawValue; - break; - } - case 66: { - String s = input.readStringRequireUtf8(); - - msg_ = s; - break; - } - case 74: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - fields_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - fields_.add( - input.readMessage(Field.parser(), extensionRegistry)); - break; - } - case 82: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - values_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - values_.add( - input.readMessage(ValueRow.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - fields_ = java.util.Collections.unmodifiableList(fields_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - values_ = java.util.Collections.unmodifiableList(values_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new MetricsData(); + } - public static final com.google.protobuf.Descriptors.Descriptor + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private MetricsData( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + id_ = input.readUInt64(); + break; + } + case 16: { + + tenantId_ = input.readUInt64(); + break; + } + case 26: { + String s = input.readStringRequireUtf8(); + + app_ = s; + break; + } + case 34: { + String s = input.readStringRequireUtf8(); + + metrics_ = s; + break; + } + case 40: { + + priority_ = input.readUInt32(); + break; + } + case 48: { + + time_ = input.readUInt64(); + break; + } + case 56: { + int rawValue = input.readEnum(); + + code_ = rawValue; + break; + } + case 66: { + String s = input.readStringRequireUtf8(); + + msg_ = s; + break; + } + case 74: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + fields_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + fields_.add( + input.readMessage(Field.parser(), extensionRegistry)); + break; + } + case 82: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + values_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + values_.add( + input.readMessage(ValueRow.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + fields_ = java.util.Collections.unmodifiableList(fields_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_descriptor; - } + return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_descriptor; + } - @Override - protected FieldAccessorTable + @Override + protected FieldAccessorTable internalGetFieldAccessorTable() { - return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_fieldAccessorTable - .ensureFieldAccessorsInitialized( - MetricsData.class, Builder.class); - } - - public static final int ID_FIELD_NUMBER = 1; - private long id_; - - /** - *
-         * 监控的ID
-         * 
- * - * uint64 id = 1; - * - * @return The id. - */ - @Override - public long getId() { - return id_; - } + return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + MetricsData.class, Builder.class); + } - public static final int TENANTID_FIELD_NUMBER = 2; - private long tenantId_; - - /** - *
-         * 所属租户ID
-         * 
- * - * uint64 tenantId = 2; - * - * @return The tenantId. - */ - @Override - public long getTenantId() { - return tenantId_; - } + public static final int ID_FIELD_NUMBER = 1; + private long id_; + /** + *
+     * monitoring id
+     * 
+ * + * uint64 id = 1; + * @return The id. + */ + @Override + public long getId() { + return id_; + } - public static final int APP_FIELD_NUMBER = 3; - private volatile Object app_; - - /** - *
-         * 监控的类型 eg: linux | mysql | jvm
-         * 
- * - * string app = 3; - * - * @return The app. - */ - @Override - public String getApp() { - Object ref = app_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - app_ = s; - return s; - } - } + public static final int TENANTID_FIELD_NUMBER = 2; + private long tenantId_; + /** + *
+     * tenant id
+     * 
+ * + * uint64 tenantId = 2; + * @return The tenantId. + */ + @Override + public long getTenantId() { + return tenantId_; + } - /** - *
-         * 监控的类型 eg: linux | mysql | jvm
-         * 
- * - * string app = 3; - * - * @return The bytes for app. - */ - @Override - public com.google.protobuf.ByteString + public static final int APP_FIELD_NUMBER = 3; + private volatile Object app_; + /** + *
+     * monitoring app eg: linux | mysql | jvm
+     * 
+ * + * string app = 3; + * @return The app. + */ + @Override + public String getApp() { + Object ref = app_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + app_ = s; + return s; + } + } + /** + *
+     * monitoring app eg: linux | mysql | jvm
+     * 
+ * + * string app = 3; + * @return The bytes for app. + */ + @Override + public com.google.protobuf.ByteString getAppBytes() { - Object ref = app_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - app_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int METRICS_FIELD_NUMBER = 4; - private volatile Object metrics_; - - /** - *
-         * 监控采集的指标集合 eg: cpu | memory | health
-         * 
- * - * string metrics = 4; - * - * @return The metrics. - */ - @Override - public String getMetrics() { - Object ref = metrics_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - metrics_ = s; - return s; - } - } + Object ref = app_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + app_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } - /** - *
-         * 监控采集的指标集合 eg: cpu | memory | health
-         * 
- * - * string metrics = 4; - * - * @return The bytes for metrics. - */ - @Override - public com.google.protobuf.ByteString + public static final int METRICS_FIELD_NUMBER = 4; + private volatile Object metrics_; + /** + *
+     * monitoring metrics eg: cpu | memory | health
+     * 
+ * + * string metrics = 4; + * @return The metrics. + */ + @Override + public String getMetrics() { + Object ref = metrics_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + metrics_ = s; + return s; + } + } + /** + *
+     * monitoring metrics eg: cpu | memory | health
+     * 
+ * + * string metrics = 4; + * @return The bytes for metrics. + */ + @Override + public com.google.protobuf.ByteString getMetricsBytes() { - Object ref = metrics_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - metrics_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PRIORITY_FIELD_NUMBER = 5; - private int priority_; - - /** - *
-         * 监控采集指标集合的采集优先级>=0
-         * 
- * - * uint32 priority = 5; - * - * @return The priority. - */ - @Override - public int getPriority() { - return priority_; - } - - public static final int TIME_FIELD_NUMBER = 6; - private long time_; - - /** - *
-         * 采集时间
-         * 
- * - * uint64 time = 6; - * - * @return The time. - */ - @Override - public long getTime() { - return time_; - } + Object ref = metrics_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + metrics_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } - public static final int CODE_FIELD_NUMBER = 7; - private int code_; - - /** - *
-         * 采集响应码
-         * 
- * - * .org.dromara.hertzbeat.common.entity.message.Code code = 7; - * - * @return The enum numeric value on the wire for code. - */ - @Override - public int getCodeValue() { - return code_; - } + public static final int PRIORITY_FIELD_NUMBER = 5; + private int priority_; + /** + *
+     * monitoring collect priority >=0
+     * 
+ * + * uint32 priority = 5; + * @return The priority. + */ + @Override + public int getPriority() { + return priority_; + } - /** - *
-         * 采集响应码
-         * 
- * - * .org.dromara.hertzbeat.common.entity.message.Code code = 7; - * - * @return The code. - */ - @Override - public Code getCode() { - @SuppressWarnings("deprecation") - Code result = Code.valueOf(code_); - return result == null ? Code.UNRECOGNIZED : result; - } + public static final int TIME_FIELD_NUMBER = 6; + private long time_; + /** + *
+     * collect timestamp
+     * 
+ * + * uint64 time = 6; + * @return The time. + */ + @Override + public long getTime() { + return time_; + } - public static final int MSG_FIELD_NUMBER = 8; - private volatile Object msg_; - - /** - *
-         * 采集响应信息
-         * 
- * - * string msg = 8; - * - * @return The msg. - */ - @Override - public String getMsg() { - Object ref = msg_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - msg_ = s; - return s; - } - } + public static final int CODE_FIELD_NUMBER = 7; + private int code_; + /** + *
+     * collect response code
+     * 
+ * + * .org.dromara.hertzbeat.common.entity.message.Code code = 7; + * @return The enum numeric value on the wire for code. + */ + @Override public int getCodeValue() { + return code_; + } + /** + *
+     * collect response code
+     * 
+ * + * .org.dromara.hertzbeat.common.entity.message.Code code = 7; + * @return The code. + */ + @Override public Code getCode() { + @SuppressWarnings("deprecation") + Code result = Code.valueOf(code_); + return result == null ? Code.UNRECOGNIZED : result; + } - /** - *
-         * 采集响应信息
-         * 
- * - * string msg = 8; - * - * @return The bytes for msg. - */ - @Override - public com.google.protobuf.ByteString + public static final int MSG_FIELD_NUMBER = 8; + private volatile Object msg_; + /** + *
+     * collect response error message
+     * 
+ * + * string msg = 8; + * @return The msg. + */ + @Override + public String getMsg() { + Object ref = msg_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + msg_ = s; + return s; + } + } + /** + *
+     * collect response error message
+     * 
+ * + * string msg = 8; + * @return The bytes for msg. + */ + @Override + public com.google.protobuf.ByteString getMsgBytes() { - Object ref = msg_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - msg_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int FIELDS_FIELD_NUMBER = 9; - private java.util.List fields_; - - /** - *
-         * 采集指标名
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - @Override - public java.util.List getFieldsList() { - return fields_; - } + Object ref = msg_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + msg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } - /** - *
-         * 采集指标名
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - @Override - public java.util.List + public static final int FIELDS_FIELD_NUMBER = 9; + private java.util.List fields_; + /** + *
+     * monitoring collect metric field
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + @Override + public java.util.List getFieldsList() { + return fields_; + } + /** + *
+     * monitoring collect metric field
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + @Override + public java.util.List getFieldsOrBuilderList() { - return fields_; - } - - /** - *
-         * 采集指标名
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - @Override - public int getFieldsCount() { - return fields_.size(); - } - - /** - *
-         * 采集指标名
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - @Override - public Field getFields(int index) { - return fields_.get(index); - } - - /** - *
-         * 采集指标名
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - @Override - public FieldOrBuilder getFieldsOrBuilder( - int index) { - return fields_.get(index); - } - - public static final int VALUES_FIELD_NUMBER = 10; - private java.util.List values_; - - /** - *
-         * 采集指标值集合(fields作为字段名称与ValueRow映射)
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - @Override - public java.util.List getValuesList() { - return values_; - } - - /** - *
-         * 采集指标值集合(fields作为字段名称与ValueRow映射)
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - @Override - public java.util.List - getValuesOrBuilderList() { - return values_; - } - - /** - *
-         * 采集指标值集合(fields作为字段名称与ValueRow映射)
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - @Override - public int getValuesCount() { - return values_.size(); - } - - /** - *
-         * 采集指标值集合(fields作为字段名称与ValueRow映射)
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - @Override - public ValueRow getValues(int index) { - return values_.get(index); - } - - /** - *
-         * 采集指标值集合(fields作为字段名称与ValueRow映射)
-         * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - @Override - public ValueRowOrBuilder getValuesOrBuilder( - int index) { - return values_.get(index); - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (id_ != 0L) { - output.writeUInt64(1, id_); - } - if (tenantId_ != 0L) { - output.writeUInt64(2, tenantId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(app_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, app_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metrics_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, metrics_); - } - if (priority_ != 0) { - output.writeUInt32(5, priority_); - } - if (time_ != 0L) { - output.writeUInt64(6, time_); - } - if (code_ != Code.SUCCESS.getNumber()) { - output.writeEnum(7, code_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msg_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, msg_); - } - for (int i = 0; i < fields_.size(); i++) { - output.writeMessage(9, fields_.get(i)); - } - for (int i = 0; i < values_.size(); i++) { - output.writeMessage(10, values_.get(i)); - } - unknownFields.writeTo(output); - } - - @Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (id_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, id_); - } - if (tenantId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(2, tenantId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(app_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, app_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metrics_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, metrics_); - } - if (priority_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(5, priority_); - } - if (time_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(6, time_); - } - if (code_ != Code.SUCCESS.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(7, code_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msg_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, msg_); - } - for (int i = 0; i < fields_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, fields_.get(i)); - } - for (int i = 0; i < values_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(10, values_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof MetricsData)) { - return super.equals(obj); - } - MetricsData other = (MetricsData) obj; - - if (getId() - != other.getId()) return false; - if (getTenantId() - != other.getTenantId()) return false; - if (!getApp() - .equals(other.getApp())) return false; - if (!getMetrics() - .equals(other.getMetrics())) return false; - if (getPriority() - != other.getPriority()) return false; - if (getTime() - != other.getTime()) return false; - if (code_ != other.code_) return false; - if (!getMsg() - .equals(other.getMsg())) return false; - if (!getFieldsList() - .equals(other.getFieldsList())) return false; - if (!getValuesList() - .equals(other.getValuesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getId()); - hash = (37 * hash) + TENANTID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTenantId()); - hash = (37 * hash) + APP_FIELD_NUMBER; - hash = (53 * hash) + getApp().hashCode(); - hash = (37 * hash) + METRICS_FIELD_NUMBER; - hash = (53 * hash) + getMetrics().hashCode(); - hash = (37 * hash) + PRIORITY_FIELD_NUMBER; - hash = (53 * hash) + getPriority(); - hash = (37 * hash) + TIME_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getTime()); - hash = (37 * hash) + CODE_FIELD_NUMBER; - hash = (53 * hash) + code_; - hash = (37 * hash) + MSG_FIELD_NUMBER; - hash = (53 * hash) + getMsg().hashCode(); - if (getFieldsCount() > 0) { - hash = (37 * hash) + FIELDS_FIELD_NUMBER; - hash = (53 * hash) + getFieldsList().hashCode(); - } - if (getValuesCount() > 0) { - hash = (37 * hash) + VALUES_FIELD_NUMBER; - hash = (53 * hash) + getValuesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static MetricsData parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static MetricsData parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static MetricsData parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static MetricsData parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static MetricsData parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static MetricsData parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static MetricsData parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static MetricsData parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static MetricsData parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static MetricsData parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static MetricsData parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static MetricsData parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(MetricsData prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code org.dromara.hertzbeat.common.entity.message.MetricsData} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:org.dromara.hertzbeat.common.entity.message.MetricsData) - MetricsDataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_fieldAccessorTable - .ensureFieldAccessorsInitialized( - MetricsData.class, Builder.class); - } - - // Construct using org.dromara.hertzbeat.common.entity.message.CollectRep.MetricsData.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getFieldsFieldBuilder(); - getValuesFieldBuilder(); - } - } - - @Override - public Builder clear() { - super.clear(); - id_ = 0L; - - tenantId_ = 0L; - - app_ = ""; - - metrics_ = ""; - - priority_ = 0; - - time_ = 0L; - - code_ = 0; - - msg_ = ""; - - if (fieldsBuilder_ == null) { - fields_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - fieldsBuilder_.clear(); - } - if (valuesBuilder_ == null) { - values_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - valuesBuilder_.clear(); - } - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_descriptor; - } - - @Override - public MetricsData getDefaultInstanceForType() { - return MetricsData.getDefaultInstance(); - } - - @Override - public MetricsData build() { - MetricsData result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public MetricsData buildPartial() { - MetricsData result = new MetricsData(this); - int from_bitField0_ = bitField0_; - result.id_ = id_; - result.tenantId_ = tenantId_; - result.app_ = app_; - result.metrics_ = metrics_; - result.priority_ = priority_; - result.time_ = time_; - result.code_ = code_; - result.msg_ = msg_; - if (fieldsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - fields_ = java.util.Collections.unmodifiableList(fields_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.fields_ = fields_; - } else { - result.fields_ = fieldsBuilder_.build(); - } - if (valuesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - values_ = java.util.Collections.unmodifiableList(values_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.values_ = values_; - } else { - result.values_ = valuesBuilder_.build(); - } - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof MetricsData) { - return mergeFrom((MetricsData) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(MetricsData other) { - if (other == MetricsData.getDefaultInstance()) return this; - if (other.getId() != 0L) { - setId(other.getId()); - } - if (other.getTenantId() != 0L) { - setTenantId(other.getTenantId()); - } - if (!other.getApp().isEmpty()) { - app_ = other.app_; - onChanged(); - } - if (!other.getMetrics().isEmpty()) { - metrics_ = other.metrics_; - onChanged(); - } - if (other.getPriority() != 0) { - setPriority(other.getPriority()); - } - if (other.getTime() != 0L) { - setTime(other.getTime()); - } - if (other.code_ != 0) { - setCodeValue(other.getCodeValue()); - } - if (!other.getMsg().isEmpty()) { - msg_ = other.msg_; - onChanged(); - } - if (fieldsBuilder_ == null) { - if (!other.fields_.isEmpty()) { - if (fields_.isEmpty()) { - fields_ = other.fields_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureFieldsIsMutable(); - fields_.addAll(other.fields_); - } - onChanged(); - } - } else { - if (!other.fields_.isEmpty()) { - if (fieldsBuilder_.isEmpty()) { - fieldsBuilder_.dispose(); - fieldsBuilder_ = null; - fields_ = other.fields_; - bitField0_ = (bitField0_ & ~0x00000001); - fieldsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getFieldsFieldBuilder() : null; - } else { - fieldsBuilder_.addAllMessages(other.fields_); - } - } - } - if (valuesBuilder_ == null) { - if (!other.values_.isEmpty()) { - if (values_.isEmpty()) { - values_ = other.values_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureValuesIsMutable(); - values_.addAll(other.values_); - } - onChanged(); - } - } else { - if (!other.values_.isEmpty()) { - if (valuesBuilder_.isEmpty()) { - valuesBuilder_.dispose(); - valuesBuilder_ = null; - values_ = other.values_; - bitField0_ = (bitField0_ & ~0x00000002); - valuesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getValuesFieldBuilder() : null; - } else { - valuesBuilder_.addAllMessages(other.values_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - MetricsData parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (MetricsData) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int bitField0_; - - private long id_; - - /** - *
-             * 监控的ID
-             * 
- * - * uint64 id = 1; - * - * @return The id. - */ - @Override - public long getId() { - return id_; - } - - /** - *
-             * 监控的ID
-             * 
- * - * uint64 id = 1; - * - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId(long value) { - - id_ = value; - onChanged(); - return this; - } - - /** - *
-             * 监控的ID
-             * 
- * - * uint64 id = 1; - * - * @return This builder for chaining. - */ - public Builder clearId() { - - id_ = 0L; - onChanged(); - return this; - } - - private long tenantId_; - - /** - *
-             * 所属租户ID
-             * 
- * - * uint64 tenantId = 2; - * - * @return The tenantId. - */ - @Override - public long getTenantId() { - return tenantId_; - } - - /** - *
-             * 所属租户ID
-             * 
- * - * uint64 tenantId = 2; - * - * @param value The tenantId to set. - * @return This builder for chaining. - */ - public Builder setTenantId(long value) { - - tenantId_ = value; - onChanged(); - return this; - } - - /** - *
-             * 所属租户ID
-             * 
- * - * uint64 tenantId = 2; - * - * @return This builder for chaining. - */ - public Builder clearTenantId() { - - tenantId_ = 0L; - onChanged(); - return this; - } - - private Object app_ = ""; - - /** - *
-             * 监控的类型 eg: linux | mysql | jvm
-             * 
- * - * string app = 3; - * - * @return The app. - */ - public String getApp() { - Object ref = app_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - app_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
-             * 监控的类型 eg: linux | mysql | jvm
-             * 
- * - * string app = 3; - * - * @return The bytes for app. - */ - public com.google.protobuf.ByteString - getAppBytes() { - Object ref = app_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - app_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
-             * 监控的类型 eg: linux | mysql | jvm
-             * 
- * - * string app = 3; - * - * @param value The app to set. - * @return This builder for chaining. - */ - public Builder setApp( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - app_ = value; - onChanged(); - return this; - } - - /** - *
-             * 监控的类型 eg: linux | mysql | jvm
-             * 
- * - * string app = 3; - * - * @return This builder for chaining. - */ - public Builder clearApp() { - - app_ = getDefaultInstance().getApp(); - onChanged(); - return this; - } - - /** - *
-             * 监控的类型 eg: linux | mysql | jvm
-             * 
- * - * string app = 3; - * - * @param value The bytes for app to set. - * @return This builder for chaining. - */ - public Builder setAppBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - app_ = value; - onChanged(); - return this; - } - - private Object metrics_ = ""; - - /** - *
-             * 监控采集的指标集合 eg: cpu | memory | health
-             * 
- * - * string metrics = 4; - * - * @return The metrics. - */ - public String getMetrics() { - Object ref = metrics_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - metrics_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
-             * 监控采集的指标集合 eg: cpu | memory | health
-             * 
- * - * string metrics = 4; - * - * @return The bytes for metrics. - */ - public com.google.protobuf.ByteString - getMetricsBytes() { - Object ref = metrics_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - metrics_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
-             * 监控采集的指标集合 eg: cpu | memory | health
-             * 
- * - * string metrics = 4; - * - * @param value The metrics to set. - * @return This builder for chaining. - */ - public Builder setMetrics( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - metrics_ = value; - onChanged(); - return this; - } - - /** - *
-             * 监控采集的指标集合 eg: cpu | memory | health
-             * 
- * - * string metrics = 4; - * - * @return This builder for chaining. - */ - public Builder clearMetrics() { - - metrics_ = getDefaultInstance().getMetrics(); - onChanged(); - return this; - } - - /** - *
-             * 监控采集的指标集合 eg: cpu | memory | health
-             * 
- * - * string metrics = 4; - * - * @param value The bytes for metrics to set. - * @return This builder for chaining. - */ - public Builder setMetricsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - metrics_ = value; - onChanged(); - return this; - } - - private int priority_; - - /** - *
-             * 监控采集指标集合的采集优先级>=0
-             * 
- * - * uint32 priority = 5; - * - * @return The priority. - */ - @Override - public int getPriority() { - return priority_; - } - - /** - *
-             * 监控采集指标集合的采集优先级>=0
-             * 
- * - * uint32 priority = 5; - * - * @param value The priority to set. - * @return This builder for chaining. - */ - public Builder setPriority(int value) { - - priority_ = value; - onChanged(); - return this; - } - - /** - *
-             * 监控采集指标集合的采集优先级>=0
-             * 
- * - * uint32 priority = 5; - * - * @return This builder for chaining. - */ - public Builder clearPriority() { - - priority_ = 0; - onChanged(); - return this; - } - - private long time_; - - /** - *
-             * 采集时间
-             * 
- * - * uint64 time = 6; - * - * @return The time. - */ - @Override - public long getTime() { - return time_; - } - - /** - *
-             * 采集时间
-             * 
- * - * uint64 time = 6; - * - * @param value The time to set. - * @return This builder for chaining. - */ - public Builder setTime(long value) { - - time_ = value; - onChanged(); - return this; - } - - /** - *
-             * 采集时间
-             * 
- * - * uint64 time = 6; - * - * @return This builder for chaining. - */ - public Builder clearTime() { - - time_ = 0L; - onChanged(); - return this; - } - - private int code_ = 0; - - /** - *
-             * 采集响应码
-             * 
- * - * .org.dromara.hertzbeat.common.entity.message.Code code = 7; - * - * @return The enum numeric value on the wire for code. - */ - @Override - public int getCodeValue() { - return code_; - } - - /** - *
-             * 采集响应码
-             * 
- * - * .org.dromara.hertzbeat.common.entity.message.Code code = 7; - * - * @param value The enum numeric value on the wire for code to set. - * @return This builder for chaining. - */ - public Builder setCodeValue(int value) { - - code_ = value; - onChanged(); - return this; - } - - /** - *
-             * 采集响应码
-             * 
- * - * .org.dromara.hertzbeat.common.entity.message.Code code = 7; - * - * @return The code. - */ - @Override - public Code getCode() { - @SuppressWarnings("deprecation") - Code result = Code.valueOf(code_); - return result == null ? Code.UNRECOGNIZED : result; - } - - /** - *
-             * 采集响应码
-             * 
- * - * .org.dromara.hertzbeat.common.entity.message.Code code = 7; - * - * @param value The code to set. - * @return This builder for chaining. - */ - public Builder setCode(Code value) { - if (value == null) { - throw new NullPointerException(); - } - - code_ = value.getNumber(); - onChanged(); - return this; - } - - /** - *
-             * 采集响应码
-             * 
- * - * .org.dromara.hertzbeat.common.entity.message.Code code = 7; - * - * @return This builder for chaining. - */ - public Builder clearCode() { - - code_ = 0; - onChanged(); - return this; - } - - private Object msg_ = ""; - - /** - *
-             * 采集响应信息
-             * 
- * - * string msg = 8; - * - * @return The msg. - */ - public String getMsg() { - Object ref = msg_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - msg_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
-             * 采集响应信息
-             * 
- * - * string msg = 8; - * - * @return The bytes for msg. - */ - public com.google.protobuf.ByteString - getMsgBytes() { - Object ref = msg_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - msg_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
-             * 采集响应信息
-             * 
- * - * string msg = 8; - * - * @param value The msg to set. - * @return This builder for chaining. - */ - public Builder setMsg( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - msg_ = value; - onChanged(); - return this; - } - - /** - *
-             * 采集响应信息
-             * 
- * - * string msg = 8; - * - * @return This builder for chaining. - */ - public Builder clearMsg() { - - msg_ = getDefaultInstance().getMsg(); - onChanged(); - return this; - } - - /** - *
-             * 采集响应信息
-             * 
- * - * string msg = 8; - * - * @param value The bytes for msg to set. - * @return This builder for chaining. - */ - public Builder setMsgBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - msg_ = value; - onChanged(); - return this; - } - - private java.util.List fields_ = - java.util.Collections.emptyList(); - - private void ensureFieldsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - fields_ = new java.util.ArrayList(fields_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - Field, Field.Builder, FieldOrBuilder> fieldsBuilder_; - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public java.util.List getFieldsList() { - if (fieldsBuilder_ == null) { - return java.util.Collections.unmodifiableList(fields_); - } else { - return fieldsBuilder_.getMessageList(); - } - } - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public int getFieldsCount() { - if (fieldsBuilder_ == null) { - return fields_.size(); - } else { - return fieldsBuilder_.getCount(); - } - } - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public Field getFields(int index) { - if (fieldsBuilder_ == null) { - return fields_.get(index); - } else { - return fieldsBuilder_.getMessage(index); - } - } - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public Builder setFields( - int index, Field value) { - if (fieldsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFieldsIsMutable(); - fields_.set(index, value); - onChanged(); - } else { - fieldsBuilder_.setMessage(index, value); - } - return this; - } - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public Builder setFields( - int index, Field.Builder builderForValue) { - if (fieldsBuilder_ == null) { - ensureFieldsIsMutable(); - fields_.set(index, builderForValue.build()); - onChanged(); - } else { - fieldsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public Builder addFields(Field value) { - if (fieldsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFieldsIsMutable(); - fields_.add(value); - onChanged(); - } else { - fieldsBuilder_.addMessage(value); - } - return this; - } - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public Builder addFields( - int index, Field value) { - if (fieldsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureFieldsIsMutable(); - fields_.add(index, value); - onChanged(); - } else { - fieldsBuilder_.addMessage(index, value); - } - return this; - } - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public Builder addFields( - Field.Builder builderForValue) { - if (fieldsBuilder_ == null) { - ensureFieldsIsMutable(); - fields_.add(builderForValue.build()); - onChanged(); - } else { - fieldsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public Builder addFields( - int index, Field.Builder builderForValue) { - if (fieldsBuilder_ == null) { - ensureFieldsIsMutable(); - fields_.add(index, builderForValue.build()); - onChanged(); - } else { - fieldsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public Builder addAllFields( - Iterable values) { - if (fieldsBuilder_ == null) { - ensureFieldsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, fields_); - onChanged(); - } else { - fieldsBuilder_.addAllMessages(values); - } - return this; - } - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public Builder clearFields() { - if (fieldsBuilder_ == null) { - fields_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - fieldsBuilder_.clear(); - } - return this; - } - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public Builder removeFields(int index) { - if (fieldsBuilder_ == null) { - ensureFieldsIsMutable(); - fields_.remove(index); - onChanged(); - } else { - fieldsBuilder_.remove(index); - } - return this; - } - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public Field.Builder getFieldsBuilder( - int index) { - return getFieldsFieldBuilder().getBuilder(index); - } - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public FieldOrBuilder getFieldsOrBuilder( - int index) { - if (fieldsBuilder_ == null) { - return fields_.get(index); - } else { - return fieldsBuilder_.getMessageOrBuilder(index); - } - } - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public java.util.List - getFieldsOrBuilderList() { - if (fieldsBuilder_ != null) { - return fieldsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(fields_); - } - } - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public Field.Builder addFieldsBuilder() { - return getFieldsFieldBuilder().addBuilder( - Field.getDefaultInstance()); - } - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public Field.Builder addFieldsBuilder( - int index) { - return getFieldsFieldBuilder().addBuilder( - index, Field.getDefaultInstance()); - } - - /** - *
-             * 采集指标名
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; - */ - public java.util.List - getFieldsBuilderList() { - return getFieldsFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - Field, Field.Builder, FieldOrBuilder> - getFieldsFieldBuilder() { - if (fieldsBuilder_ == null) { - fieldsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - Field, Field.Builder, FieldOrBuilder>( - fields_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - fields_ = null; - } - return fieldsBuilder_; - } - - private java.util.List values_ = - java.util.Collections.emptyList(); - - private void ensureValuesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - values_ = new java.util.ArrayList(values_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - ValueRow, ValueRow.Builder, ValueRowOrBuilder> valuesBuilder_; - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public java.util.List getValuesList() { - if (valuesBuilder_ == null) { - return java.util.Collections.unmodifiableList(values_); - } else { - return valuesBuilder_.getMessageList(); - } - } - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public int getValuesCount() { - if (valuesBuilder_ == null) { - return values_.size(); - } else { - return valuesBuilder_.getCount(); - } - } - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public ValueRow getValues(int index) { - if (valuesBuilder_ == null) { - return values_.get(index); - } else { - return valuesBuilder_.getMessage(index); - } - } - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public Builder setValues( - int index, ValueRow value) { - if (valuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValuesIsMutable(); - values_.set(index, value); - onChanged(); - } else { - valuesBuilder_.setMessage(index, value); - } - return this; - } - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public Builder setValues( - int index, ValueRow.Builder builderForValue) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.set(index, builderForValue.build()); - onChanged(); - } else { - valuesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public Builder addValues(ValueRow value) { - if (valuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValuesIsMutable(); - values_.add(value); - onChanged(); - } else { - valuesBuilder_.addMessage(value); - } - return this; - } - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public Builder addValues( - int index, ValueRow value) { - if (valuesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureValuesIsMutable(); - values_.add(index, value); - onChanged(); - } else { - valuesBuilder_.addMessage(index, value); - } - return this; - } - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public Builder addValues( - ValueRow.Builder builderForValue) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.add(builderForValue.build()); - onChanged(); - } else { - valuesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public Builder addValues( - int index, ValueRow.Builder builderForValue) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.add(index, builderForValue.build()); - onChanged(); - } else { - valuesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public Builder addAllValues( - Iterable values) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, values_); - onChanged(); - } else { - valuesBuilder_.addAllMessages(values); - } - return this; - } - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public Builder clearValues() { - if (valuesBuilder_ == null) { - values_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - valuesBuilder_.clear(); - } - return this; - } - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public Builder removeValues(int index) { - if (valuesBuilder_ == null) { - ensureValuesIsMutable(); - values_.remove(index); - onChanged(); - } else { - valuesBuilder_.remove(index); - } - return this; - } - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public ValueRow.Builder getValuesBuilder( - int index) { - return getValuesFieldBuilder().getBuilder(index); - } - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public ValueRowOrBuilder getValuesOrBuilder( - int index) { - if (valuesBuilder_ == null) { - return values_.get(index); - } else { - return valuesBuilder_.getMessageOrBuilder(index); - } - } - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public java.util.List - getValuesOrBuilderList() { - if (valuesBuilder_ != null) { - return valuesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(values_); - } - } - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public ValueRow.Builder addValuesBuilder() { - return getValuesFieldBuilder().addBuilder( - ValueRow.getDefaultInstance()); - } - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public ValueRow.Builder addValuesBuilder( - int index) { - return getValuesFieldBuilder().addBuilder( - index, ValueRow.getDefaultInstance()); - } - - /** - *
-             * 采集指标值集合(fields作为字段名称与ValueRow映射)
-             * 
- * - * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; - */ - public java.util.List - getValuesBuilderList() { - return getValuesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - ValueRow, ValueRow.Builder, ValueRowOrBuilder> - getValuesFieldBuilder() { - if (valuesBuilder_ == null) { - valuesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - ValueRow, ValueRow.Builder, ValueRowOrBuilder>( - values_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - values_ = null; - } - return valuesBuilder_; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:org.dromara.hertzbeat.common.entity.message.MetricsData) - } - - // @@protoc_insertion_point(class_scope:org.dromara.hertzbeat.common.entity.message.MetricsData) - private static final MetricsData DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new MetricsData(); - } - - public static MetricsData getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public MetricsData parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new MetricsData(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public MetricsData getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface FieldOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.dromara.hertzbeat.common.entity.message.Field) - com.google.protobuf.MessageOrBuilder { - - /** - *
-         * 指标采集字符名称
-         * 
- * - * string name = 1; - * - * @return The name. - */ - String getName(); - - /** - *
-         * 指标采集字符名称
-         * 
- * - * string name = 1; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
-         * 字段类型:0-number数字 1-string字符串
-         * 
- * - * uint32 type = 2; - * - * @return The type. - */ - int getType(); - - /** - *
-         * metric value unit
-         * 
- * - * string unit = 3; - * - * @return The unit. - */ - String getUnit(); - - /** - *
-         * metric value unit
-         * 
- * - * string unit = 3; - * - * @return The bytes for unit. - */ - com.google.protobuf.ByteString - getUnitBytes(); + return fields_; } - /** - * Protobuf type {@code org.dromara.hertzbeat.common.entity.message.Field} + *
+     * monitoring collect metric field
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; */ - public static final class Field extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:org.dromara.hertzbeat.common.entity.message.Field) - FieldOrBuilder { - private static final long serialVersionUID = 0L; - - // Use Field.newBuilder() to construct. - private Field(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Field() { - name_ = ""; - unit_ = ""; - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new Field(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - - private Field( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 16: { - - type_ = input.readUInt32(); - break; - } - case 26: { - String s = input.readStringRequireUtf8(); - - unit_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_Field_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_Field_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Field.class, Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile Object name_; - - /** - *
-         * 指标采集字符名称
-         * 
- * - * string name = 1; - * - * @return The name. - */ - @Override - public String getName() { - Object ref = name_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - - /** - *
-         * 指标采集字符名称
-         * 
- * - * string name = 1; - * - * @return The bytes for name. - */ - @Override - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int TYPE_FIELD_NUMBER = 2; - private int type_; - - /** - *
-         * 字段类型:0-number数字 1-string字符串
-         * 
- * - * uint32 type = 2; - * - * @return The type. - */ - @Override - public int getType() { - return type_; - } - - public static final int UNIT_FIELD_NUMBER = 3; - private volatile Object unit_; - - /** - *
-         * metric value unit
-         * 
- * - * string unit = 3; - * - * @return The unit. - */ - @Override - public String getUnit() { - Object ref = unit_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - unit_ = s; - return s; - } - } - - /** - *
-         * metric value unit
-         * 
- * - * string unit = 3; - * - * @return The bytes for unit. - */ - @Override - public com.google.protobuf.ByteString - getUnitBytes() { - Object ref = unit_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - unit_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (type_ != 0) { - output.writeUInt32(2, type_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unit_); - } - unknownFields.writeTo(output); - } - - @Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (type_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(2, type_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, unit_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof Field)) { - return super.equals(obj); - } - Field other = (Field) obj; - - if (!getName() - .equals(other.getName())) return false; - if (getType() - != other.getType()) return false; - if (!getUnit() - .equals(other.getUnit())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + getType(); - hash = (37 * hash) + UNIT_FIELD_NUMBER; - hash = (53 * hash) + getUnit().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static Field parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static Field parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static Field parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static Field parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static Field parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static Field parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static Field parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static Field parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - public static Field parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - - public static Field parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - public static Field parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - - public static Field parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @Override - public Builder newBuilderForType() { - return newBuilder(); - } - - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - - public static Builder newBuilder(Field prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code org.dromara.hertzbeat.common.entity.message.Field} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:org.dromara.hertzbeat.common.entity.message.Field) - FieldOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_Field_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_Field_fieldAccessorTable - .ensureFieldAccessorsInitialized( - Field.class, Builder.class); - } - - // Construct using org.dromara.hertzbeat.common.entity.message.CollectRep.Field.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - - @Override - public Builder clear() { - super.clear(); - name_ = ""; - - type_ = 0; - - unit_ = ""; - - return this; - } - - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_Field_descriptor; - } - - @Override - public Field getDefaultInstanceForType() { - return Field.getDefaultInstance(); - } - - @Override - public Field build() { - Field result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @Override - public Field buildPartial() { - Field result = new Field(this); - result.name_ = name_; - result.type_ = type_; - result.unit_ = unit_; - onBuilt(); - return result; - } - - @Override - public Builder clone() { - return super.clone(); - } - - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } - - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } - - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof Field) { - return mergeFrom((Field) other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(Field other) { - if (other == Field.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (other.getType() != 0) { - setType(other.getType()); - } - if (!other.getUnit().isEmpty()) { - unit_ = other.unit_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @Override - public final boolean isInitialized() { - return true; - } - - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Field parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (Field) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private Object name_ = ""; - - /** - *
-             * 指标采集字符名称
-             * 
- * - * string name = 1; - * - * @return The name. - */ - public String getName() { - Object ref = name_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
-             * 指标采集字符名称
-             * 
- * - * string name = 1; - * - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
-             * 指标采集字符名称
-             * 
- * - * string name = 1; - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - - /** - *
-             * 指标采集字符名称
-             * 
- * - * string name = 1; - * - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - - /** - *
-             * 指标采集字符名称
-             * 
- * - * string name = 1; - * - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private int type_; - - /** - *
-             * 字段类型:0-number数字 1-string字符串
-             * 
- * - * uint32 type = 2; - * - * @return The type. - */ - @Override - public int getType() { - return type_; - } - - /** - *
-             * 字段类型:0-number数字 1-string字符串
-             * 
- * - * uint32 type = 2; - * - * @param value The type to set. - * @return This builder for chaining. - */ - public Builder setType(int value) { - - type_ = value; - onChanged(); - return this; - } - - /** - *
-             * 字段类型:0-number数字 1-string字符串
-             * 
- * - * uint32 type = 2; - * - * @return This builder for chaining. - */ - public Builder clearType() { - - type_ = 0; - onChanged(); - return this; - } - - private Object unit_ = ""; - - /** - *
-             * metric value unit
-             * 
- * - * string unit = 3; - * - * @return The unit. - */ - public String getUnit() { - Object ref = unit_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - unit_ = s; - return s; - } else { - return (String) ref; - } - } - - /** - *
-             * metric value unit
-             * 
- * - * string unit = 3; - * - * @return The bytes for unit. - */ - public com.google.protobuf.ByteString - getUnitBytes() { - Object ref = unit_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - unit_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - /** - *
-             * metric value unit
-             * 
- * - * string unit = 3; - * - * @param value The unit to set. - * @return This builder for chaining. - */ - public Builder setUnit( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - unit_ = value; - onChanged(); - return this; - } - - /** - *
-             * metric value unit
-             * 
- * - * string unit = 3; - * - * @return This builder for chaining. - */ - public Builder clearUnit() { - - unit_ = getDefaultInstance().getUnit(); - onChanged(); - return this; - } - - /** - *
-             * metric value unit
-             * 
- * - * string unit = 3; - * - * @param value The bytes for unit to set. - * @return This builder for chaining. - */ - public Builder setUnitBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - unit_ = value; - onChanged(); - return this; - } - - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:org.dromara.hertzbeat.common.entity.message.Field) - } - - // @@protoc_insertion_point(class_scope:org.dromara.hertzbeat.common.entity.message.Field) - private static final Field DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new Field(); - } - - public static Field getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public Field parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Field(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @Override - public Field getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public interface ValueRowOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.dromara.hertzbeat.common.entity.message.ValueRow) - com.google.protobuf.MessageOrBuilder { - - /** - *
-         * 主键实例,唯一标识这行数据
-         * 
- * - * string instance = 1; - * - * @return The instance. - */ - String getInstance(); - - /** - *
-         * 主键实例,唯一标识这行数据
-         * 
- * - * string instance = 1; - * - * @return The bytes for instance. - */ - com.google.protobuf.ByteString - getInstanceBytes(); - - /** - *
-         * 采集指标值
-         * 
- * - * repeated string columns = 2; - * - * @return A list containing the columns. - */ - java.util.List - getColumnsList(); - - /** - *
-         * 采集指标值
-         * 
- * - * repeated string columns = 2; - * - * @return The count of columns. - */ - int getColumnsCount(); - - /** - *
-         * 采集指标值
-         * 
- * - * repeated string columns = 2; - * - * @param index The index of the element to return. - * @return The columns at the given index. - */ - String getColumns(int index); - - /** - *
-         * 采集指标值
-         * 
- * - * repeated string columns = 2; - * - * @param index The index of the value to return. - * @return The bytes of the columns at the given index. - */ - com.google.protobuf.ByteString - getColumnsBytes(int index); + @Override + public int getFieldsCount() { + return fields_.size(); } - /** - * Protobuf type {@code org.dromara.hertzbeat.common.entity.message.ValueRow} + *
+     * monitoring collect metric field
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; */ - public static final class ValueRow extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:org.dromara.hertzbeat.common.entity.message.ValueRow) - ValueRowOrBuilder { - private static final long serialVersionUID = 0L; - - // Use ValueRow.newBuilder() to construct. - private ValueRow(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private ValueRow() { - instance_ = ""; - columns_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @Override - @SuppressWarnings({"unused"}) - protected Object newInstance( - UnusedPrivateParameter unused) { - return new ValueRow(); - } - - @Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - - private ValueRow( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - String s = input.readStringRequireUtf8(); - - instance_ = s; - break; - } - case 18: { - String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - columns_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - columns_.add(s); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - columns_ = columns_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_descriptor; - } - - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ValueRow.class, Builder.class); - } - - public static final int INSTANCE_FIELD_NUMBER = 1; - private volatile Object instance_; - - /** - *
-         * 主键实例,唯一标识这行数据
-         * 
- * - * string instance = 1; - * - * @return The instance. - */ - @Override - public String getInstance() { - Object ref = instance_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - instance_ = s; - return s; - } - } - - /** - *
-         * 主键实例,唯一标识这行数据
-         * 
- * - * string instance = 1; - * - * @return The bytes for instance. - */ - @Override - public com.google.protobuf.ByteString - getInstanceBytes() { - Object ref = instance_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - instance_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int COLUMNS_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList columns_; - - /** - *
-         * 采集指标值
-         * 
- * - * repeated string columns = 2; - * - * @return A list containing the columns. - */ - public com.google.protobuf.ProtocolStringList - getColumnsList() { - return columns_; - } - - /** - *
-         * 采集指标值
-         * 
- * - * repeated string columns = 2; - * - * @return The count of columns. - */ - public int getColumnsCount() { - return columns_.size(); - } - - /** - *
-         * 采集指标值
-         * 
- * - * repeated string columns = 2; - * - * @param index The index of the element to return. - * @return The columns at the given index. - */ - public String getColumns(int index) { - return columns_.get(index); - } - - /** - *
-         * 采集指标值
-         * 
- * - * repeated string columns = 2; - * - * @param index The index of the value to return. - * @return The bytes of the columns at the given index. - */ - public com.google.protobuf.ByteString - getColumnsBytes(int index) { - return columns_.getByteString(index); - } - - private byte memoizedIsInitialized = -1; - - @Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instance_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, instance_); - } - for (int i = 0; i < columns_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, columns_.getRaw(i)); - } - unknownFields.writeTo(output); - } - - @Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(instance_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, instance_); - } - { - int dataSize = 0; - for (int i = 0; i < columns_.size(); i++) { - dataSize += computeStringSizeNoTag(columns_.getRaw(i)); - } - size += dataSize; - size += 1 * getColumnsList().size(); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @Override - public boolean equals(final Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof ValueRow)) { - return super.equals(obj); - } - ValueRow other = (ValueRow) obj; - - if (!getInstance() - .equals(other.getInstance())) return false; - if (!getColumnsList() - .equals(other.getColumnsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + INSTANCE_FIELD_NUMBER; - hash = (53 * hash) + getInstance().hashCode(); - if (getColumnsCount() > 0) { - hash = (37 * hash) + COLUMNS_FIELD_NUMBER; - hash = (53 * hash) + getColumnsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static ValueRow parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static ValueRow parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static ValueRow parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + @Override + public Field getFields(int index) { + return fields_.get(index); + } + /** + *
+     * monitoring collect metric field
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + @Override + public FieldOrBuilder getFieldsOrBuilder( + int index) { + return fields_.get(index); + } - public static ValueRow parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + public static final int VALUES_FIELD_NUMBER = 10; + private java.util.List values_; + /** + *
+     * monitoring collect metric data, mapping with the fields
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + @Override + public java.util.List getValuesList() { + return values_; + } + /** + *
+     * monitoring collect metric data, mapping with the fields
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + @Override + public java.util.List + getValuesOrBuilderList() { + return values_; + } + /** + *
+     * monitoring collect metric data, mapping with the fields
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + @Override + public int getValuesCount() { + return values_.size(); + } + /** + *
+     * monitoring collect metric data, mapping with the fields
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + @Override + public ValueRow getValues(int index) { + return values_.get(index); + } + /** + *
+     * monitoring collect metric data, mapping with the fields
+     * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + @Override + public ValueRowOrBuilder getValuesOrBuilder( + int index) { + return values_.get(index); + } - public static ValueRow parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; - public static ValueRow parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + memoizedIsInitialized = 1; + return true; + } - public static ValueRow parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (id_ != 0L) { + output.writeUInt64(1, id_); + } + if (tenantId_ != 0L) { + output.writeUInt64(2, tenantId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(app_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, app_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metrics_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, metrics_); + } + if (priority_ != 0) { + output.writeUInt32(5, priority_); + } + if (time_ != 0L) { + output.writeUInt64(6, time_); + } + if (code_ != Code.SUCCESS.getNumber()) { + output.writeEnum(7, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msg_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, msg_); + } + for (int i = 0; i < fields_.size(); i++) { + output.writeMessage(9, fields_.get(i)); + } + for (int i = 0; i < values_.size(); i++) { + output.writeMessage(10, values_.get(i)); + } + unknownFields.writeTo(output); + } - public static ValueRow parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, id_); + } + if (tenantId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, tenantId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(app_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, app_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metrics_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, metrics_); + } + if (priority_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(5, priority_); + } + if (time_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(6, time_); + } + if (code_ != Code.SUCCESS.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(7, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(msg_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, msg_); + } + for (int i = 0; i < fields_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, fields_.get(i)); + } + for (int i = 0; i < values_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, values_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } - public static ValueRow parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof MetricsData)) { + return super.equals(obj); + } + MetricsData other = (MetricsData) obj; + + if (getId() + != other.getId()) return false; + if (getTenantId() + != other.getTenantId()) return false; + if (!getApp() + .equals(other.getApp())) return false; + if (!getMetrics() + .equals(other.getMetrics())) return false; + if (getPriority() + != other.getPriority()) return false; + if (getTime() + != other.getTime()) return false; + if (code_ != other.code_) return false; + if (!getMsg() + .equals(other.getMsg())) return false; + if (!getFieldsList() + .equals(other.getFieldsList())) return false; + if (!getValuesList() + .equals(other.getValuesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } - public static ValueRow parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getId()); + hash = (37 * hash) + TENANTID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTenantId()); + hash = (37 * hash) + APP_FIELD_NUMBER; + hash = (53 * hash) + getApp().hashCode(); + hash = (37 * hash) + METRICS_FIELD_NUMBER; + hash = (53 * hash) + getMetrics().hashCode(); + hash = (37 * hash) + PRIORITY_FIELD_NUMBER; + hash = (53 * hash) + getPriority(); + hash = (37 * hash) + TIME_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTime()); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + code_; + hash = (37 * hash) + MSG_FIELD_NUMBER; + hash = (53 * hash) + getMsg().hashCode(); + if (getFieldsCount() > 0) { + hash = (37 * hash) + FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getFieldsList().hashCode(); + } + if (getValuesCount() > 0) { + hash = (37 * hash) + VALUES_FIELD_NUMBER; + hash = (53 * hash) + getValuesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } - public static ValueRow parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } + public static MetricsData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static MetricsData parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static MetricsData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static MetricsData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static MetricsData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static MetricsData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static MetricsData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static MetricsData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static MetricsData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static MetricsData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static MetricsData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static MetricsData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } - public static ValueRow parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(MetricsData prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } - @Override - public Builder newBuilderForType() { - return newBuilder(); + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.dromara.hertzbeat.common.entity.message.MetricsData} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.dromara.hertzbeat.common.entity.message.MetricsData) + MetricsDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + MetricsData.class, Builder.class); + } + + // Construct using org.dromara.hertzbeat.common.entity.message.CollectRep.MetricsData.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getFieldsFieldBuilder(); + getValuesFieldBuilder(); + } + } + @Override + public Builder clear() { + super.clear(); + id_ = 0L; + + tenantId_ = 0L; + + app_ = ""; + + metrics_ = ""; + + priority_ = 0; + + time_ = 0L; + + code_ = 0; + + msg_ = ""; + + if (fieldsBuilder_ == null) { + fields_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + fieldsBuilder_.clear(); + } + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + valuesBuilder_.clear(); + } + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_descriptor; + } + + @Override + public MetricsData getDefaultInstanceForType() { + return MetricsData.getDefaultInstance(); + } + + @Override + public MetricsData build() { + MetricsData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public MetricsData buildPartial() { + MetricsData result = new MetricsData(this); + int from_bitField0_ = bitField0_; + result.id_ = id_; + result.tenantId_ = tenantId_; + result.app_ = app_; + result.metrics_ = metrics_; + result.priority_ = priority_; + result.time_ = time_; + result.code_ = code_; + result.msg_ = msg_; + if (fieldsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + fields_ = java.util.Collections.unmodifiableList(fields_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.fields_ = fields_; + } else { + result.fields_ = fieldsBuilder_.build(); + } + if (valuesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + values_ = java.util.Collections.unmodifiableList(values_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.values_ = values_; + } else { + result.values_ = valuesBuilder_.build(); + } + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof MetricsData) { + return mergeFrom((MetricsData)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(MetricsData other) { + if (other == MetricsData.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (other.getTenantId() != 0L) { + setTenantId(other.getTenantId()); + } + if (!other.getApp().isEmpty()) { + app_ = other.app_; + onChanged(); + } + if (!other.getMetrics().isEmpty()) { + metrics_ = other.metrics_; + onChanged(); + } + if (other.getPriority() != 0) { + setPriority(other.getPriority()); + } + if (other.getTime() != 0L) { + setTime(other.getTime()); + } + if (other.code_ != 0) { + setCodeValue(other.getCodeValue()); + } + if (!other.getMsg().isEmpty()) { + msg_ = other.msg_; + onChanged(); + } + if (fieldsBuilder_ == null) { + if (!other.fields_.isEmpty()) { + if (fields_.isEmpty()) { + fields_ = other.fields_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFieldsIsMutable(); + fields_.addAll(other.fields_); + } + onChanged(); + } + } else { + if (!other.fields_.isEmpty()) { + if (fieldsBuilder_.isEmpty()) { + fieldsBuilder_.dispose(); + fieldsBuilder_ = null; + fields_ = other.fields_; + bitField0_ = (bitField0_ & ~0x00000001); + fieldsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFieldsFieldBuilder() : null; + } else { + fieldsBuilder_.addAllMessages(other.fields_); + } + } } + if (valuesBuilder_ == null) { + if (!other.values_.isEmpty()) { + if (values_.isEmpty()) { + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureValuesIsMutable(); + values_.addAll(other.values_); + } + onChanged(); + } + } else { + if (!other.values_.isEmpty()) { + if (valuesBuilder_.isEmpty()) { + valuesBuilder_.dispose(); + valuesBuilder_ = null; + values_ = other.values_; + bitField0_ = (bitField0_ & ~0x00000002); + valuesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getValuesFieldBuilder() : null; + } else { + valuesBuilder_.addAllMessages(other.values_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + MetricsData parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (MetricsData) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private long id_ ; + /** + *
+       * monitoring id
+       * 
+ * + * uint64 id = 1; + * @return The id. + */ + @Override + public long getId() { + return id_; + } + /** + *
+       * monitoring id
+       * 
+ * + * uint64 id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { + + id_ = value; + onChanged(); + return this; + } + /** + *
+       * monitoring id
+       * 
+ * + * uint64 id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = 0L; + onChanged(); + return this; + } + + private long tenantId_ ; + /** + *
+       * tenant id
+       * 
+ * + * uint64 tenantId = 2; + * @return The tenantId. + */ + @Override + public long getTenantId() { + return tenantId_; + } + /** + *
+       * tenant id
+       * 
+ * + * uint64 tenantId = 2; + * @param value The tenantId to set. + * @return This builder for chaining. + */ + public Builder setTenantId(long value) { + + tenantId_ = value; + onChanged(); + return this; + } + /** + *
+       * tenant id
+       * 
+ * + * uint64 tenantId = 2; + * @return This builder for chaining. + */ + public Builder clearTenantId() { + + tenantId_ = 0L; + onChanged(); + return this; + } + + private Object app_ = ""; + /** + *
+       * monitoring app eg: linux | mysql | jvm
+       * 
+ * + * string app = 3; + * @return The app. + */ + public String getApp() { + Object ref = app_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + app_ = s; + return s; + } else { + return (String) ref; + } + } + /** + *
+       * monitoring app eg: linux | mysql | jvm
+       * 
+ * + * string app = 3; + * @return The bytes for app. + */ + public com.google.protobuf.ByteString + getAppBytes() { + Object ref = app_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + app_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * monitoring app eg: linux | mysql | jvm
+       * 
+ * + * string app = 3; + * @param value The app to set. + * @return This builder for chaining. + */ + public Builder setApp( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + app_ = value; + onChanged(); + return this; + } + /** + *
+       * monitoring app eg: linux | mysql | jvm
+       * 
+ * + * string app = 3; + * @return This builder for chaining. + */ + public Builder clearApp() { + + app_ = getDefaultInstance().getApp(); + onChanged(); + return this; + } + /** + *
+       * monitoring app eg: linux | mysql | jvm
+       * 
+ * + * string app = 3; + * @param value The bytes for app to set. + * @return This builder for chaining. + */ + public Builder setAppBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + app_ = value; + onChanged(); + return this; + } + + private Object metrics_ = ""; + /** + *
+       * monitoring metrics eg: cpu | memory | health
+       * 
+ * + * string metrics = 4; + * @return The metrics. + */ + public String getMetrics() { + Object ref = metrics_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + metrics_ = s; + return s; + } else { + return (String) ref; + } + } + /** + *
+       * monitoring metrics eg: cpu | memory | health
+       * 
+ * + * string metrics = 4; + * @return The bytes for metrics. + */ + public com.google.protobuf.ByteString + getMetricsBytes() { + Object ref = metrics_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + metrics_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * monitoring metrics eg: cpu | memory | health
+       * 
+ * + * string metrics = 4; + * @param value The metrics to set. + * @return This builder for chaining. + */ + public Builder setMetrics( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + metrics_ = value; + onChanged(); + return this; + } + /** + *
+       * monitoring metrics eg: cpu | memory | health
+       * 
+ * + * string metrics = 4; + * @return This builder for chaining. + */ + public Builder clearMetrics() { + + metrics_ = getDefaultInstance().getMetrics(); + onChanged(); + return this; + } + /** + *
+       * monitoring metrics eg: cpu | memory | health
+       * 
+ * + * string metrics = 4; + * @param value The bytes for metrics to set. + * @return This builder for chaining. + */ + public Builder setMetricsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + metrics_ = value; + onChanged(); + return this; + } + + private int priority_ ; + /** + *
+       * monitoring collect priority >=0
+       * 
+ * + * uint32 priority = 5; + * @return The priority. + */ + @Override + public int getPriority() { + return priority_; + } + /** + *
+       * monitoring collect priority >=0
+       * 
+ * + * uint32 priority = 5; + * @param value The priority to set. + * @return This builder for chaining. + */ + public Builder setPriority(int value) { + + priority_ = value; + onChanged(); + return this; + } + /** + *
+       * monitoring collect priority >=0
+       * 
+ * + * uint32 priority = 5; + * @return This builder for chaining. + */ + public Builder clearPriority() { + + priority_ = 0; + onChanged(); + return this; + } + + private long time_ ; + /** + *
+       * collect timestamp
+       * 
+ * + * uint64 time = 6; + * @return The time. + */ + @Override + public long getTime() { + return time_; + } + /** + *
+       * collect timestamp
+       * 
+ * + * uint64 time = 6; + * @param value The time to set. + * @return This builder for chaining. + */ + public Builder setTime(long value) { + + time_ = value; + onChanged(); + return this; + } + /** + *
+       * collect timestamp
+       * 
+ * + * uint64 time = 6; + * @return This builder for chaining. + */ + public Builder clearTime() { + + time_ = 0L; + onChanged(); + return this; + } + + private int code_ = 0; + /** + *
+       * collect response code
+       * 
+ * + * .org.dromara.hertzbeat.common.entity.message.Code code = 7; + * @return The enum numeric value on the wire for code. + */ + @Override public int getCodeValue() { + return code_; + } + /** + *
+       * collect response code
+       * 
+ * + * .org.dromara.hertzbeat.common.entity.message.Code code = 7; + * @param value The enum numeric value on the wire for code to set. + * @return This builder for chaining. + */ + public Builder setCodeValue(int value) { + + code_ = value; + onChanged(); + return this; + } + /** + *
+       * collect response code
+       * 
+ * + * .org.dromara.hertzbeat.common.entity.message.Code code = 7; + * @return The code. + */ + @Override + public Code getCode() { + @SuppressWarnings("deprecation") + Code result = Code.valueOf(code_); + return result == null ? Code.UNRECOGNIZED : result; + } + /** + *
+       * collect response code
+       * 
+ * + * .org.dromara.hertzbeat.common.entity.message.Code code = 7; + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(Code value) { + if (value == null) { + throw new NullPointerException(); + } + + code_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       * collect response code
+       * 
+ * + * .org.dromara.hertzbeat.common.entity.message.Code code = 7; + * @return This builder for chaining. + */ + public Builder clearCode() { + + code_ = 0; + onChanged(); + return this; + } + + private Object msg_ = ""; + /** + *
+       * collect response error message
+       * 
+ * + * string msg = 8; + * @return The msg. + */ + public String getMsg() { + Object ref = msg_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + msg_ = s; + return s; + } else { + return (String) ref; + } + } + /** + *
+       * collect response error message
+       * 
+ * + * string msg = 8; + * @return The bytes for msg. + */ + public com.google.protobuf.ByteString + getMsgBytes() { + Object ref = msg_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + msg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * collect response error message
+       * 
+ * + * string msg = 8; + * @param value The msg to set. + * @return This builder for chaining. + */ + public Builder setMsg( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + msg_ = value; + onChanged(); + return this; + } + /** + *
+       * collect response error message
+       * 
+ * + * string msg = 8; + * @return This builder for chaining. + */ + public Builder clearMsg() { + + msg_ = getDefaultInstance().getMsg(); + onChanged(); + return this; + } + /** + *
+       * collect response error message
+       * 
+ * + * string msg = 8; + * @param value The bytes for msg to set. + * @return This builder for chaining. + */ + public Builder setMsgBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + msg_ = value; + onChanged(); + return this; + } + + private java.util.List fields_ = + java.util.Collections.emptyList(); + private void ensureFieldsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + fields_ = new java.util.ArrayList(fields_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Field, Field.Builder, FieldOrBuilder> fieldsBuilder_; + + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public java.util.List getFieldsList() { + if (fieldsBuilder_ == null) { + return java.util.Collections.unmodifiableList(fields_); + } else { + return fieldsBuilder_.getMessageList(); + } + } + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public int getFieldsCount() { + if (fieldsBuilder_ == null) { + return fields_.size(); + } else { + return fieldsBuilder_.getCount(); + } + } + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public Field getFields(int index) { + if (fieldsBuilder_ == null) { + return fields_.get(index); + } else { + return fieldsBuilder_.getMessage(index); + } + } + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public Builder setFields( + int index, Field value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.set(index, value); + onChanged(); + } else { + fieldsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public Builder setFields( + int index, Field.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.set(index, builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public Builder addFields(Field value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.add(value); + onChanged(); + } else { + fieldsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public Builder addFields( + int index, Field value) { + if (fieldsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.add(index, value); + onChanged(); + } else { + fieldsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public Builder addFields( + Field.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public Builder addFields( + int index, Field.Builder builderForValue) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.add(index, builderForValue.build()); + onChanged(); + } else { + fieldsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public Builder addAllFields( + Iterable values) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, fields_); + onChanged(); + } else { + fieldsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public Builder clearFields() { + if (fieldsBuilder_ == null) { + fields_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + fieldsBuilder_.clear(); + } + return this; + } + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public Builder removeFields(int index) { + if (fieldsBuilder_ == null) { + ensureFieldsIsMutable(); + fields_.remove(index); + onChanged(); + } else { + fieldsBuilder_.remove(index); + } + return this; + } + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public Field.Builder getFieldsBuilder( + int index) { + return getFieldsFieldBuilder().getBuilder(index); + } + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public FieldOrBuilder getFieldsOrBuilder( + int index) { + if (fieldsBuilder_ == null) { + return fields_.get(index); } else { + return fieldsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public java.util.List + getFieldsOrBuilderList() { + if (fieldsBuilder_ != null) { + return fieldsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fields_); + } + } + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public Field.Builder addFieldsBuilder() { + return getFieldsFieldBuilder().addBuilder( + Field.getDefaultInstance()); + } + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public Field.Builder addFieldsBuilder( + int index) { + return getFieldsFieldBuilder().addBuilder( + index, Field.getDefaultInstance()); + } + /** + *
+       * monitoring collect metric field
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.Field fields = 9; + */ + public java.util.List + getFieldsBuilderList() { + return getFieldsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + Field, Field.Builder, FieldOrBuilder> + getFieldsFieldBuilder() { + if (fieldsBuilder_ == null) { + fieldsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + Field, Field.Builder, FieldOrBuilder>( + fields_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + fields_ = null; + } + return fieldsBuilder_; + } + + private java.util.List values_ = + java.util.Collections.emptyList(); + private void ensureValuesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + values_ = new java.util.ArrayList(values_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + ValueRow, ValueRow.Builder, ValueRowOrBuilder> valuesBuilder_; + + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public java.util.List getValuesList() { + if (valuesBuilder_ == null) { + return java.util.Collections.unmodifiableList(values_); + } else { + return valuesBuilder_.getMessageList(); + } + } + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public int getValuesCount() { + if (valuesBuilder_ == null) { + return values_.size(); + } else { + return valuesBuilder_.getCount(); + } + } + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public ValueRow getValues(int index) { + if (valuesBuilder_ == null) { + return values_.get(index); + } else { + return valuesBuilder_.getMessage(index); + } + } + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public Builder setValues( + int index, ValueRow value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.set(index, value); + onChanged(); + } else { + valuesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public Builder setValues( + int index, ValueRow.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.set(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public Builder addValues(ValueRow value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(value); + onChanged(); + } else { + valuesBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public Builder addValues( + int index, ValueRow value) { + if (valuesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureValuesIsMutable(); + values_.add(index, value); + onChanged(); + } else { + valuesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public Builder addValues( + ValueRow.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public Builder addValues( + int index, ValueRow.Builder builderForValue) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.add(index, builderForValue.build()); + onChanged(); + } else { + valuesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public Builder addAllValues( + Iterable values) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, values_); + onChanged(); + } else { + valuesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public Builder clearValues() { + if (valuesBuilder_ == null) { + values_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + valuesBuilder_.clear(); + } + return this; + } + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public Builder removeValues(int index) { + if (valuesBuilder_ == null) { + ensureValuesIsMutable(); + values_.remove(index); + onChanged(); + } else { + valuesBuilder_.remove(index); + } + return this; + } + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public ValueRow.Builder getValuesBuilder( + int index) { + return getValuesFieldBuilder().getBuilder(index); + } + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public ValueRowOrBuilder getValuesOrBuilder( + int index) { + if (valuesBuilder_ == null) { + return values_.get(index); } else { + return valuesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public java.util.List + getValuesOrBuilderList() { + if (valuesBuilder_ != null) { + return valuesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(values_); + } + } + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public ValueRow.Builder addValuesBuilder() { + return getValuesFieldBuilder().addBuilder( + ValueRow.getDefaultInstance()); + } + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public ValueRow.Builder addValuesBuilder( + int index) { + return getValuesFieldBuilder().addBuilder( + index, ValueRow.getDefaultInstance()); + } + /** + *
+       * monitoring collect metric data, mapping with the fields
+       * 
+ * + * repeated .org.dromara.hertzbeat.common.entity.message.ValueRow values = 10; + */ + public java.util.List + getValuesBuilderList() { + return getValuesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + ValueRow, ValueRow.Builder, ValueRowOrBuilder> + getValuesFieldBuilder() { + if (valuesBuilder_ == null) { + valuesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + ValueRow, ValueRow.Builder, ValueRowOrBuilder>( + values_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + values_ = null; + } + return valuesBuilder_; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.dromara.hertzbeat.common.entity.message.MetricsData) + } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } + // @@protoc_insertion_point(class_scope:org.dromara.hertzbeat.common.entity.message.MetricsData) + private static final MetricsData DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new MetricsData(); + } - public static Builder newBuilder(ValueRow prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } + public static MetricsData getDefaultInstance() { + return DEFAULT_INSTANCE; + } - @Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public MetricsData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MetricsData(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } - @Override - protected Builder newBuilderForType( - BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } - /** - * Protobuf type {@code org.dromara.hertzbeat.common.entity.message.ValueRow} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:org.dromara.hertzbeat.common.entity.message.ValueRow) - ValueRowOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_descriptor; - } + @Override + public MetricsData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } - @Override - protected FieldAccessorTable - internalGetFieldAccessorTable() { - return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_fieldAccessorTable - .ensureFieldAccessorsInitialized( - ValueRow.class, Builder.class); - } + } - // Construct using org.dromara.hertzbeat.common.entity.message.CollectRep.ValueRow.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + public interface FieldOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.dromara.hertzbeat.common.entity.message.Field) + com.google.protobuf.MessageOrBuilder { - private Builder( - BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } + /** + *
+     * monitoring collect metric field name
+     * 
+ * + * string name = 1; + * @return The name. + */ + String getName(); + /** + *
+     * monitoring collect metric field name
+     * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } + /** + *
+     * monitoring collect metrics field type, 0-number 1-string
+     * 
+ * + * uint32 type = 2; + * @return The type. + */ + int getType(); - @Override - public Builder clear() { - super.clear(); - instance_ = ""; + /** + *
+     * monitoring collect metrics field unit, % MB GB TB S...
+     * 
+ * + * string unit = 3; + * @return The unit. + */ + String getUnit(); + /** + *
+     * monitoring collect metrics field unit, % MB GB TB S...
+     * 
+ * + * string unit = 3; + * @return The bytes for unit. + */ + com.google.protobuf.ByteString + getUnitBytes(); - columns_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } + /** + *
+     * is label field
+     * 
+ * + * bool label = 4; + * @return The label. + */ + boolean getLabel(); + } + /** + * Protobuf type {@code org.dromara.hertzbeat.common.entity.message.Field} + */ + public static final class Field extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.dromara.hertzbeat.common.entity.message.Field) + FieldOrBuilder { + private static final long serialVersionUID = 0L; + // Use Field.newBuilder() to construct. + private Field(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Field() { + name_ = ""; + unit_ = ""; + } - @Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_descriptor; - } + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new Field(); + } - @Override - public ValueRow getDefaultInstanceForType() { - return ValueRow.getDefaultInstance(); - } + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Field( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: { + + type_ = input.readUInt32(); + break; + } + case 26: { + String s = input.readStringRequireUtf8(); + + unit_ = s; + break; + } + case 32: { + + label_ = input.readBool(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_Field_descriptor; + } - @Override - public ValueRow build() { - ValueRow result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_Field_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Field.class, Builder.class); + } - @Override - public ValueRow buildPartial() { - ValueRow result = new ValueRow(this); - int from_bitField0_ = bitField0_; - result.instance_ = instance_; - if (((bitField0_ & 0x00000001) != 0)) { - columns_ = columns_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.columns_ = columns_; - onBuilt(); - return result; - } + public static final int NAME_FIELD_NUMBER = 1; + private volatile Object name_; + /** + *
+     * monitoring collect metric field name
+     * 
+ * + * string name = 1; + * @return The name. + */ + @Override + public String getName() { + Object ref = name_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+     * monitoring collect metric field name
+     * 
+ * + * string name = 1; + * @return The bytes for name. + */ + @Override + public com.google.protobuf.ByteString + getNameBytes() { + Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } - @Override - public Builder clone() { - return super.clone(); - } + public static final int TYPE_FIELD_NUMBER = 2; + private int type_; + /** + *
+     * monitoring collect metrics field type, 0-number 1-string
+     * 
+ * + * uint32 type = 2; + * @return The type. + */ + @Override + public int getType() { + return type_; + } - @Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.setField(field, value); - } + public static final int UNIT_FIELD_NUMBER = 3; + private volatile Object unit_; + /** + *
+     * monitoring collect metrics field unit, % MB GB TB S...
+     * 
+ * + * string unit = 3; + * @return The unit. + */ + @Override + public String getUnit() { + Object ref = unit_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + unit_ = s; + return s; + } + } + /** + *
+     * monitoring collect metrics field unit, % MB GB TB S...
+     * 
+ * + * string unit = 3; + * @return The bytes for unit. + */ + @Override + public com.google.protobuf.ByteString + getUnitBytes() { + Object ref = unit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + unit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } - @Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } + public static final int LABEL_FIELD_NUMBER = 4; + private boolean label_; + /** + *
+     * is label field
+     * 
+ * + * bool label = 4; + * @return The label. + */ + @Override + public boolean getLabel() { + return label_; + } - @Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; - @Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { - return super.setRepeatedField(field, index, value); - } + memoizedIsInitialized = 1; + return true; + } - @Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { - return super.addRepeatedField(field, value); - } + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (type_ != 0) { + output.writeUInt32(2, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unit_); + } + if (label_ != false) { + output.writeBool(4, label_); + } + unknownFields.writeTo(output); + } - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof ValueRow) { - return mergeFrom((ValueRow) other); - } else { - super.mergeFrom(other); - return this; - } - } + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (type_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, unit_); + } + if (label_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(4, label_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } - public Builder mergeFrom(ValueRow other) { - if (other == ValueRow.getDefaultInstance()) return this; - if (!other.getInstance().isEmpty()) { - instance_ = other.instance_; - onChanged(); - } - if (!other.columns_.isEmpty()) { - if (columns_.isEmpty()) { - columns_ = other.columns_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureColumnsIsMutable(); - columns_.addAll(other.columns_); - } - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Field)) { + return super.equals(obj); + } + Field other = (Field) obj; + + if (!getName() + .equals(other.getName())) return false; + if (getType() + != other.getType()) return false; + if (!getUnit() + .equals(other.getUnit())) return false; + if (getLabel() + != other.getLabel()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } - @Override - public final boolean isInitialized() { - return true; - } + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType(); + hash = (37 * hash) + UNIT_FIELD_NUMBER; + hash = (53 * hash) + getUnit().hashCode(); + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getLabel()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } - @Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - ValueRow parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (ValueRow) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } + public static Field parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Field parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Field parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Field parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Field parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Field parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Field parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static Field parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static Field parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static Field parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static Field parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static Field parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } - private int bitField0_; - - private Object instance_ = ""; - - /** - *
-             * 主键实例,唯一标识这行数据
-             * 
- * - * string instance = 1; - * - * @return The instance. - */ - public String getInstance() { - Object ref = instance_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - instance_ = s; - return s; - } else { - return (String) ref; - } - } + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Field prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } - /** - *
-             * 主键实例,唯一标识这行数据
-             * 
- * - * string instance = 1; - * - * @return The bytes for instance. - */ - public com.google.protobuf.ByteString - getInstanceBytes() { - Object ref = instance_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (String) ref); - instance_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.dromara.hertzbeat.common.entity.message.Field} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.dromara.hertzbeat.common.entity.message.Field) + FieldOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_Field_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_Field_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Field.class, Builder.class); + } + + // Construct using org.dromara.hertzbeat.common.entity.message.CollectRep.Field.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @Override + public Builder clear() { + super.clear(); + name_ = ""; + + type_ = 0; + + unit_ = ""; + + label_ = false; + + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_Field_descriptor; + } + + @Override + public Field getDefaultInstanceForType() { + return Field.getDefaultInstance(); + } + + @Override + public Field build() { + Field result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Field buildPartial() { + Field result = new Field(this); + result.name_ = name_; + result.type_ = type_; + result.unit_ = unit_; + result.label_ = label_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Field) { + return mergeFrom((Field)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Field other) { + if (other == Field.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getType() != 0) { + setType(other.getType()); + } + if (!other.getUnit().isEmpty()) { + unit_ = other.unit_; + onChanged(); + } + if (other.getLabel() != false) { + setLabel(other.getLabel()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Field parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (Field) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private Object name_ = ""; + /** + *
+       * monitoring collect metric field name
+       * 
+ * + * string name = 1; + * @return The name. + */ + public String getName() { + Object ref = name_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (String) ref; + } + } + /** + *
+       * monitoring collect metric field name
+       * 
+ * + * string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * monitoring collect metric field name
+       * 
+ * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+       * monitoring collect metric field name
+       * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+       * monitoring collect metric field name
+       * 
+ * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int type_ ; + /** + *
+       * monitoring collect metrics field type, 0-number 1-string
+       * 
+ * + * uint32 type = 2; + * @return The type. + */ + @Override + public int getType() { + return type_; + } + /** + *
+       * monitoring collect metrics field type, 0-number 1-string
+       * 
+ * + * uint32 type = 2; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(int value) { + + type_ = value; + onChanged(); + return this; + } + /** + *
+       * monitoring collect metrics field type, 0-number 1-string
+       * 
+ * + * uint32 type = 2; + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private Object unit_ = ""; + /** + *
+       * monitoring collect metrics field unit, % MB GB TB S...
+       * 
+ * + * string unit = 3; + * @return The unit. + */ + public String getUnit() { + Object ref = unit_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + unit_ = s; + return s; + } else { + return (String) ref; + } + } + /** + *
+       * monitoring collect metrics field unit, % MB GB TB S...
+       * 
+ * + * string unit = 3; + * @return The bytes for unit. + */ + public com.google.protobuf.ByteString + getUnitBytes() { + Object ref = unit_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + unit_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * monitoring collect metrics field unit, % MB GB TB S...
+       * 
+ * + * string unit = 3; + * @param value The unit to set. + * @return This builder for chaining. + */ + public Builder setUnit( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + unit_ = value; + onChanged(); + return this; + } + /** + *
+       * monitoring collect metrics field unit, % MB GB TB S...
+       * 
+ * + * string unit = 3; + * @return This builder for chaining. + */ + public Builder clearUnit() { + + unit_ = getDefaultInstance().getUnit(); + onChanged(); + return this; + } + /** + *
+       * monitoring collect metrics field unit, % MB GB TB S...
+       * 
+ * + * string unit = 3; + * @param value The bytes for unit to set. + * @return This builder for chaining. + */ + public Builder setUnitBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + unit_ = value; + onChanged(); + return this; + } + + private boolean label_ ; + /** + *
+       * is label field
+       * 
+ * + * bool label = 4; + * @return The label. + */ + @Override + public boolean getLabel() { + return label_; + } + /** + *
+       * is label field
+       * 
+ * + * bool label = 4; + * @param value The label to set. + * @return This builder for chaining. + */ + public Builder setLabel(boolean value) { + + label_ = value; + onChanged(); + return this; + } + /** + *
+       * is label field
+       * 
+ * + * bool label = 4; + * @return This builder for chaining. + */ + public Builder clearLabel() { + + label_ = false; + onChanged(); + return this; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.dromara.hertzbeat.common.entity.message.Field) + } - /** - *
-             * 主键实例,唯一标识这行数据
-             * 
- * - * string instance = 1; - * - * @param value The instance to set. - * @return This builder for chaining. - */ - public Builder setInstance( - String value) { - if (value == null) { - throw new NullPointerException(); - } - - instance_ = value; - onChanged(); - return this; - } + // @@protoc_insertion_point(class_scope:org.dromara.hertzbeat.common.entity.message.Field) + private static final Field DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Field(); + } - /** - *
-             * 主键实例,唯一标识这行数据
-             * 
- * - * string instance = 1; - * - * @return This builder for chaining. - */ - public Builder clearInstance() { - - instance_ = getDefaultInstance().getInstance(); - onChanged(); - return this; - } + public static Field getDefaultInstance() { + return DEFAULT_INSTANCE; + } - /** - *
-             * 主键实例,唯一标识这行数据
-             * 
- * - * string instance = 1; - * - * @param value The bytes for instance to set. - * @return This builder for chaining. - */ - public Builder setInstanceBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - instance_ = value; - onChanged(); - return this; - } + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public Field parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Field(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } - private com.google.protobuf.LazyStringList columns_ = com.google.protobuf.LazyStringArrayList.EMPTY; + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } - private void ensureColumnsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - columns_ = new com.google.protobuf.LazyStringArrayList(columns_); - bitField0_ |= 0x00000001; - } - } + @Override + public Field getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } - /** - *
-             * 采集指标值
-             * 
- * - * repeated string columns = 2; - * - * @return A list containing the columns. - */ - public com.google.protobuf.ProtocolStringList - getColumnsList() { - return columns_.getUnmodifiableView(); - } + } - /** - *
-             * 采集指标值
-             * 
- * - * repeated string columns = 2; - * - * @return The count of columns. - */ - public int getColumnsCount() { - return columns_.size(); - } + public interface ValueRowOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.dromara.hertzbeat.common.entity.message.ValueRow) + com.google.protobuf.MessageOrBuilder { - /** - *
-             * 采集指标值
-             * 
- * - * repeated string columns = 2; - * - * @param index The index of the element to return. - * @return The columns at the given index. - */ - public String getColumns(int index) { - return columns_.get(index); - } + /** + *
+     * monitoring collect metrics value, mapping with the fields
+     * 
+ * + * repeated string columns = 1; + * @return A list containing the columns. + */ + java.util.List + getColumnsList(); + /** + *
+     * monitoring collect metrics value, mapping with the fields
+     * 
+ * + * repeated string columns = 1; + * @return The count of columns. + */ + int getColumnsCount(); + /** + *
+     * monitoring collect metrics value, mapping with the fields
+     * 
+ * + * repeated string columns = 1; + * @param index The index of the element to return. + * @return The columns at the given index. + */ + String getColumns(int index); + /** + *
+     * monitoring collect metrics value, mapping with the fields
+     * 
+ * + * repeated string columns = 1; + * @param index The index of the value to return. + * @return The bytes of the columns at the given index. + */ + com.google.protobuf.ByteString + getColumnsBytes(int index); + } + /** + * Protobuf type {@code org.dromara.hertzbeat.common.entity.message.ValueRow} + */ + public static final class ValueRow extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.dromara.hertzbeat.common.entity.message.ValueRow) + ValueRowOrBuilder { + private static final long serialVersionUID = 0L; + // Use ValueRow.newBuilder() to construct. + private ValueRow(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ValueRow() { + columns_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } - /** - *
-             * 采集指标值
-             * 
- * - * repeated string columns = 2; - * - * @param index The index of the value to return. - * @return The bytes of the columns at the given index. - */ - public com.google.protobuf.ByteString - getColumnsBytes(int index) { - return columns_.getByteString(index); - } + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new ValueRow(); + } - /** - *
-             * 采集指标值
-             * 
- * - * repeated string columns = 2; - * - * @param index The index to set the value at. - * @param value The columns to set. - * @return This builder for chaining. - */ - public Builder setColumns( - int index, String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureColumnsIsMutable(); - columns_.set(index, value); - onChanged(); - return this; - } + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ValueRow( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + columns_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + columns_.add(s); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + columns_ = columns_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_descriptor; + } - /** - *
-             * 采集指标值
-             * 
- * - * repeated string columns = 2; - * - * @param value The columns to add. - * @return This builder for chaining. - */ - public Builder addColumns( - String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureColumnsIsMutable(); - columns_.add(value); - onChanged(); - return this; - } + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + ValueRow.class, Builder.class); + } - /** - *
-             * 采集指标值
-             * 
- * - * repeated string columns = 2; - * - * @param values The columns to add. - * @return This builder for chaining. - */ - public Builder addAllColumns( - Iterable values) { - ensureColumnsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, columns_); - onChanged(); - return this; - } + public static final int COLUMNS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList columns_; + /** + *
+     * monitoring collect metrics value, mapping with the fields
+     * 
+ * + * repeated string columns = 1; + * @return A list containing the columns. + */ + public com.google.protobuf.ProtocolStringList + getColumnsList() { + return columns_; + } + /** + *
+     * monitoring collect metrics value, mapping with the fields
+     * 
+ * + * repeated string columns = 1; + * @return The count of columns. + */ + public int getColumnsCount() { + return columns_.size(); + } + /** + *
+     * monitoring collect metrics value, mapping with the fields
+     * 
+ * + * repeated string columns = 1; + * @param index The index of the element to return. + * @return The columns at the given index. + */ + public String getColumns(int index) { + return columns_.get(index); + } + /** + *
+     * monitoring collect metrics value, mapping with the fields
+     * 
+ * + * repeated string columns = 1; + * @param index The index of the value to return. + * @return The bytes of the columns at the given index. + */ + public com.google.protobuf.ByteString + getColumnsBytes(int index) { + return columns_.getByteString(index); + } - /** - *
-             * 采集指标值
-             * 
- * - * repeated string columns = 2; - * - * @return This builder for chaining. - */ - public Builder clearColumns() { - columns_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; - /** - *
-             * 采集指标值
-             * 
- * - * repeated string columns = 2; - * - * @param value The bytes of the columns to add. - * @return This builder for chaining. - */ - public Builder addColumnsBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureColumnsIsMutable(); - columns_.add(value); - onChanged(); - return this; - } + memoizedIsInitialized = 1; + return true; + } - @Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < columns_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, columns_.getRaw(i)); + } + unknownFields.writeTo(output); + } - @Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < columns_.size(); i++) { + dataSize += computeStringSizeNoTag(columns_.getRaw(i)); + } + size += dataSize; + size += 1 * getColumnsList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ValueRow)) { + return super.equals(obj); + } + ValueRow other = (ValueRow) obj; + + if (!getColumnsList() + .equals(other.getColumnsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } - // @@protoc_insertion_point(builder_scope:org.dromara.hertzbeat.common.entity.message.ValueRow) - } + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getColumnsCount() > 0) { + hash = (37 * hash) + COLUMNS_FIELD_NUMBER; + hash = (53 * hash) + getColumnsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } - // @@protoc_insertion_point(class_scope:org.dromara.hertzbeat.common.entity.message.ValueRow) - private static final ValueRow DEFAULT_INSTANCE; + public static ValueRow parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ValueRow parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ValueRow parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ValueRow parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ValueRow parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static ValueRow parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static ValueRow parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static ValueRow parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static ValueRow parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static ValueRow parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static ValueRow parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static ValueRow parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } - static { - DEFAULT_INSTANCE = new ValueRow(); - } + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(ValueRow prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } - public static ValueRow getDefaultInstance() { - return DEFAULT_INSTANCE; - } + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.dromara.hertzbeat.common.entity.message.ValueRow} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.dromara.hertzbeat.common.entity.message.ValueRow) + ValueRowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + ValueRow.class, Builder.class); + } + + // Construct using org.dromara.hertzbeat.common.entity.message.CollectRep.ValueRow.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @Override + public Builder clear() { + super.clear(); + columns_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return CollectRep.internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_descriptor; + } + + @Override + public ValueRow getDefaultInstanceForType() { + return ValueRow.getDefaultInstance(); + } + + @Override + public ValueRow build() { + ValueRow result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public ValueRow buildPartial() { + ValueRow result = new ValueRow(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + columns_ = columns_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.columns_ = columns_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof ValueRow) { + return mergeFrom((ValueRow)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(ValueRow other) { + if (other == ValueRow.getDefaultInstance()) return this; + if (!other.columns_.isEmpty()) { + if (columns_.isEmpty()) { + columns_ = other.columns_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureColumnsIsMutable(); + columns_.addAll(other.columns_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + ValueRow parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (ValueRow) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringList columns_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureColumnsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + columns_ = new com.google.protobuf.LazyStringArrayList(columns_); + bitField0_ |= 0x00000001; + } + } + /** + *
+       * monitoring collect metrics value, mapping with the fields
+       * 
+ * + * repeated string columns = 1; + * @return A list containing the columns. + */ + public com.google.protobuf.ProtocolStringList + getColumnsList() { + return columns_.getUnmodifiableView(); + } + /** + *
+       * monitoring collect metrics value, mapping with the fields
+       * 
+ * + * repeated string columns = 1; + * @return The count of columns. + */ + public int getColumnsCount() { + return columns_.size(); + } + /** + *
+       * monitoring collect metrics value, mapping with the fields
+       * 
+ * + * repeated string columns = 1; + * @param index The index of the element to return. + * @return The columns at the given index. + */ + public String getColumns(int index) { + return columns_.get(index); + } + /** + *
+       * monitoring collect metrics value, mapping with the fields
+       * 
+ * + * repeated string columns = 1; + * @param index The index of the value to return. + * @return The bytes of the columns at the given index. + */ + public com.google.protobuf.ByteString + getColumnsBytes(int index) { + return columns_.getByteString(index); + } + /** + *
+       * monitoring collect metrics value, mapping with the fields
+       * 
+ * + * repeated string columns = 1; + * @param index The index to set the value at. + * @param value The columns to set. + * @return This builder for chaining. + */ + public Builder setColumns( + int index, String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * monitoring collect metrics value, mapping with the fields
+       * 
+ * + * repeated string columns = 1; + * @param value The columns to add. + * @return This builder for chaining. + */ + public Builder addColumns( + String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureColumnsIsMutable(); + columns_.add(value); + onChanged(); + return this; + } + /** + *
+       * monitoring collect metrics value, mapping with the fields
+       * 
+ * + * repeated string columns = 1; + * @param values The columns to add. + * @return This builder for chaining. + */ + public Builder addAllColumns( + Iterable values) { + ensureColumnsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, columns_); + onChanged(); + return this; + } + /** + *
+       * monitoring collect metrics value, mapping with the fields
+       * 
+ * + * repeated string columns = 1; + * @return This builder for chaining. + */ + public Builder clearColumns() { + columns_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+       * monitoring collect metrics value, mapping with the fields
+       * 
+ * + * repeated string columns = 1; + * @param value The bytes of the columns to add. + * @return This builder for chaining. + */ + public Builder addColumnsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureColumnsIsMutable(); + columns_.add(value); + onChanged(); + return this; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.dromara.hertzbeat.common.entity.message.ValueRow) + } - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @Override - public ValueRow parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ValueRow(input, extensionRegistry); - } - }; + // @@protoc_insertion_point(class_scope:org.dromara.hertzbeat.common.entity.message.ValueRow) + private static final ValueRow DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new ValueRow(); + } - public static com.google.protobuf.Parser parser() { - return PARSER; - } + public static ValueRow getDefaultInstance() { + return DEFAULT_INSTANCE; + } - @Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public ValueRow parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ValueRow(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } - @Override - public ValueRow getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + @Override + public ValueRow getDefaultInstanceForType() { + return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_descriptor; - private static final + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_org_dromara_hertzbeat_common_entity_message_Field_descriptor; - private static final + internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_dromara_hertzbeat_common_entity_message_Field_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_org_dromara_hertzbeat_common_entity_message_Field_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor - internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_descriptor; - private static final + internal_static_org_dromara_hertzbeat_common_entity_message_Field_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - - static { - String[] descriptorData = { - "\n\021collect_rep.proto\022+org.dromara.hertzbe" + - "at.common.entity.message\"\302\002\n\013MetricsData" + - "\022\n\n\002id\030\001 \001(\004\022\020\n\010tenantId\030\002 \001(\004\022\013\n\003app\030\003 " + - "\001(\t\022\017\n\007metrics\030\004 \001(\t\022\020\n\010priority\030\005 \001(\r\022\014" + - "\n\004time\030\006 \001(\004\022?\n\004code\030\007 \001(\01621.org.dromara" + - ".hertzbeat.common.entity.message.Code\022\013\n" + - "\003msg\030\010 \001(\t\022B\n\006fields\030\t \003(\01322.org.dromara" + - ".hertzbeat.common.entity.message.Field\022E" + - "\n\006values\030\n \003(\01325.org.dromara.hertzbeat.c" + - "ommon.entity.message.ValueRow\"1\n\005Field\022\014" + - "\n\004name\030\001 \001(\t\022\014\n\004type\030\002 \001(\r\022\014\n\004unit\030\003 \001(\t" + - "\"-\n\010ValueRow\022\020\n\010instance\030\001 \001(\t\022\017\n\007column" + - "s\030\002 \003(\t*b\n\004Code\022\013\n\007SUCCESS\020\000\022\020\n\014UN_AVAIL" + - "ABLE\020\001\022\020\n\014UN_REACHABLE\020\002\022\022\n\016UN_CONNECTAB" + - "LE\020\003\022\010\n\004FAIL\020\004\022\013\n\007TIMEOUT\020\005b\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[]{ - }); - internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_descriptor, - new String[]{"Id", "TenantId", "App", "Metrics", "Priority", "Time", "Code", "Msg", "Fields", "Values",}); - internal_static_org_dromara_hertzbeat_common_entity_message_Field_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_org_dromara_hertzbeat_common_entity_message_Field_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_org_dromara_hertzbeat_common_entity_message_Field_descriptor, - new String[]{"Name", "Type", "Unit",}); - internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_descriptor, - new String[]{"Instance", "Columns",}); - } - - // @@protoc_insertion_point(outer_class_scope) + internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + String[] descriptorData = { + "\n\021collect_rep.proto\022+org.dromara.hertzbe" + + "at.common.entity.message\"\302\002\n\013MetricsData" + + "\022\n\n\002id\030\001 \001(\004\022\020\n\010tenantId\030\002 \001(\004\022\013\n\003app\030\003 " + + "\001(\t\022\017\n\007metrics\030\004 \001(\t\022\020\n\010priority\030\005 \001(\r\022\014" + + "\n\004time\030\006 \001(\004\022?\n\004code\030\007 \001(\01621.org.dromara" + + ".hertzbeat.common.entity.message.Code\022\013\n" + + "\003msg\030\010 \001(\t\022B\n\006fields\030\t \003(\01322.org.dromara" + + ".hertzbeat.common.entity.message.Field\022E" + + "\n\006values\030\n \003(\01325.org.dromara.hertzbeat.c" + + "ommon.entity.message.ValueRow\"@\n\005Field\022\014" + + "\n\004name\030\001 \001(\t\022\014\n\004type\030\002 \001(\r\022\014\n\004unit\030\003 \001(\t" + + "\022\r\n\005label\030\004 \001(\010\"\033\n\010ValueRow\022\017\n\007columns\030\001" + + " \003(\t*b\n\004Code\022\013\n\007SUCCESS\020\000\022\020\n\014UN_AVAILABL" + + "E\020\001\022\020\n\014UN_REACHABLE\020\002\022\022\n\016UN_CONNECTABLE\020" + + "\003\022\010\n\004FAIL\020\004\022\013\n\007TIMEOUT\020\005b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_dromara_hertzbeat_common_entity_message_MetricsData_descriptor, + new String[] { "Id", "TenantId", "App", "Metrics", "Priority", "Time", "Code", "Msg", "Fields", "Values", }); + internal_static_org_dromara_hertzbeat_common_entity_message_Field_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_org_dromara_hertzbeat_common_entity_message_Field_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_dromara_hertzbeat_common_entity_message_Field_descriptor, + new String[] { "Name", "Type", "Unit", "Label", }); + internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_dromara_hertzbeat_common_entity_message_ValueRow_descriptor, + new String[] { "Columns", }); + } + + // @@protoc_insertion_point(outer_class_scope) } diff --git a/common/src/main/java/org/dromara/hertzbeat/common/util/JsonUtil.java b/common/src/main/java/org/dromara/hertzbeat/common/util/JsonUtil.java index 0ddb6a90356..5a3f49ae1cc 100644 --- a/common/src/main/java/org/dromara/hertzbeat/common/util/JsonUtil.java +++ b/common/src/main/java/org/dromara/hertzbeat/common/util/JsonUtil.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; @@ -82,4 +83,15 @@ public static T fromJson(String jsonStr, TypeReference type) { } } + public static JsonNode fromJson(String jsonStr) { + if (!StringUtils.hasText(jsonStr)) { + return null; + } + try { + return OBJECT_MAPPER.readTree(jsonStr); + } catch (Exception e) { + log.error(e.getMessage(), e); + return null; + } + } } diff --git a/common/src/main/message/collect_rep.proto b/common/src/main/message/collect_rep.proto index 309ecb9ffb0..b82797aaae0 100644 --- a/common/src/main/message/collect_rep.proto +++ b/common/src/main/message/collect_rep.proto @@ -20,58 +20,58 @@ package org.dromara.hertzbeat.common.entity.message; message MetricsData { - // 监控的ID + // monitoring id uint64 id = 1; - // 所属租户ID + // tenant id uint64 tenantId = 2; - // 监控的类型 eg: linux | mysql | jvm + // monitoring app eg: linux | mysql | jvm string app = 3; - // 监控采集的指标集合 eg: cpu | memory | health + // monitoring metrics eg: cpu | memory | health string metrics = 4; - // 监控采集指标集合的采集优先级>=0 + // monitoring collect priority >=0 uint32 priority = 5; - // 采集时间 + // collect timestamp uint64 time = 6; - // 采集响应码 + // collect response code Code code = 7; - // 采集响应信息 + // collect response error message string msg = 8; - // 采集指标名 + // monitoring collect metric field repeated Field fields = 9; - // 采集指标值集合(fields作为字段名称与ValueRow映射) + // monitoring collect metric data, mapping with the fields repeated ValueRow values = 10; } message Field { - // 指标采集字符名称 + // monitoring collect metric field name string name = 1; - // 字段类型:0-number数字 1-string字符串 + // monitoring collect metrics field type, 0-number 1-string uint32 type = 2; - // metric value unit + // monitoring collect metrics field unit, % MB GB TB S... string unit = 3; + // is label field + bool label = 4; } message ValueRow { - // 主键实例,唯一标识这行数据 - string instance = 1; - // 采集指标值 - repeated string columns = 2; + // monitoring collect metrics value, mapping with the fields + repeated string columns = 1; } enum Code { - // 采集成功 + // collect success SUCCESS = 0; - // 采集器不可用 + // collector not available UN_AVAILABLE = 1; - // 对端不可达(网络层icmp) + // peer network un reachable(icmp) UN_REACHABLE = 2; - // 对端连接失败(传输层tcp,udp) + // peer network server un connectable(tcp,udp...) UN_CONNECTABLE = 3; - // 数据采集失败(应用层http,ssh,snmp) + // collect metrics data failed(http,ssh,snmp...) FAIL = 4; - // 采集超时 + // collect metrics data timeout TIMEOUT = 5; } diff --git a/home/docs/advanced/extend-http-default.md b/home/docs/advanced/extend-http-default.md index 06c49d30476..210422964a7 100644 --- a/home/docs/advanced/extend-http-default.md +++ b/home/docs/advanced/extend-http-default.md @@ -122,7 +122,7 @@ metrics: # Metric information include field: name type: field type(0-number: number, 1-string: string) nstance: primary key of instance or not unit: Metric unit - field: hostname type: 1 - instance: true + label: true - field: usage type: 0 unit: '%' diff --git a/home/docs/advanced/extend-http-example-hertzbeat.md b/home/docs/advanced/extend-http-example-hertzbeat.md index 620891e441f..d1df47e4b54 100644 --- a/home/docs/advanced/extend-http-example-hertzbeat.md +++ b/home/docs/advanced/extend-http-example-hertzbeat.md @@ -160,7 +160,7 @@ metrics: # metrics content contains field-metric name, type-metric type:0-number,1-string, instance-if is metrics group, unit-metric unit('%','ms','MB') - field: app type: 1 - instance: true + label: true - field: category type: 1 - field: status diff --git a/home/docs/advanced/extend-http-jsonpath.md b/home/docs/advanced/extend-http-jsonpath.md index a2c01272707..c39190fd979 100644 --- a/home/docs/advanced/extend-http-jsonpath.md +++ b/home/docs/advanced/extend-http-jsonpath.md @@ -141,7 +141,7 @@ metrics: # Metric information include field: name type: field type(0-number: number, 1-string: string) nstance: primary key of instance or not unit: Metric unit - field: type type: 1 - instance: true + label: true - field: num type: 0 # protocol for monitoring and collection eg: sql, ssh, http, telnet, wmi, snmp, sdk diff --git a/home/docs/advanced/extend-http.md b/home/docs/advanced/extend-http.md index bf542dc593c..039f239ca4d 100644 --- a/home/docs/advanced/extend-http.md +++ b/home/docs/advanced/extend-http.md @@ -117,7 +117,7 @@ metrics: # Metric information include field: name type: field type(0-number: number, 1-string: string) nstance: primary key of instance or not unit: Metric unit - field: hostname type: 1 - instance: true + label: true - field: usage type: 0 unit: '%' @@ -178,7 +178,7 @@ metrics: fields: - field: hostname type: 1 - instance: true + label: true - field: total type: 0 unit: kb diff --git a/home/docs/advanced/extend-jdbc.md b/home/docs/advanced/extend-jdbc.md index 2027f64a7cb..25d30ae2c82 100644 --- a/home/docs/advanced/extend-jdbc.md +++ b/home/docs/advanced/extend-jdbc.md @@ -125,7 +125,7 @@ metrics: # Metric information include field: name type: field type(0-number: number, 1-string: string) instance: primary key of instance or not unit: Metric unit - field: version type: 1 - instance: true + label: true - field: port type: 1 - field: datadir diff --git a/home/docs/advanced/extend-jmx.md b/home/docs/advanced/extend-jmx.md index 0d35ac7a0a3..3fec909213a 100644 --- a/home/docs/advanced/extend-jmx.md +++ b/home/docs/advanced/extend-jmx.md @@ -147,7 +147,7 @@ metrics: fields: - field: name type: 1 - instance: true + label: true - field: committed type: 0 unit: MB diff --git a/home/docs/advanced/extend-ssh.md b/home/docs/advanced/extend-ssh.md index 2bb1360276c..245156a0b1a 100644 --- a/home/docs/advanced/extend-ssh.md +++ b/home/docs/advanced/extend-ssh.md @@ -122,7 +122,7 @@ metrics: # Metric information include field: name type: field type(0-number: number, 1-string: string) instance: primary key of instance or not unit: Metric unit - field: hostname type: 1 - instance: true + label: true - field: version type: 1 - field: uptime diff --git a/home/docs/advanced/extend-tutorial.md b/home/docs/advanced/extend-tutorial.md index cdd889c2536..9caabcd423f 100644 --- a/home/docs/advanced/extend-tutorial.md +++ b/home/docs/advanced/extend-tutorial.md @@ -160,7 +160,7 @@ metrics: # metrics content contains field-metric name, type-metric type:0-number,1-string, instance-if is metrics group, unit-metric unit('%','ms','MB') - field: app type: 1 - instance: true + label: true - field: category type: 1 - field: status diff --git a/home/docs/introduce.md b/home/docs/introduce.md index a44a5484925..4336a7a21a3 100644 --- a/home/docs/introduce.md +++ b/home/docs/introduce.md @@ -30,10 +30,11 @@ slug: / ### Features * Combines **monitoring, alarm, and notification** features into one platform, and supports monitoring for web service, program, database, cache, os, webserver, middleware, bigdata, cloud-native, network, custom and more. -* Easy to use and agentless, offering full web-based operations for monitoring and alerting with just a few clicks, all at zero learning cost. +* Easy to use and agentless, offering full gui operations for monitoring and alerting with just a few clicks, all at zero learning cost. * Makes protocols such as `Http, Jmx, Ssh, Snmp, Jdbc, Prometheus` configurable, allowing you to collect any metrics by simply configuring the template `YML` file online. Imagine being able to quickly adapt to a new monitoring type like K8s or Docker simply by configuring online with HertzBeat. +* Compatible with the `Prometheus` ecosystem and more, can monitoring what `Prometheus` can monitoring with few clicks on gui. * High performance, supports horizontal expansion of multi-collector clusters, multi-isolated network monitoring and cloud-edge collaboration. -* Provides flexible alarm threshold rules and timely notifications delivered via `Discord` `Slack` `Telegram` `Email` `DingDing` `WeChat` `FeiShu` `Webhook` `SMS`. +* Provides flexible alarm threshold rules and timely notifications delivered via `Discord` `Slack` `Telegram` `Email` `Dingtalk` `WeChat` `FeiShu` `Webhook` `SMS` `ServerChan`. > HertzBeat's powerful customization, multi-type support, high performance, easy expansion, and low coupling, aims to help developers and teams quickly build their own monitoring system. diff --git a/home/docs/start/sslcert-practice.md b/home/docs/start/sslcert-practice.md index 48ef6347f73..70728f8fe32 100644 --- a/home/docs/start/sslcert-practice.md +++ b/home/docs/start/sslcert-practice.md @@ -34,45 +34,41 @@ gitee: https://gitee.com/dromara/hertzbeat > System Page -> Monitor Menu -> SSL Certificate -> Add SSL Certificate -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/bd53f343a5b54feab62e71458d076441~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_1.png) 2. Configure the monitoring website > Here we take the example of monitoring Baidu website, configure monitoring host domain name, name, collection interval, etc. > Click OK Note ⚠️Before adding, it will test the connectivity of the website by default, and the connection will be successful before adding. Of course, you can also gray out the **Test or not** button. -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ad1154670648413bb82c8bdeb5b13609~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_2.png) 3. View the detection index data > In the monitoring list, you can view the monitoring status, and in the monitoring details, you can view the indicator data chart, etc. -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f874b45e909c4bb0acdd28b3fb034a61~tplv-k3u1fbpfcp-zoom-1.image) - - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ef5d7443f8c04818ae5aa28d421203be~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_3.png) +![](/img/docs/start/ssl_11.png) 4. Set the threshold (triggered when the certificate expires) > System Page -> Alarms -> Alarm Thresholds -> New Thresholds -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/8d6205172d43463aa34e534477f132f1~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_4.png) > Configure the threshold, select the SSL certificate indicator object, configure the alarm expression-triggered when the indicator `expired` is `true`, that is, `equals(expired,"true")`, set the alarm level notification template information, etc. -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/83d17b381d994f26a6240e01915b2001~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_5.png) > Associating thresholds with monitoring, in the threshold list, set which monitoring this threshold applies to. -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/9b9063d7bcf9454387be0491fc382bd1~tplv-k3u1fbpfcp-zoom-1.image) - - +![](/img/docs/start/ssl_6.png) 5. Set the threshold (triggered one week before the certificate expires) @@ -80,12 +76,12 @@ gitee: https://gitee.com/dromara/hertzbeat > In the same way, add a new configuration threshold and configure an alarm expression - when the indicator expires timestamp `end_timestamp`, the `now()` function is the current timestamp, if the configuration triggers an alarm one week in advance: `end_timestamp <= (now( ) + 604800000)` , where `604800000` is the 7-day total time difference in milliseconds. -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/0d6f837f57c247e09f668f60eff4a0ff~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_7.png) > Finally, you can see the triggered alarm in the alarm center. -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5a61b23127524976b2c209ce0ca6a339~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_8.png) 6. Alarm notification (in time notification via Dingding WeChat Feishu, etc.) @@ -93,7 +89,7 @@ gitee: https://gitee.com/dromara/hertzbeat > Monitoring Tool -> Alarm Notification -> New Receiver -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/7f36956060ef410a82bbecafcbb2957f~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_10.png) For token configuration such as Dingding WeChat Feishu, please refer to the help document @@ -103,7 +99,7 @@ https://tancloud.cn/docs/help/alert_dingtalk > Alarm Notification -> New Alarm Notification Policy -> Enable Notification for the Recipient Just Configured -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d976343e81f843138344a039f3aff8a3~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_11.png) 7. OK When the threshold is triggered, we can receive the corresponding alarm message. If there is no notification, you can also view the alarm information in the alarm center. diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-default.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-default.md index 75b3386f5b3..fa01a96f79a 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-default.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-default.md @@ -123,7 +123,7 @@ metrics: # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 - field: hostname type: 1 - instance: true + label: true - field: usage type: 0 unit: '%' diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-example-hertzbeat.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-example-hertzbeat.md index 0f9b1592bf0..b867ba3d045 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-example-hertzbeat.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-example-hertzbeat.md @@ -147,7 +147,7 @@ metrics: unit: ms - field: app type: 1 - instance: true + label: true - field: category type: 1 - field: status diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-jsonpath.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-jsonpath.md index 779479985a0..0dcc86dfbd5 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-jsonpath.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-jsonpath.md @@ -143,7 +143,7 @@ metrics: # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 - field: type type: 1 - instance: true + label: true - field: num type: 0 # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http.md index 82ffb8f6e53..380a001c63c 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http.md @@ -116,7 +116,7 @@ metrics: # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 - field: hostname type: 1 - instance: true + label: true - field: usage type: 0 unit: '%' @@ -177,7 +177,7 @@ metrics: fields: - field: hostname type: 1 - instance: true + label: true - field: total type: 0 unit: kb diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-jdbc.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-jdbc.md index fbbee1f2d88..5f29eb7d3d5 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-jdbc.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-jdbc.md @@ -126,7 +126,7 @@ metrics: # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 - field: version type: 1 - instance: true + label: true - field: port type: 1 - field: datadir diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-jmx.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-jmx.md index 3f04462f00a..418cc0ac234 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-jmx.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-jmx.md @@ -188,7 +188,7 @@ metrics: fields: - field: name type: 1 - instance: true + label: true - field: committed type: 0 unit: MB diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-ssh.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-ssh.md index 650c7d51a5a..72f4c541de0 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-ssh.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-ssh.md @@ -124,7 +124,7 @@ metrics: # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 - field: hostname type: 1 - instance: true + label: true - field: version type: 1 - field: uptime diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-tutorial.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-tutorial.md index fabfa758061..9d89f184f6e 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-tutorial.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-tutorial.md @@ -174,7 +174,7 @@ metrics: # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 - field: app type: 1 - instance: true + label: true - field: category type: 1 - field: status diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/introduce.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/introduce.md index af9ba61de91..de6e0fcb6e5 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/introduce.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/introduce.md @@ -31,8 +31,9 @@ slug: / - 集 **监控+告警+通知** 为一体,支持对应用服务,应用程序,数据库,缓存,操作系统,大数据,中间件,Web服务器,云原生,网络,自定义等监控阈值告警通知一步到位。 - 易用友好,无需 `Agent`,全 `WEB` 页面操作,鼠标点一点就能监控告警,零上手学习成本。 - 将 `Http, Jmx, Ssh, Snmp, Jdbc, Prometheus` 等协议规范可配置化,只需在浏览器配置监控模版 `YML` 就能使用这些协议去自定义采集想要的指标。您相信只需配置下就能立刻适配一款 `K8s` 或 `Docker` 等新的监控类型吗? +- 兼容 `Prometheus` 的系统生态并且更多,只需页面操作就可以监控 `Prometheus` 所能监控的。 - 高性能,支持多采集器集群横向扩展,支持多隔离网络监控,云边协同。 -- 自由的告警阈值规则,`邮件` `Discord` `Slack` `Telegram` `钉钉` `微信` `飞书` `短信` `Webhook` 等方式消息及时送达。 +- 自由的告警阈值规则,`邮件` `Discord` `Slack` `Telegram` `钉钉` `微信` `飞书` `短信` `Webhook` `Server酱` 等方式消息及时送达。 > `HertzBeat`的强大自定义,多类型支持,高性能,易扩展,低耦合,希望能帮助开发者和团队快速搭建自有监控系统。 @@ -45,7 +46,7 @@ slug: / - 使用`Apache2`协议,由自由开放的开源社区主导维护的开源协作产品。 - 无监控数量`License`,监控类型等伪开源限制。 - 基于`Java+SpringBoot+TypeScript+Angular`主流技术栈构建,方便的二次开发。 -- 但开源不等同于免费,如果基于HertzBeat二次开发修改了logo,名称,版权等,[请找我们授权,否则会有法律风险](https://hertzbeat.com/docs/others/private)。 +- 开源不等同于免费,如果基于HertzBeat二次开发修改了logo,名称,版权等,[请找我们授权,否则会有法律风险](https://hertzbeat.com/docs/others/private)。 ### 强大的监控模版 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/sslcert-practice.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/sslcert-practice.md index f869ee06ebb..d2f28748dd9 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/sslcert-practice.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/sslcert-practice.md @@ -35,66 +35,53 @@ gitee: https://gitee.com/dromara/hertzbeat > 系统页面 -> 监控菜单 -> SSL证书 -> 新增SSL证书 -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/bd53f343a5b54feab62e71458d076441~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_1.png) + 2. 配置监控网站 > 我们这里举例监控百度网站, 配置监控host域名,名称,采集间隔等。 > 点击确定 注意⚠️新增前默认会先去测试网站连接性,连接成功才会新增,当然也可以把**是否测试**按钮置灰。 -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ad1154670648413bb82c8bdeb5b13609~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_2.png) 3. 查看检测指标数据 > 在监控列表可以查看任务状态,进监控详情可以查看指标数据图表等。 +![](/img/docs/start/ssl_3.png) -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f874b45e909c4bb0acdd28b3fb034a61~tplv-k3u1fbpfcp-zoom-1.image) - - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ef5d7443f8c04818ae5aa28d421203be~tplv-k3u1fbpfcp-zoom-1.image) - - +![](/img/docs/start/ssl_11.png) 4. 设置阈值(证书过期时触发) > 系统页面 -> 告警 -> 告警阈值 -> 新增阈值 - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/8d6205172d43463aa34e534477f132f1~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_4.png) > 配置阈值,选择SSL证书指标对象,配置告警表达式-当指标`expired`为`true`触发,即`equals(expired,"true")` , 设置告警级别通知模版信息等。 - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/83d17b381d994f26a6240e01915b2001~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_5.png) > 关联阈值与监控, 在阈值列表设置此阈值应用于哪些监控。 - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/9b9063d7bcf9454387be0491fc382bd1~tplv-k3u1fbpfcp-zoom-1.image) - - - +![](/img/docs/start/ssl_6.png) 5. 设置阈值(证书过期前一周触发) > 同理如上,新增配置阈值,配置告警表达式-当指标有效期时间戳 `end_timestamp`,`now()`函数为当前时间戳,若配置提前一周触发告警即:`end_timestamp <= (now() + 604800000)` , 其中 `604800000` 为7天总时间差毫秒值。 - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/0d6f837f57c247e09f668f60eff4a0ff~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_7.png) > 最终可以在告警中心看到已触发的告警。 - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5a61b23127524976b2c209ce0ca6a339~tplv-k3u1fbpfcp-zoom-1.image) - +![](/img/docs/start/ssl_8.png) 6. 告警通知(通过钉钉微信飞书等及时通知) > 监控系统 -> 告警通知 -> 新增接收人 - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/7f36956060ef410a82bbecafcbb2957f~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_9.png) 钉钉微信飞书等token配置可以参考帮助文档 @@ -103,8 +90,7 @@ https://tancloud.cn/docs/help/alert_dingtalk > 告警通知 -> 新增告警通知策略 -> 将刚才配置的接收人启用通知 - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d976343e81f843138344a039f3aff8a3~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_10.png) 7. OK 当阈值触发后我们就可以收到对应告警消息啦,如果没有配通知,也可以在告警中心查看告警信息。 diff --git a/home/src/pages/index.js b/home/src/pages/index.js index 3ab1eaa7c9a..b91b7f9e850 100644 --- a/home/src/pages/index.js +++ b/home/src/pages/index.js @@ -85,58 +85,28 @@ function Home() { > - - - - - - - - - - - - - - - diff --git a/home/static/img/docs/start/ssl_1.png b/home/static/img/docs/start/ssl_1.png new file mode 100644 index 00000000000..4e0ac04071e Binary files /dev/null and b/home/static/img/docs/start/ssl_1.png differ diff --git a/home/static/img/docs/start/ssl_10.png b/home/static/img/docs/start/ssl_10.png new file mode 100644 index 00000000000..0b7fb504ba6 Binary files /dev/null and b/home/static/img/docs/start/ssl_10.png differ diff --git a/home/static/img/docs/start/ssl_11.png b/home/static/img/docs/start/ssl_11.png new file mode 100644 index 00000000000..a47e76d66b8 Binary files /dev/null and b/home/static/img/docs/start/ssl_11.png differ diff --git a/home/static/img/docs/start/ssl_2.png b/home/static/img/docs/start/ssl_2.png new file mode 100644 index 00000000000..8d07068c4b5 Binary files /dev/null and b/home/static/img/docs/start/ssl_2.png differ diff --git a/home/static/img/docs/start/ssl_3.png b/home/static/img/docs/start/ssl_3.png new file mode 100644 index 00000000000..f911d7e897d Binary files /dev/null and b/home/static/img/docs/start/ssl_3.png differ diff --git a/home/static/img/docs/start/ssl_4.png b/home/static/img/docs/start/ssl_4.png new file mode 100644 index 00000000000..afd54d0c7c4 Binary files /dev/null and b/home/static/img/docs/start/ssl_4.png differ diff --git a/home/static/img/docs/start/ssl_5.png b/home/static/img/docs/start/ssl_5.png new file mode 100644 index 00000000000..61874ae7c3d Binary files /dev/null and b/home/static/img/docs/start/ssl_5.png differ diff --git a/home/static/img/docs/start/ssl_6.png b/home/static/img/docs/start/ssl_6.png new file mode 100644 index 00000000000..983534d6c58 Binary files /dev/null and b/home/static/img/docs/start/ssl_6.png differ diff --git a/home/static/img/docs/start/ssl_7.png b/home/static/img/docs/start/ssl_7.png new file mode 100644 index 00000000000..37dbc799691 Binary files /dev/null and b/home/static/img/docs/start/ssl_7.png differ diff --git a/home/static/img/docs/start/ssl_8.png b/home/static/img/docs/start/ssl_8.png new file mode 100644 index 00000000000..ed814e6e3c9 Binary files /dev/null and b/home/static/img/docs/start/ssl_8.png differ diff --git a/home/static/img/docs/start/ssl_9.png b/home/static/img/docs/start/ssl_9.png new file mode 100644 index 00000000000..934c78184b5 Binary files /dev/null and b/home/static/img/docs/start/ssl_9.png differ diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/service/impl/AppServiceImpl.java b/manager/src/main/java/org/dromara/hertzbeat/manager/service/impl/AppServiceImpl.java index ed1b3d3f9ff..8d9aef6f3cc 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/service/impl/AppServiceImpl.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/service/impl/AppServiceImpl.java @@ -144,6 +144,7 @@ public Job getAutoGenerateDynamicDefine(Long monitorId) { Metrics.Field.builder() .field(item.getName()) .type((byte) item.getType()) + .label(item.getLabel()) .unit(item.getUnit()) .build()) .collect(Collectors.toList()); diff --git a/manager/src/main/resources/application-test.yml b/manager/src/main/resources/application-test.yml index cfceed1b6a4..3e22d43e177 100644 --- a/manager/src/main/resources/application-test.yml +++ b/manager/src/main/resources/application-test.yml @@ -48,6 +48,11 @@ warehouse: jpa: enabled: true expire-time: 1h + victoria-metrics: + enabled: false + url: http://localhost:8428 + username: root + password: root td-engine: enabled: false driver-class-name: com.taosdata.jdbc.rs.RestfulDriver diff --git a/manager/src/main/resources/application.yml b/manager/src/main/resources/application.yml index 566b357dd4a..65e5f6d8806 100644 --- a/manager/src/main/resources/application.yml +++ b/manager/src/main/resources/application.yml @@ -118,6 +118,11 @@ warehouse: # (please set this configuration reasonably as history records can affect performance when it is large) # 历史数据的最大保留条数,超过此数量时,将会删除一半于此配量的数据(由于历史数据较大时会影响性能,请合理设置此配置) max-history-record-num: 6000 + victoria-metrics: + enabled: false + url: http://localhost:8428 + username: root + password: root td-engine: enabled: false driver-class-name: com.taosdata.jdbc.rs.RestfulDriver diff --git a/manager/src/main/resources/define/app-a_example.yml b/manager/src/main/resources/define/app-a_example.yml index 449ee172b1e..4f050443d1e 100644 --- a/manager/src/main/resources/define/app-a_example.yml +++ b/manager/src/main/resources/define/app-a_example.yml @@ -187,11 +187,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, i18n-metric name i18n label, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, i18n-指标国际化展示名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, i18n-metric name i18n label, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, i18n-指标国际化展示名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: hostname type: 1 - instance: true + label: true i18n: zh-CN: 主机名称 en-US: Host Name @@ -269,7 +269,7 @@ metrics: fields: - field: hostname type: 1 - instance: true + label: true i18n: zh-CN: 主机名称 en-US: Hostname diff --git a/manager/src/main/resources/define/app-activemq.yml b/manager/src/main/resources/define/app-activemq.yml index 23e140949a9..61df04908ec 100644 --- a/manager/src/main/resources/define/app-activemq.yml +++ b/manager/src/main/resources/define/app-activemq.yml @@ -142,8 +142,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: VmName type: 1 - field: VmVendor @@ -175,7 +175,7 @@ metrics: fields: - field: BrokerName type: 1 - instance: true + label: true - field: BrokerVersion type: 1 - field: Uptime @@ -230,7 +230,7 @@ metrics: fields: - field: Name type: 1 - instance: true + label: true - field: MemoryLimit type: 0 unit: MB @@ -293,7 +293,7 @@ metrics: fields: - field: name type: 1 - instance: true + label: true - field: committed type: 0 unit: MB diff --git a/manager/src/main/resources/define/app-almalinux.yml b/manager/src/main/resources/define/app-almalinux.yml index 3935b9ad966..c4742d09cdc 100644 --- a/manager/src/main/resources/define/app-almalinux.yml +++ b/manager/src/main/resources/define/app-almalinux.yml @@ -172,11 +172,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: hostname type: 1 - instance: true + label: true i18n: zh-CN: 主机名称 en-US: Host Name @@ -398,7 +398,7 @@ metrics: fields: - field: interface_name type: 1 - instance: true + label: true i18n: zh-CN: 网卡名称 en-US: Interface Name @@ -457,7 +457,7 @@ metrics: en-US: Usage - field: mounted type: 1 - instance: true + label: true i18n: zh-CN: 挂载点 en-US: Mounted @@ -481,7 +481,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID @@ -522,7 +522,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID diff --git a/manager/src/main/resources/define/app-api.yml b/manager/src/main/resources/define/app-api.yml index a91ce4bccd3..48fd6ec0af5 100644 --- a/manager/src/main/resources/define/app-api.yml +++ b/manager/src/main/resources/define/app-api.yml @@ -342,8 +342,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: responseTime type: 0 unit: ms diff --git a/manager/src/main/resources/define/app-centos.yml b/manager/src/main/resources/define/app-centos.yml index 9f7f7d08444..33c9804bea3 100644 --- a/manager/src/main/resources/define/app-centos.yml +++ b/manager/src/main/resources/define/app-centos.yml @@ -169,11 +169,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: hostname type: 1 - instance: true + label: true i18n: zh-CN: 主机名称 en-US: Host Name @@ -395,7 +395,7 @@ metrics: fields: - field: interface_name type: 1 - instance: true + label: true i18n: zh-CN: 网卡名称 en-US: Interface Name @@ -454,7 +454,7 @@ metrics: en-US: Usage - field: mounted type: 1 - instance: true + label: true i18n: zh-CN: 挂载点 en-US: Mounted @@ -478,7 +478,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID @@ -519,7 +519,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID diff --git a/manager/src/main/resources/define/app-cisco_switch.yml b/manager/src/main/resources/define/app-cisco_switch.yml index c3f306c8432..f2064c6028a 100644 --- a/manager/src/main/resources/define/app-cisco_switch.yml +++ b/manager/src/main/resources/define/app-cisco_switch.yml @@ -148,8 +148,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: name type: 1 - field: descr @@ -195,7 +195,7 @@ metrics: type: 1 - field: descr type: 1 - instance: true + label: true - field: mtu type: 0 unit: 'byte' diff --git a/manager/src/main/resources/define/app-clickhouse.yml b/manager/src/main/resources/define/app-clickhouse.yml index 749e12cf04f..806bd1dbbe8 100644 --- a/manager/src/main/resources/define/app-clickhouse.yml +++ b/manager/src/main/resources/define/app-clickhouse.yml @@ -149,8 +149,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: responseTime type: 0 unit: ms @@ -185,7 +185,7 @@ metrics: fields: - field: metric type: 1 - instance: true + label: true - field: value type: 0 # - field: description @@ -207,7 +207,7 @@ metrics: fields: - field: event type: 1 - instance: true + label: true - field: value type: 0 # - field: description @@ -229,7 +229,7 @@ metrics: fields: - field: metric type: 1 - instance: true + label: true - field: value type: 0 # - field: description diff --git a/manager/src/main/resources/define/app-coreos.yml b/manager/src/main/resources/define/app-coreos.yml index 6be8074fbc4..9b4618b9291 100644 --- a/manager/src/main/resources/define/app-coreos.yml +++ b/manager/src/main/resources/define/app-coreos.yml @@ -172,11 +172,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: hostname type: 1 - instance: true + label: true i18n: zh-CN: 主机名称 en-US: Host Name @@ -398,7 +398,7 @@ metrics: fields: - field: interface_name type: 1 - instance: true + label: true i18n: zh-CN: 网卡名称 en-US: Interface Name @@ -457,7 +457,7 @@ metrics: en-US: Usage - field: mounted type: 1 - instance: true + label: true i18n: zh-CN: 挂载点 en-US: Mounted @@ -481,7 +481,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID @@ -522,7 +522,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID diff --git a/manager/src/main/resources/define/app-debian.yml b/manager/src/main/resources/define/app-debian.yml index f11d65dedf9..a031ec98383 100644 --- a/manager/src/main/resources/define/app-debian.yml +++ b/manager/src/main/resources/define/app-debian.yml @@ -172,11 +172,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: hostname type: 1 - instance: true + label: true i18n: zh-CN: 主机名称 en-US: Host Name @@ -398,7 +398,7 @@ metrics: fields: - field: interface_name type: 1 - instance: true + label: true i18n: zh-CN: 网卡名称 en-US: Interface Name @@ -457,7 +457,7 @@ metrics: en-US: Usage - field: mounted type: 1 - instance: true + label: true i18n: zh-CN: 挂载点 en-US: Mounted @@ -481,7 +481,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID @@ -522,7 +522,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID diff --git a/manager/src/main/resources/define/app-dm.yml b/manager/src/main/resources/define/app-dm.yml index 16c4098dad5..20b1ade8f37 100644 --- a/manager/src/main/resources/define/app-dm.yml +++ b/manager/src/main/resources/define/app-dm.yml @@ -142,8 +142,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: PORT_NUM type: 1 - field: CTL_PATH diff --git a/manager/src/main/resources/define/app-docker.yml b/manager/src/main/resources/define/app-docker.yml index 4bf87010f1d..a2d69038007 100644 --- a/manager/src/main/resources/define/app-docker.yml +++ b/manager/src/main/resources/define/app-docker.yml @@ -79,7 +79,7 @@ metrics: # 指标组中的具体监控指标 fields: # metric information includes field name type field type: 0-number, 1-string whether instance is the primary key of the instance unit: metric unit - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: name type: 1 - field: version @@ -168,7 +168,7 @@ metrics: # 指标组中的具体监控指标 fields: # metric information includes field name type field type: 0-number, 1-string whether instance is the primary key of the instance unit: metric unit - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: id type: 1 - field: name diff --git a/manager/src/main/resources/define/app-doris_be.yml b/manager/src/main/resources/define/app-doris_be.yml index 9fc615e49c4..5040dd63c16 100644 --- a/manager/src/main/resources/define/app-doris_be.yml +++ b/manager/src/main/resources/define/app-doris_be.yml @@ -77,7 +77,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -91,7 +91,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -105,7 +105,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -119,7 +119,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -133,7 +133,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -147,7 +147,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -161,7 +161,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -175,7 +175,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -189,7 +189,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -203,7 +203,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -217,7 +217,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -231,7 +231,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -245,7 +245,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -259,7 +259,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -273,7 +273,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -287,7 +287,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -301,7 +301,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -315,7 +315,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true protocol: http http: host: ^_^host^_^ @@ -329,7 +329,7 @@ metrics: fields: - field: type type: 1 - instance: true + label: true - field: value type: 0 unit: Byte @@ -346,7 +346,7 @@ metrics: fields: - field: path type: 1 - instance: true + label: true - field: value type: 0 unit: Byte @@ -363,7 +363,7 @@ metrics: fields: - field: path type: 1 - instance: true + label: true - field: value type: 0 unit: Byte @@ -380,7 +380,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true unit: Byte protocol: http http: @@ -395,7 +395,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true unit: Byte protocol: http http: @@ -410,7 +410,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true unit: Byte protocol: http http: diff --git a/manager/src/main/resources/define/app-doris_fe.yml b/manager/src/main/resources/define/app-doris_fe.yml index 227c7676604..636ad98a298 100644 --- a/manager/src/main/resources/define/app-doris_fe.yml +++ b/manager/src/main/resources/define/app-doris_fe.yml @@ -77,7 +77,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: http # 当protocol为http协议时具体的采集配置 @@ -96,7 +96,7 @@ metrics: fields: - field: type type: 1 - instance: true + label: true - field: value type: 0 # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk @@ -117,7 +117,7 @@ metrics: fields: - field: type type: 1 - instance: true + label: true - field: value type: 0 # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk @@ -138,7 +138,7 @@ metrics: fields: - field: type type: 1 - instance: true + label: true - field: value type: 0 # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk @@ -159,7 +159,7 @@ metrics: fields: - field: type type: 1 - instance: true + label: true - field: value type: 0 # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk @@ -180,7 +180,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: http # 当protocol为http协议时具体的采集配置 @@ -199,7 +199,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: http # 当protocol为http协议时具体的采集配置 @@ -218,7 +218,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: http # 当protocol为http协议时具体的采集配置 @@ -237,7 +237,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: http # 当protocol为http协议时具体的采集配置 @@ -256,7 +256,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: http # 当protocol为http协议时具体的采集配置 @@ -276,7 +276,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: http # 当protocol为http协议时具体的采集配置 @@ -295,7 +295,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: http # 当protocol为http协议时具体的采集配置 @@ -314,7 +314,7 @@ metrics: fields: - field: value type: 0 - instance: true + label: true # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: http # 当protocol为http协议时具体的采集配置 @@ -333,7 +333,7 @@ metrics: fields: - field: type type: 1 - instance: true + label: true - field: value type: 0 # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk diff --git a/manager/src/main/resources/define/app-dynamic_tp.yml b/manager/src/main/resources/define/app-dynamic_tp.yml index d2a53947dbd..0bc693ed7ce 100644 --- a/manager/src/main/resources/define/app-dynamic_tp.yml +++ b/manager/src/main/resources/define/app-dynamic_tp.yml @@ -118,11 +118,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: pool_name type: 1 - instance: true + label: true - field: queue_type type: 1 - field: core_pool_size @@ -189,7 +189,7 @@ metrics: fields: - field: pool_name type: 1 - instance: true + label: true - field: queue_capacity type: 0 unit: MB diff --git a/manager/src/main/resources/define/app-elasticsearch.yml b/manager/src/main/resources/define/app-elasticsearch.yml index 46eb4646266..fedee80bdb2 100644 --- a/manager/src/main/resources/define/app-elasticsearch.yml +++ b/manager/src/main/resources/define/app-elasticsearch.yml @@ -170,11 +170,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: cluster_name type: 1 - instance: true + label: true - field: status type: 1 - field: nodes @@ -276,7 +276,7 @@ metrics: fields: - field: node_name type: 1 - instance: true + label: true - field: ip type: 1 - field: cpu_load_average diff --git a/manager/src/main/resources/define/app-emqx.yml b/manager/src/main/resources/define/app-emqx.yml index 378646e826f..85c7b15e61b 100644 --- a/manager/src/main/resources/define/app-emqx.yml +++ b/manager/src/main/resources/define/app-emqx.yml @@ -121,7 +121,7 @@ metrics: # 指标组中的具体监控指标 fields: # metrics content contains field-metric name, type-metric type:0-number,1-string, instance-if is metrics group, unit-metric unit('%','ms','MB') - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: version type: 1 i18n: @@ -202,7 +202,7 @@ metrics: # 指标组中的具体监控指标 fields: # metrics content contains field-metric name, type-metric type:0-number,1-string, instance-if is metrics group, unit-metric unit('%','ms','MB') - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: client_connected type: 0 - field: client_disconnected @@ -301,7 +301,7 @@ metrics: priority: 2 fields: # metrics content contains field-metric name, type-metric type:0-number,1-string, instance-if is metrics group, unit-metric unit('%','ms','MB') - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: channels_count type: 0 - field: channels_max diff --git a/manager/src/main/resources/define/app-euleros.yml b/manager/src/main/resources/define/app-euleros.yml index 5cd093213a6..5c14f61e494 100644 --- a/manager/src/main/resources/define/app-euleros.yml +++ b/manager/src/main/resources/define/app-euleros.yml @@ -172,11 +172,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: hostname type: 1 - instance: true + label: true i18n: zh-CN: 主机名称 en-US: Host Name @@ -398,7 +398,7 @@ metrics: fields: - field: interface_name type: 1 - instance: true + label: true i18n: zh-CN: 网卡名称 en-US: Interface Name @@ -457,7 +457,7 @@ metrics: en-US: Usage - field: mounted type: 1 - instance: true + label: true i18n: zh-CN: 挂载点 en-US: Mounted @@ -481,7 +481,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID @@ -522,7 +522,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID diff --git a/manager/src/main/resources/define/app-flink.yml b/manager/src/main/resources/define/app-flink.yml index a867f7d633b..c912be148fd 100644 --- a/manager/src/main/resources/define/app-flink.yml +++ b/manager/src/main/resources/define/app-flink.yml @@ -130,8 +130,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: flink-version type: 1 # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk diff --git a/manager/src/main/resources/define/app-freebsd.yml b/manager/src/main/resources/define/app-freebsd.yml index 182e64ca19a..0a54506b08c 100644 --- a/manager/src/main/resources/define/app-freebsd.yml +++ b/manager/src/main/resources/define/app-freebsd.yml @@ -172,11 +172,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: hostname type: 1 - instance: true + label: true i18n: zh-CN: 主机名称 en-US: Host Name @@ -374,7 +374,7 @@ metrics: en-US: Usage - field: mounted type: 1 - instance: true + label: true i18n: zh-CN: 挂载点 en-US: Mounted @@ -398,7 +398,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID @@ -439,7 +439,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID diff --git a/manager/src/main/resources/define/app-ftp.yml b/manager/src/main/resources/define/app-ftp.yml index 0ce3ce5bc7b..db82f723723 100644 --- a/manager/src/main/resources/define/app-ftp.yml +++ b/manager/src/main/resources/define/app-ftp.yml @@ -118,8 +118,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: isActive type: 1 - field: responseTime diff --git a/manager/src/main/resources/define/app-fullsite.yml b/manager/src/main/resources/define/app-fullsite.yml index d845abf886c..15c4ad259bf 100644 --- a/manager/src/main/resources/define/app-fullsite.yml +++ b/manager/src/main/resources/define/app-fullsite.yml @@ -99,11 +99,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: url type: 1 - instance: true + label: true - field: statusCode type: 1 - field: responseTime diff --git a/manager/src/main/resources/define/app-h3c_switch.yml b/manager/src/main/resources/define/app-h3c_switch.yml index 2bdf25b691f..3532cd04de9 100644 --- a/manager/src/main/resources/define/app-h3c_switch.yml +++ b/manager/src/main/resources/define/app-h3c_switch.yml @@ -148,8 +148,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: name type: 1 - field: descr @@ -195,7 +195,7 @@ metrics: type: 1 - field: descr type: 1 - instance: true + label: true - field: mtu type: 0 unit: 'byte' diff --git a/manager/src/main/resources/define/app-hadoop.yml b/manager/src/main/resources/define/app-hadoop.yml index 94ef03727a0..a2e011ab169 100644 --- a/manager/src/main/resources/define/app-hadoop.yml +++ b/manager/src/main/resources/define/app-hadoop.yml @@ -141,8 +141,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: VmName type: 1 - field: VmVendor @@ -175,7 +175,7 @@ metrics: fields: - field: name type: 1 - instance: true + label: true - field: committed type: 0 unit: MB @@ -262,8 +262,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: LoadedClassCount type: 0 - field: TotalLoadedClassCount @@ -284,8 +284,8 @@ metrics: # collect metrics content # 指标组中的具体监控指标 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: TotalStartedThreadCount type: 0 - field: ThreadCount diff --git a/manager/src/main/resources/define/app-hertzbeat.yml b/manager/src/main/resources/define/app-hertzbeat.yml index e15f1784cab..e60f8b6d7a2 100644 --- a/manager/src/main/resources/define/app-hertzbeat.yml +++ b/manager/src/main/resources/define/app-hertzbeat.yml @@ -101,10 +101,10 @@ metrics: # 指标组中的具体监控指标 fields: # metrics content contains field-metric name, type-metric type:0-number,1-string, instance-if is metrics group, unit-metric unit('%','ms','MB') - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: app type: 1 - instance: true + label: true - field: category type: 1 - field: status diff --git a/manager/src/main/resources/define/app-hertzbeat_token.yml b/manager/src/main/resources/define/app-hertzbeat_token.yml index e1f6cb2a61a..1564ec7b801 100644 --- a/manager/src/main/resources/define/app-hertzbeat_token.yml +++ b/manager/src/main/resources/define/app-hertzbeat_token.yml @@ -100,8 +100,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: token type: 1 - field: refreshToken @@ -139,7 +139,7 @@ metrics: fields: - field: app type: 1 - instance: true + label: true - field: category type: 1 - field: status diff --git a/manager/src/main/resources/define/app-hpe_switch.yml b/manager/src/main/resources/define/app-hpe_switch.yml index 89d819fe958..5b2f4c9fd43 100644 --- a/manager/src/main/resources/define/app-hpe_switch.yml +++ b/manager/src/main/resources/define/app-hpe_switch.yml @@ -148,8 +148,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: name type: 1 - field: descr @@ -195,7 +195,7 @@ metrics: type: 1 - field: descr type: 1 - instance: true + label: true - field: mtu type: 0 unit: 'byte' diff --git a/manager/src/main/resources/define/app-huawei_switch.yml b/manager/src/main/resources/define/app-huawei_switch.yml index 27512c6d7f1..9b8196499da 100644 --- a/manager/src/main/resources/define/app-huawei_switch.yml +++ b/manager/src/main/resources/define/app-huawei_switch.yml @@ -148,8 +148,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: name type: 1 - field: descr @@ -195,7 +195,7 @@ metrics: type: 1 - field: descr type: 1 - instance: true + label: true - field: mtu type: 0 unit: 'byte' diff --git a/manager/src/main/resources/define/app-influxdb_promql.yml b/manager/src/main/resources/define/app-influxdb_promql.yml index 7bf70a95712..30a06200427 100644 --- a/manager/src/main/resources/define/app-influxdb_promql.yml +++ b/manager/src/main/resources/define/app-influxdb_promql.yml @@ -135,7 +135,7 @@ metrics: # 指标组中的具体监控指标 fields: # Metric information includes the following: Field name, Type: 0-number, 1-string, instance: indicates whether the metric is the primary key, unit: the unit of the metric - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: instance type: 1 - field: timestamp @@ -199,7 +199,7 @@ metrics: # 指标组中的具体监控指标 fields: # Metric information includes the following: Field name, Type: 0-number, 1-string, instance: indicates whether the metric is the primary key, unit: the unit of the metric - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: job type: 1 - field: instance @@ -267,7 +267,7 @@ metrics: # 指标组中的具体监控指标 fields: # Metric information includes the following: Field name, Type: 0-number, 1-string, instance: indicates whether the metric is the primary key, unit: the unit of the metric - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: instance type: 1 - field: timestamp @@ -331,7 +331,7 @@ metrics: # 指标组中的具体监控指标 fields: # Metric information includes the following: Field name, Type: 0-number, 1-string, instance: indicates whether the metric is the primary key, unit: the unit of the metric - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: instance type: 1 - field: timestamp diff --git a/manager/src/main/resources/define/app-iotdb.yml b/manager/src/main/resources/define/app-iotdb.yml index edb5cd72be7..f907a45efd0 100644 --- a/manager/src/main/resources/define/app-iotdb.yml +++ b/manager/src/main/resources/define/app-iotdb.yml @@ -88,11 +88,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: name type: 1 - instance: true + label: true - field: status type: 0 # (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field @@ -130,7 +130,7 @@ metrics: type: 1 - field: id type: 1 - instance: true + label: true - field: value type: 0 unit: MB @@ -152,7 +152,7 @@ metrics: type: 1 - field: id type: 1 - instance: true + label: true - field: value type: 0 unit: MB @@ -172,7 +172,7 @@ metrics: fields: - field: state type: 1 - instance: true + label: true - field: count type: 0 aliasFields: @@ -194,7 +194,7 @@ metrics: fields: - field: id type: 1 - instance: true + label: true - field: name type: 1 - field: type @@ -221,7 +221,7 @@ metrics: fields: - field: name type: 1 - instance: true + label: true - field: value type: 0 protocol: http @@ -238,7 +238,7 @@ metrics: fields: - field: id type: 1 - instance: true + label: true - field: name type: 1 - field: status @@ -265,7 +265,7 @@ metrics: fields: - field: name type: 1 - instance: true + label: true - field: connection type: 0 aliasFields: diff --git a/manager/src/main/resources/define/app-jetty.yml b/manager/src/main/resources/define/app-jetty.yml index f02fefbe8cb..6645c306212 100644 --- a/manager/src/main/resources/define/app-jetty.yml +++ b/manager/src/main/resources/define/app-jetty.yml @@ -141,8 +141,8 @@ metrics: # monitor metric content in metrics group # 指标组中的具体监控指标 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: VmName type: 1 - field: VmVendor @@ -181,8 +181,8 @@ metrics: # monitor metric content in metrics group # 指标组中的具体监控指标 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: version type: 1 - field: state @@ -215,11 +215,11 @@ metrics: # monitor metric content in metrics group # 指标组中的具体监控指标 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: name type: 1 - instance: true + label: true - field: committed type: 0 - field: init @@ -270,8 +270,8 @@ metrics: # monitor metric content in metrics group # 指标组中的具体监控指标 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: LoadedClassCount type: 0 - field: TotalLoadedClassCount @@ -303,8 +303,8 @@ metrics: # monitor metric content in metrics group # 指标组中的具体监控指标 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: TotalStartedThreadCount type: 0 - field: ThreadCount @@ -347,11 +347,11 @@ metrics: # monitor metric content in metrics group # 指标组中的具体监控指标 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: displayName type: 1 - instance: true + label: true - field: contextPath type: 1 - field: state diff --git a/manager/src/main/resources/define/app-jvm.yml b/manager/src/main/resources/define/app-jvm.yml index 1ee41081741..68d3b9f1423 100644 --- a/manager/src/main/resources/define/app-jvm.yml +++ b/manager/src/main/resources/define/app-jvm.yml @@ -141,8 +141,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: VmName type: 1 - field: VmVendor @@ -175,7 +175,7 @@ metrics: fields: - field: name type: 1 - instance: true + label: true - field: committed type: 0 unit: MB @@ -262,8 +262,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: LoadedClassCount type: 0 - field: TotalLoadedClassCount @@ -284,8 +284,8 @@ metrics: # collect metrics content # 指标组中的具体监控指标 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: TotalStartedThreadCount type: 0 - field: ThreadCount diff --git a/manager/src/main/resources/define/app-kafka.yml b/manager/src/main/resources/define/app-kafka.yml index aba5ea83005..cda42a22709 100644 --- a/manager/src/main/resources/define/app-kafka.yml +++ b/manager/src/main/resources/define/app-kafka.yml @@ -97,8 +97,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: Version type: 1 - field: StartTimeMs @@ -148,7 +148,7 @@ metrics: fields: - field: name type: 1 - instance: true + label: true - field: committed type: 0 - field: init diff --git a/manager/src/main/resources/define/app-kafka_promql.yml b/manager/src/main/resources/define/app-kafka_promql.yml index 185eaea9f6f..9f4045049ce 100644 --- a/manager/src/main/resources/define/app-kafka_promql.yml +++ b/manager/src/main/resources/define/app-kafka_promql.yml @@ -126,7 +126,7 @@ metrics: priority: 0 # 指标组中的具体监控指标 fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: __name__ type: 1 - field: instance @@ -174,7 +174,7 @@ metrics: priority: 1 # 指标组中的具体监控指标 fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: __name__ type: 1 - field: topic @@ -223,7 +223,7 @@ metrics: priority: 1 # 指标组中的具体监控指标 fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: instance type: 1 - field: job diff --git a/manager/src/main/resources/define/app-kubernetes.yml b/manager/src/main/resources/define/app-kubernetes.yml index be776abc10a..4cedd7b356f 100644 --- a/manager/src/main/resources/define/app-kubernetes.yml +++ b/manager/src/main/resources/define/app-kubernetes.yml @@ -110,8 +110,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: node_name type: 1 - field: is_ready diff --git a/manager/src/main/resources/define/app-linux.yml b/manager/src/main/resources/define/app-linux.yml index 9aa62ded111..3fe84450707 100644 --- a/manager/src/main/resources/define/app-linux.yml +++ b/manager/src/main/resources/define/app-linux.yml @@ -172,11 +172,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: hostname type: 1 - instance: true + label: true i18n: zh-CN: 主机名称 en-US: Host Name @@ -398,7 +398,7 @@ metrics: fields: - field: interface_name type: 1 - instance: true + label: true i18n: zh-CN: 网卡名称 en-US: Interface Name @@ -457,7 +457,7 @@ metrics: en-US: Usage - field: mounted type: 1 - instance: true + label: true i18n: zh-CN: 挂载点 en-US: Mounted @@ -481,7 +481,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID @@ -522,7 +522,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID diff --git a/manager/src/main/resources/define/app-mariadb.yml b/manager/src/main/resources/define/app-mariadb.yml index 7ddbd3e2824..c2b8803a140 100644 --- a/manager/src/main/resources/define/app-mariadb.yml +++ b/manager/src/main/resources/define/app-mariadb.yml @@ -121,11 +121,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: version type: 1 - instance: true + label: true - field: port type: 1 - field: datadir @@ -616,7 +616,7 @@ metrics: fields: - field: state type: 1 - instance: true + label: true - field: num type: 0 protocol: jdbc @@ -637,7 +637,7 @@ metrics: fields: - field: id type: 1 - instance: true + label: true - field: sql_text type: 0 - field: start_time diff --git a/manager/src/main/resources/define/app-mongodb.yml b/manager/src/main/resources/define/app-mongodb.yml index afbd9cb62eb..02fa2225470 100644 --- a/manager/src/main/resources/define/app-mongodb.yml +++ b/manager/src/main/resources/define/app-mongodb.yml @@ -126,8 +126,8 @@ metrics: en-US: Build Info # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: version type: 1 i18n: diff --git a/manager/src/main/resources/define/app-mysql.yml b/manager/src/main/resources/define/app-mysql.yml index 794487f197e..38ae3d17933 100644 --- a/manager/src/main/resources/define/app-mysql.yml +++ b/manager/src/main/resources/define/app-mysql.yml @@ -172,11 +172,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: version type: 1 - instance: true + label: true i18n: zh-CN: 版本 en-US: Version @@ -278,8 +278,8 @@ metrics: zh-CN: 缓存 信息 en-US: Cache Info fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: query_cache_hit_rate type: 0 unit: '%' @@ -867,7 +867,7 @@ metrics: fields: - field: state type: 1 - instance: true + label: true i18n: zh-CN: 进程状态 en-US: State @@ -897,7 +897,7 @@ metrics: fields: - field: id type: 1 - instance: true + label: true i18n: zh-CN: ID en-US: ID diff --git a/manager/src/main/resources/define/app-nacos.yml b/manager/src/main/resources/define/app-nacos.yml index 0ca3963390e..ffcc3534265 100644 --- a/manager/src/main/resources/define/app-nacos.yml +++ b/manager/src/main/resources/define/app-nacos.yml @@ -114,7 +114,7 @@ metrics: type: 1 - field: id type: 1 - instance: true + label: true - field: value type: 0 unit: MB diff --git a/manager/src/main/resources/define/app-opengauss.yml b/manager/src/main/resources/define/app-opengauss.yml index aa1a5cebb10..38dbb4c7b90 100644 --- a/manager/src/main/resources/define/app-opengauss.yml +++ b/manager/src/main/resources/define/app-opengauss.yml @@ -87,10 +87,10 @@ metrics: priority: 0 # 指标组中的具体监控指标 fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: server_version type: 1 - instance: true + label: true - field: port type: 1 - field: server_encoding @@ -120,7 +120,7 @@ metrics: - name: state priority: 1 fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: name type: 1 - field: conflicts @@ -163,7 +163,7 @@ metrics: - name: activity priority: 2 fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: running type: 0 unit: sbc diff --git a/manager/src/main/resources/define/app-opensuse.yml b/manager/src/main/resources/define/app-opensuse.yml index 1a2ce1ed0b9..76b8a21f0d4 100644 --- a/manager/src/main/resources/define/app-opensuse.yml +++ b/manager/src/main/resources/define/app-opensuse.yml @@ -172,11 +172,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: hostname type: 1 - instance: true + label: true i18n: zh-CN: 主机名称 en-US: Host Name @@ -398,7 +398,7 @@ metrics: fields: - field: interface_name type: 1 - instance: true + label: true i18n: zh-CN: 网卡名称 en-US: Interface Name @@ -457,7 +457,7 @@ metrics: en-US: Usage - field: mounted type: 1 - instance: true + label: true i18n: zh-CN: 挂载点 en-US: Mounted @@ -481,7 +481,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID @@ -522,7 +522,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID diff --git a/manager/src/main/resources/define/app-oracle.yml b/manager/src/main/resources/define/app-oracle.yml index 6050090d4a4..1ffa7367c7c 100644 --- a/manager/src/main/resources/define/app-oracle.yml +++ b/manager/src/main/resources/define/app-oracle.yml @@ -119,11 +119,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: database_version type: 1 - instance: true + label: true - field: hostname type: 1 - field: instance_name @@ -179,7 +179,7 @@ metrics: fields: - field: file_id type: 1 - instance: true + label: true - field: file_name type: 1 - field: tablespace_name @@ -265,7 +265,7 @@ metrics: fields: - field: username type: 1 - instance: true + label: true - field: count type: 0 protocol: jdbc @@ -320,7 +320,7 @@ metrics: fields: - field: tablespace_name type: 1 - instance: true + label: true - field: total type: 0 - field: used @@ -456,7 +456,7 @@ metrics: fields: - field: type type: 1 - instance: true + label: true - field: num type: 1 protocol: jdbc @@ -477,7 +477,7 @@ metrics: fields: - field: type type: 1 - instance: true + label: true - field: num type: 1 protocol: jdbc diff --git a/manager/src/main/resources/define/app-ping.yml b/manager/src/main/resources/define/app-ping.yml index da371e97aa8..1ddc668318b 100644 --- a/manager/src/main/resources/define/app-ping.yml +++ b/manager/src/main/resources/define/app-ping.yml @@ -89,9 +89,9 @@ metrics: # 指标组调度优先级(0->127)->(优先级高->低) 优先级低的指标组会等优先级高的指标组采集完成后才会被调度, 相同优先级的指标组会并行调度采集 # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 0 - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 fields: - field: responseTime type: 0 diff --git a/manager/src/main/resources/define/app-port.yml b/manager/src/main/resources/define/app-port.yml index 0a12040f6db..a8a5941e0f5 100644 --- a/manager/src/main/resources/define/app-port.yml +++ b/manager/src/main/resources/define/app-port.yml @@ -100,9 +100,9 @@ metrics: # 指标组调度优先级(0->127)->(优先级高->低) 优先级低的指标组会等优先级高的指标组采集完成后才会被调度, 相同优先级的指标组会并行调度采集 # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 0 - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 fields: - field: responseTime type: 0 diff --git a/manager/src/main/resources/define/app-postgresql.yml b/manager/src/main/resources/define/app-postgresql.yml index a997eb83847..6b36e6151c0 100644 --- a/manager/src/main/resources/define/app-postgresql.yml +++ b/manager/src/main/resources/define/app-postgresql.yml @@ -120,11 +120,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: server_version type: 1 - instance: true + label: true - field: port type: 1 - field: server_encoding @@ -163,7 +163,7 @@ metrics: fields: - field: db_name type: 1 - instance: true + label: true - field: conflicts type: 0 unit: times @@ -271,7 +271,7 @@ metrics: fields: - field: state type: 1 - instance: true + label: true - field: num type: 0 protocol: jdbc @@ -292,7 +292,7 @@ metrics: fields: - field: db_name type: 1 - instance: true + label: true - field: active type: 0 protocol: jdbc @@ -339,7 +339,7 @@ metrics: fields: - field: db_name type: 1 - instance: true + label: true - field: num type: 0 - field: size @@ -363,7 +363,7 @@ metrics: fields: - field: db_name type: 1 - instance: true + label: true - field: conflicts type: 0 unit: times @@ -388,7 +388,7 @@ metrics: fields: - field: sql_text type: 1 - instance: true + label: true - field: calls type: 0 - field: rows @@ -427,7 +427,7 @@ metrics: fields: - field: db_name type: 1 - instance: true + label: true - field: commits type: 0 unit: times @@ -452,7 +452,7 @@ metrics: fields: - field: db_name type: 1 - instance: true + label: true - field: tablespace type: 0 - field: lock @@ -481,7 +481,7 @@ metrics: fields: - field: db_name type: 1 - instance: true + label: true - field: ratio type: 0 unit: '%' diff --git a/manager/src/main/resources/define/app-rabbitmq.yml b/manager/src/main/resources/define/app-rabbitmq.yml index b06bf639945..96dd8afe3f1 100644 --- a/manager/src/main/resources/define/app-rabbitmq.yml +++ b/manager/src/main/resources/define/app-rabbitmq.yml @@ -144,8 +144,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: product_version type: 1 - field: product_name @@ -192,8 +192,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: channels type: 0 - field: connections @@ -235,11 +235,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: name type: 1 - instance: true + label: true - field: type type: 1 - field: running @@ -356,11 +356,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: name type: 1 - instance: true + label: true - field: node type: 1 - field: state diff --git a/manager/src/main/resources/define/app-redhat.yml b/manager/src/main/resources/define/app-redhat.yml index 8d56ac65502..e339e0f0fbc 100644 --- a/manager/src/main/resources/define/app-redhat.yml +++ b/manager/src/main/resources/define/app-redhat.yml @@ -172,11 +172,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: hostname type: 1 - instance: true + label: true i18n: zh-CN: 主机名称 en-US: Host Name @@ -398,7 +398,7 @@ metrics: fields: - field: interface_name type: 1 - instance: true + label: true i18n: zh-CN: 网卡名称 en-US: Interface Name @@ -457,7 +457,7 @@ metrics: en-US: Usage - field: mounted type: 1 - instance: true + label: true i18n: zh-CN: 挂载点 en-US: Mounted @@ -481,7 +481,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID @@ -522,7 +522,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID diff --git a/manager/src/main/resources/define/app-redis.yml b/manager/src/main/resources/define/app-redis.yml index d8a53ee9525..9af4d631cd5 100644 --- a/manager/src/main/resources/define/app-redis.yml +++ b/manager/src/main/resources/define/app-redis.yml @@ -120,8 +120,8 @@ metrics: # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 0 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: identity type: 1 - field: redis_version @@ -236,8 +236,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: used_memory type: 0 - field: used_memory_human @@ -362,8 +362,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: loading type: 0 - field: current_cow_size @@ -443,8 +443,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: total_connections_received type: 0 - field: total_commands_processed @@ -554,8 +554,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: role type: 1 - field: connected_slaves @@ -611,8 +611,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: used_cpu_sys type: 0 - field: used_cpu_user @@ -658,8 +658,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: errorstat_ERR type: 1 - field: errorstat_MISCONF @@ -693,8 +693,8 @@ metrics: # 具体监控指标列表 priority: 9 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: cluster_enabled type: 0 # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk @@ -730,8 +730,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: cmdstat_set type: 1 - field: cmdstat_get @@ -785,8 +785,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: db0 type: 1 - field: db1 diff --git a/manager/src/main/resources/define/app-redis_cluster.yml b/manager/src/main/resources/define/app-redis_cluster.yml index 7be0f1a4184..cf5634ea05d 100644 --- a/manager/src/main/resources/define/app-redis_cluster.yml +++ b/manager/src/main/resources/define/app-redis_cluster.yml @@ -149,8 +149,8 @@ metrics: # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 0 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: identity type: 1 - field: redis_version @@ -230,8 +230,8 @@ metrics: # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 1 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: identity type: 1 - field: connected_clients @@ -280,8 +280,8 @@ metrics: # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 2 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: identity type: 1 - field: used_memory @@ -405,8 +405,8 @@ metrics: # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 3 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: identity type: 1 - field: loading @@ -485,8 +485,8 @@ metrics: # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 4 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: identity type: 1 - field: total_connections_received @@ -595,8 +595,8 @@ metrics: # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 5 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: identity type: 1 - field: role @@ -651,8 +651,8 @@ metrics: # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 6 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: identity type: 1 - field: used_cpu_sys @@ -697,8 +697,8 @@ metrics: # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 8 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: identity type: 1 - field: errorstat_ERR @@ -735,8 +735,8 @@ metrics: # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 9 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: identity type: 1 - field: cluster_enabled @@ -803,8 +803,8 @@ metrics: # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 9 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: identity type: 1 - field: cmdstat_set @@ -858,8 +858,8 @@ metrics: # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 9 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: identity type: 1 - field: db0 diff --git a/manager/src/main/resources/define/app-redis_sentinel.yml b/manager/src/main/resources/define/app-redis_sentinel.yml index 344ccb0809b..58ca84ce816 100644 --- a/manager/src/main/resources/define/app-redis_sentinel.yml +++ b/manager/src/main/resources/define/app-redis_sentinel.yml @@ -147,8 +147,8 @@ metrics: # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 0 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: identity type: 1 - field: redis_version @@ -227,8 +227,8 @@ metrics: # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 1 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: connected_clients type: 0 - field: cluster_connections @@ -275,8 +275,8 @@ metrics: # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 2 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: total_connections_received type: 0 - field: total_commands_processed @@ -383,8 +383,8 @@ metrics: # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 3 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: used_cpu_sys type: 0 - field: used_cpu_user @@ -427,8 +427,8 @@ metrics: # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 4 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: sentinel_masters type: 1 - field: sentinel_tilt diff --git a/manager/src/main/resources/define/app-rocketmq.yml b/manager/src/main/resources/define/app-rocketmq.yml index 8cf8bf0ce3e..5b253e150a4 100644 --- a/manager/src/main/resources/define/app-rocketmq.yml +++ b/manager/src/main/resources/define/app-rocketmq.yml @@ -70,7 +70,7 @@ metrics: type: 1 - field: Address type: 1 - instance: true + label: true - field: Version type: 1 - field: Producer_Message_TPS @@ -119,7 +119,7 @@ metrics: fields: - field: Consumer_group type: 1 - instance: true + label: true - field: Client_quantity type: 0 - field: Message_model diff --git a/manager/src/main/resources/define/app-rockylinux.yml b/manager/src/main/resources/define/app-rockylinux.yml index 615fd824073..5d41349091b 100644 --- a/manager/src/main/resources/define/app-rockylinux.yml +++ b/manager/src/main/resources/define/app-rockylinux.yml @@ -172,11 +172,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: hostname type: 1 - instance: true + label: true i18n: zh-CN: 主机名称 en-US: Host Name @@ -398,7 +398,7 @@ metrics: fields: - field: interface_name type: 1 - instance: true + label: true i18n: zh-CN: 网卡名称 en-US: Interface Name @@ -457,7 +457,7 @@ metrics: en-US: Usage - field: mounted type: 1 - instance: true + label: true i18n: zh-CN: 挂载点 en-US: Mounted @@ -481,7 +481,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID @@ -522,7 +522,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID diff --git a/manager/src/main/resources/define/app-shenyu.yml b/manager/src/main/resources/define/app-shenyu.yml index 2b446f425ba..c82fd9c1c49 100644 --- a/manager/src/main/resources/define/app-shenyu.yml +++ b/manager/src/main/resources/define/app-shenyu.yml @@ -73,7 +73,7 @@ metrics: - name: shenyu_request_throw_created priority: 1 fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: value type: 0 # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk @@ -93,7 +93,7 @@ metrics: - name: process_cpu_seconds_total priority: 1 fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: value type: 0 unit: s @@ -114,7 +114,7 @@ metrics: - name: process_open_fds priority: 1 fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: value type: 0 # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk @@ -134,7 +134,7 @@ metrics: - name: process_max_fds priority: 1 fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: value type: 0 # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk @@ -154,7 +154,7 @@ metrics: - name: jvm_info priority: 1 fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: runtime type: 1 - field: vendor @@ -178,10 +178,10 @@ metrics: - name: jvm_memory_bytes_used priority: 1 fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: area type: 1 - instance: true + label: true - field: value type: 0 unit: MB @@ -204,10 +204,10 @@ metrics: - name: jvm_memory_pool_bytes_used priority: 1 fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: pool type: 1 - instance: true + label: true - field: value type: 0 unit: MB @@ -230,10 +230,10 @@ metrics: - name: jvm_memory_pool_bytes_committed priority: 1 fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: pool type: 1 - instance: true + label: true - field: value type: 0 unit: MB @@ -256,10 +256,10 @@ metrics: - name: jvm_memory_pool_bytes_max priority: 1 fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: pool type: 1 - instance: true + label: true - field: value type: 0 unit: MB @@ -282,10 +282,10 @@ metrics: - name: jvm_threads_state priority: 1 fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: state type: 1 - instance: true + label: true - field: count type: 0 aliasFields: diff --git a/manager/src/main/resources/define/app-spark.yml b/manager/src/main/resources/define/app-spark.yml index bd64979dcdb..b20eb3e5ed1 100644 --- a/manager/src/main/resources/define/app-spark.yml +++ b/manager/src/main/resources/define/app-spark.yml @@ -141,8 +141,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: VmName type: 1 - field: VmVendor @@ -175,7 +175,7 @@ metrics: fields: - field: name type: 1 - instance: true + label: true - field: committed type: 0 unit: MB @@ -262,8 +262,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: LoadedClassCount type: 0 - field: TotalLoadedClassCount @@ -284,8 +284,8 @@ metrics: # collect metrics content # 指标组中的具体监控指标 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: TotalStartedThreadCount type: 0 - field: ThreadCount diff --git a/manager/src/main/resources/define/app-springboot2.yml b/manager/src/main/resources/define/app-springboot2.yml index 2140c7c4e9e..0d2438f0833 100644 --- a/manager/src/main/resources/define/app-springboot2.yml +++ b/manager/src/main/resources/define/app-springboot2.yml @@ -119,7 +119,7 @@ metrics: # 指标组中的具体监控指标 fields: # field-metric name, type-metric type(0-number,1-string), instance-is instance primary key, unit-metric unit - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: responseTime type: 0 unit: ms @@ -155,7 +155,7 @@ metrics: # 指标组中的具体监控指标 fields: # The metric information, including field name, type of the field (0-number, 1-string), whether it is an instance primary key, and the unit of the metric. - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: profile type: 1 - field: port @@ -246,7 +246,7 @@ metrics: fields: - field: state type: 1 - instance: true + label: true - field: size type: 0 aliasFields: @@ -285,7 +285,7 @@ metrics: fields: - field: space type: 1 - instance: true + label: true - field: mem_used type: 0 unit: MB diff --git a/manager/src/main/resources/define/app-springboot3.yml b/manager/src/main/resources/define/app-springboot3.yml index 3376406d58c..c537b5b3f1f 100644 --- a/manager/src/main/resources/define/app-springboot3.yml +++ b/manager/src/main/resources/define/app-springboot3.yml @@ -120,7 +120,7 @@ metrics: # 指标组中的具体监控指标 fields: # field-metric name, type-metric type(0-number,1-string), instance-is instance primary key, unit-metric unit - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 - field: responseTime type: 0 unit: ms @@ -171,7 +171,7 @@ metrics: fields: - field: state type: 1 - instance: true + label: true - field: size type: 0 aliasFields: @@ -210,7 +210,7 @@ metrics: fields: - field: space type: 1 - instance: true + label: true - field: mem_used type: 0 unit: MB diff --git a/manager/src/main/resources/define/app-sqlserver.yml b/manager/src/main/resources/define/app-sqlserver.yml index 1918bdbc5dc..3450a9d55ad 100644 --- a/manager/src/main/resources/define/app-sqlserver.yml +++ b/manager/src/main/resources/define/app-sqlserver.yml @@ -169,11 +169,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: machine_name type: 1 - instance: true + label: true - field: server_name type: 1 - field: version diff --git a/manager/src/main/resources/define/app-ssl_cert.yml b/manager/src/main/resources/define/app-ssl_cert.yml index 92270993791..a5cf620e43d 100644 --- a/manager/src/main/resources/define/app-ssl_cert.yml +++ b/manager/src/main/resources/define/app-ssl_cert.yml @@ -107,11 +107,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: subject type: 1 - instance: true + label: true - field: expired type: 1 - field: start_time diff --git a/manager/src/main/resources/define/app-tidb.yml b/manager/src/main/resources/define/app-tidb.yml index ec16517f09e..9fd9e9861e1 100644 --- a/manager/src/main/resources/define/app-tidb.yml +++ b/manager/src/main/resources/define/app-tidb.yml @@ -143,8 +143,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: connections type: 0 - field: version @@ -237,11 +237,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: version type: 1 - instance: true + label: true - field: port type: 1 - field: datadir diff --git a/manager/src/main/resources/define/app-tomcat.yml b/manager/src/main/resources/define/app-tomcat.yml index 4223c452512..e2f23c0cdce 100644 --- a/manager/src/main/resources/define/app-tomcat.yml +++ b/manager/src/main/resources/define/app-tomcat.yml @@ -141,8 +141,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: serverInfo type: 1 - field: serverNumber @@ -175,7 +175,7 @@ metrics: fields: - field: name type: 1 - instance: true + label: true - field: committed type: 0 unit: MB @@ -271,7 +271,7 @@ metrics: fields: - field: name type: 1 - instance: true + label: true - field: acceptCount type: 0 - field: acceptorThreadCount diff --git a/manager/src/main/resources/define/app-tplink_switch.yml b/manager/src/main/resources/define/app-tplink_switch.yml index 26b79d63352..edbdd01d6b6 100644 --- a/manager/src/main/resources/define/app-tplink_switch.yml +++ b/manager/src/main/resources/define/app-tplink_switch.yml @@ -148,8 +148,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: name type: 1 - field: descr @@ -195,7 +195,7 @@ metrics: type: 1 - field: descr type: 1 - instance: true + label: true - field: mtu type: 0 unit: 'byte' diff --git a/manager/src/main/resources/define/app-ubuntu.yml b/manager/src/main/resources/define/app-ubuntu.yml index eb5ca2aa3e9..5bf51762bec 100644 --- a/manager/src/main/resources/define/app-ubuntu.yml +++ b/manager/src/main/resources/define/app-ubuntu.yml @@ -172,11 +172,11 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: hostname type: 1 - instance: true + label: true i18n: zh-CN: 主机名称 en-US: Host Name @@ -398,7 +398,7 @@ metrics: fields: - field: interface_name type: 1 - instance: true + label: true i18n: zh-CN: 网卡名称 en-US: Interface Name @@ -457,7 +457,7 @@ metrics: en-US: Usage - field: mounted type: 1 - instance: true + label: true i18n: zh-CN: 挂载点 en-US: Mounted @@ -481,7 +481,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID @@ -522,7 +522,7 @@ metrics: fields: - field: pid type: 1 - instance: true + label: true i18n: zh-CN: 进程ID en-US: PID diff --git a/manager/src/main/resources/define/app-udp_port.yml b/manager/src/main/resources/define/app-udp_port.yml index 553c7fd111f..115035c6aef 100644 --- a/manager/src/main/resources/define/app-udp_port.yml +++ b/manager/src/main/resources/define/app-udp_port.yml @@ -109,9 +109,9 @@ metrics: # 指标组调度优先级(0->127)->(优先级高->低) 优先级低的指标组会等优先级高的指标组采集完成后才会被调度, 相同优先级的指标组会并行调度采集 # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度 priority: 0 - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位 - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label-是否是指标标签字段 unit:指标单位 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 fields: - field: responseTime type: 0 diff --git a/manager/src/main/resources/define/app-website.yml b/manager/src/main/resources/define/app-website.yml index 1293b751a11..d2fc2da9d6f 100644 --- a/manager/src/main/resources/define/app-website.yml +++ b/manager/src/main/resources/define/app-website.yml @@ -215,8 +215,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: responseTime type: 0 unit: ms diff --git a/manager/src/main/resources/define/app-windows.yml b/manager/src/main/resources/define/app-windows.yml index bccd8b7de69..0709107e549 100644 --- a/manager/src/main/resources/define/app-windows.yml +++ b/manager/src/main/resources/define/app-windows.yml @@ -148,8 +148,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: name type: 1 - field: descr @@ -240,7 +240,7 @@ metrics: fields: - field: descr type: 1 - instance: true + label: true - field: size type: 0 unit: GB @@ -299,7 +299,7 @@ metrics: type: 1 - field: descr type: 1 - instance: true + label: true - field: mtu type: 0 unit: 'byte' @@ -381,7 +381,7 @@ metrics: fields: - field: index type: 1 - instance: true + label: true - field: descr type: 1 - field: status diff --git a/manager/src/main/resources/define/app-zookeeper.yml b/manager/src/main/resources/define/app-zookeeper.yml index 026075e7e0c..1f909d73c97 100644 --- a/manager/src/main/resources/define/app-zookeeper.yml +++ b/manager/src/main/resources/define/app-zookeeper.yml @@ -104,8 +104,8 @@ metrics: # collect metrics content # 具体监控指标列表 fields: - # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), instance-if is metrics group unique identifier - # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: clientPort type: 0 - field: dataDir diff --git a/pom.xml b/pom.xml index 174a5aca340..0aad63104c4 100644 --- a/pom.xml +++ b/pom.xml @@ -68,6 +68,7 @@ 3.0.0 0.13.3 4.4 + 3.10.0 @@ -160,6 +161,11 @@ protobuf-java ${protobuf.version} + + commons-net + commons-net + ${commons-net} + mysql diff --git a/script/application.yml b/script/application.yml index 2f5308cbf67..f09982b0360 100644 --- a/script/application.yml +++ b/script/application.yml @@ -104,6 +104,11 @@ warehouse: jpa: enabled: true expire-time: 1h + victoria-metrics: + enabled: false + url: http://localhost:8428 + username: root + password: root td-engine: enabled: false driver-class-name: com.taosdata.jdbc.rs.RestfulDriver diff --git a/script/helm/hertzbeat/templates/manager/configmap.yaml b/script/helm/hertzbeat/templates/manager/configmap.yaml index 7e7cde9d58a..4e42f7d9313 100644 --- a/script/helm/hertzbeat/templates/manager/configmap.yaml +++ b/script/helm/hertzbeat/templates/manager/configmap.yaml @@ -106,6 +106,11 @@ data: # (please set this configuration reasonably as history records can affect performance when it is large) # 历史数据的最大保留条数,超过此数量时,将会删除一半于此配量的数据(由于历史数据较大时会影响性能,请合理设置此配置) max-history-record-num: 6000 + victoria-metrics: + enabled: false + url: http://localhost:8428 + username: root + password: root td-engine: enabled: false driver-class-name: com.taosdata.jdbc.rs.RestfulDriver diff --git a/warehouse/pom.xml b/warehouse/pom.xml index 318434f912c..25c1bf595e9 100644 --- a/warehouse/pom.xml +++ b/warehouse/pom.xml @@ -43,6 +43,11 @@ hertzbeat-common provided + + + commons-net + commons-net + org.springframework.boot diff --git a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/config/WarehouseProperties.java b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/config/WarehouseProperties.java index 37250e03e1b..5ff7556fb49 100644 --- a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/config/WarehouseProperties.java +++ b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/config/WarehouseProperties.java @@ -152,6 +152,10 @@ public static class StoreProperties { * redis配置信息 */ private RedisProperties redis; + /** + * VictoriaMetrics Properties + */ + private VictoriaMetricsProperties victoriaMetrics; /** * TdEngine配置信息 */ @@ -197,6 +201,14 @@ public void setRedis(RedisProperties redis) { this.redis = redis; } + public VictoriaMetricsProperties getVictoriaMetrics() { + return victoriaMetrics; + } + + public void setVictoriaMetrics(VictoriaMetricsProperties victoriaMetrics) { + this.victoriaMetrics = victoriaMetrics; + } + public TdEngineProperties getTdEngine() { return tdEngine; } @@ -439,6 +451,58 @@ public void setTableStrColumnDefineMaxLength(int tableStrColumnDefineMaxLength) } } + public static class VictoriaMetricsProperties { + /** + * Whether the VictoriaMetrics data store is enabled + */ + private boolean enabled = false; + /** + * VictoriaMetrics connect url + */ + private String url = "http://localhost:8428"; + /** + * VictoriaMetrics username + */ + private String username; + /** + * VictoriaMetrics password + */ + private String password; + + public boolean isEnabled() { + return enabled; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + } + public static class RedisProperties { /** * redis数据存储是否启动 diff --git a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/controller/MetricsDataController.java b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/controller/MetricsDataController.java index 1c6aa0ef123..8385e9b8f5e 100644 --- a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/controller/MetricsDataController.java +++ b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/controller/MetricsDataController.java @@ -39,6 +39,8 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import java.util.HashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -114,16 +116,29 @@ public ResponseEntity> getMetricsData( List fields = storageData.getFieldsList().stream().map(tmpField -> Field.builder().name(tmpField.getName()) .type(Integer.valueOf(tmpField.getType()).byteValue()) + .label(tmpField.getLabel()) .unit(tmpField.getUnit()) .build()) .collect(Collectors.toList()); dataBuilder.fields(fields); - List valueRows = storageData.getValuesList().stream().map(redisValueRow -> - ValueRow.builder().instance(redisValueRow.getInstance()) - .values(redisValueRow.getColumnsList().stream() - .map(origin -> CommonConstants.NULL_VALUE.equals(origin) ? new Value() - : new Value(origin)).collect(Collectors.toList())) - .build()).collect(Collectors.toList()); + List valueRows = new LinkedList<>(); + for (CollectRep.ValueRow valueRow : storageData.getValuesList()) { + Map labels = new HashMap<>(8); + List values = new LinkedList<>(); + for (int i = 0; i < fields.size(); i++) { + Field field = fields.get(i); + String origin = valueRow.getColumns(i); + if (CommonConstants.NULL_VALUE.equals(origin)) { + values.add(new Value()); + } else { + values.add(new Value(origin)); + if (field.getLabel()) { + labels.put(field.getName(), origin); + } + } + } + valueRows.add(ValueRow.builder().labels(labels).values(values).build()); + } dataBuilder.valueRows(valueRows); return ResponseEntity.ok(Message.success(dataBuilder.build())); } diff --git a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/AbstractHistoryDataStorage.java b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/AbstractHistoryDataStorage.java index 87fce0b0a45..ce6348ad5c0 100644 --- a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/AbstractHistoryDataStorage.java +++ b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/AbstractHistoryDataStorage.java @@ -54,12 +54,12 @@ public boolean isServerAvailable() { * @param app 监控类型 * @param metrics 指标集合名 * @param metric 指标名 - * @param instance 实例 + * @param label 标签 * @param history 历史范围 * @return 指标历史数据列表 */ public abstract Map> getHistoryMetricData( - Long monitorId, String app, String metrics, String metric, String instance, String history); + Long monitorId, String app, String metrics, String metric, String label, String history); /** * 从时序数据库获取指标历史间隔数据 平均值 最大值 最小值 @@ -67,10 +67,10 @@ public abstract Map> getHistoryMetricData( * @param app 监控类型 * @param metrics 指标集合名 * @param metric 指标名 - * @param instance 实例 + * @param label 标签 * @param history 历史范围 * @return 指标历史数据列表 */ public abstract Map> getHistoryIntervalMetricData( - Long monitorId, String app, String metrics, String metric, String instance, String history); + Long monitorId, String app, String metrics, String metric, String label, String history); } diff --git a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryGrepTimeDbDataStorage.java b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryGrepTimeDbDataStorage.java index 9e80427af38..d05404c187e 100644 --- a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryGrepTimeDbDataStorage.java +++ b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryGrepTimeDbDataStorage.java @@ -23,6 +23,7 @@ import org.dromara.hertzbeat.common.entity.dto.Value; import org.dromara.hertzbeat.common.entity.message.CollectRep; import org.dromara.hertzbeat.common.constants.CommonConstants; +import org.dromara.hertzbeat.common.util.JsonUtil; import org.dromara.hertzbeat.common.util.TimePeriodUtil; import org.dromara.hertzbeat.warehouse.config.WarehouseProperties; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; @@ -182,27 +183,25 @@ void saveData(CollectRep.MetricsData metricsData) { values[0] = monitorId; values[2] = now; for (CollectRep.ValueRow valueRow : metricsData.getValuesList()) { - String instance = valueRow.getInstance(); - if (!instance.isEmpty()) { - instance = String.format("\"%s\"", instance); - values[1] = instance; - } else { - values[1] = null; - } + Map labels = new HashMap<>(8); for (int i = 0; i < fieldsList.size(); i++) { if (!CommonConstants.NULL_VALUE.equals(valueRow.getColumns(i))) { - if (fieldsList.get(i).getType() == CommonConstants.TYPE_NUMBER) { + CollectRep.Field field = fieldsList.get(i); + if (field.getType() == CommonConstants.TYPE_NUMBER) { values[3 + i] = Double.parseDouble(valueRow.getColumns(i)); - } else if (fieldsList.get(i).getType() == CommonConstants.TYPE_STRING) { + } else if (field.getType() == CommonConstants.TYPE_STRING) { values[3 + i] = valueRow.getColumns(i); } + if (field.getLabel()) { + labels.put(field.getName(), String.valueOf(values[3 + i])); + } } else { values[3 + i] = null; } } + values[1] = JsonUtil.toJson(labels); rows.insert(values); } - rows.finish(); CompletableFuture> writeFuture = greptimeDb.write(rows); try { @@ -222,7 +221,7 @@ void saveData(CollectRep.MetricsData metricsData) { @Override public Map> getHistoryMetricData(Long monitorId, String app, String metrics, String metric, - String instance, String history) { + String label, String history) { Map> instanceValuesMap = new HashMap<>(8); if (!isServerAvailable()) { log.error("\n\t---------------Greptime Init Failed---------------\n" + @@ -232,9 +231,9 @@ public Map> getHistoryMetricData(Long monitorId, String app, } long expireTime = getExpireTimeFromToken(history); String table = app + "_" + metrics; - String selectSql = instance == null ? + String selectSql = label == null ? String.format(QUERY_HISTORY_SQL, metric, table, expireTime, monitorId) - : String.format(QUERY_HISTORY_WITH_INSTANCE_SQL, metric, table, expireTime, monitorId, instance); + : String.format(QUERY_HISTORY_WITH_INSTANCE_SQL, metric, table, expireTime, monitorId, label); log.debug("selectSql: {}", selectSql); QueryRequest request = QueryRequest.newBuilder() .exprType(SelectExprType.Sql) @@ -289,7 +288,7 @@ private long getExpireTimeFromToken(String history) { @Override public Map> getHistoryIntervalMetricData(Long monitorId, String app, String metrics, - String metric, String instance, String history) { + String metric, String label, String history) { Map> instanceValuesMap = new HashMap<>(8); if (!isServerAvailable()) { log.error("\n\t---------------Greptime Init Failed---------------\n" + @@ -299,8 +298,8 @@ public Map> getHistoryIntervalMetricData(Long monitorId, Str } String table = app + "_" + metrics; List instances = new LinkedList<>(); - if (instance != null) { - instances.add(instance); + if (label != null) { + instances.add(label); } if (instances.isEmpty()) { String selectSql = String.format(QUERY_INSTANCE_SQL, table); diff --git a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryInfluxdbDataStorage.java b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryInfluxdbDataStorage.java index 492976a7c4f..650806847e3 100644 --- a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryInfluxdbDataStorage.java +++ b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryInfluxdbDataStorage.java @@ -6,6 +6,7 @@ import org.dromara.hertzbeat.common.constants.CommonConstants; import org.dromara.hertzbeat.common.entity.dto.Value; import org.dromara.hertzbeat.common.entity.message.CollectRep; +import org.dromara.hertzbeat.common.util.JsonUtil; import org.dromara.hertzbeat.warehouse.config.WarehouseProperties; import org.influxdb.InfluxDB; import org.influxdb.InfluxDBFactory; @@ -130,19 +131,23 @@ void saveData(CollectRep.MetricsData metricsData) { for (CollectRep.ValueRow valueRow : metricsData.getValuesList()) { Point.Builder builder = Point.measurement(table); builder.time(metricsData.getTime(), TimeUnit.MILLISECONDS); - String instance = valueRow.getInstance(); - builder.tag("instance", instance); + Map labels = new HashMap<>(8); for (int i = 0; i < fieldsList.size(); i++) { + CollectRep.Field field = fieldsList.get(i); if (!CommonConstants.NULL_VALUE.equals(valueRow.getColumns(i))) { - if (fieldsList.get(i).getType() == CommonConstants.TYPE_NUMBER) { - builder.addField(fieldsList.get(i).getName(), Double.parseDouble(valueRow.getColumns(i))); - } else if (fieldsList.get(i).getType() == CommonConstants.TYPE_STRING) { - builder.addField(fieldsList.get(i).getName(), valueRow.getColumns(i)); + if (field.getType() == CommonConstants.TYPE_NUMBER) { + builder.addField(field.getName(), Double.parseDouble(valueRow.getColumns(i))); + } else if (field.getType() == CommonConstants.TYPE_STRING) { + builder.addField(field.getName(), valueRow.getColumns(i)); + } + if (field.getLabel()) { + labels.put(field.getName(), valueRow.getColumns(i)); } } else { - builder.addField(fieldsList.get(i).getName(), ""); + builder.addField(field.getName(), ""); } } + builder.tag("instance", JsonUtil.toJson(labels)); points.add(builder.build()); } BatchPoints.Builder builder = BatchPoints.database(DATABASE); @@ -151,10 +156,10 @@ void saveData(CollectRep.MetricsData metricsData) { } @Override - public Map> getHistoryMetricData(Long monitorId, String app, String metrics, String metric, String instance, String history) { + public Map> getHistoryMetricData(Long monitorId, String app, String metrics, String metric, String label, String history) { String table = this.generateTable(app, metrics, monitorId); - String selectSql = instance == null ? String.format(QUERY_HISTORY_SQL, metric, table, history) - : String.format(QUERY_HISTORY_SQL_WITH_INSTANCE, metric, table, instance, history); + String selectSql = label == null ? String.format(QUERY_HISTORY_SQL, metric, table, history) + : String.format(QUERY_HISTORY_SQL_WITH_INSTANCE, metric, table, label, history); Map> instanceValueMap = new HashMap<>(8); try { QueryResult selectResult = this.influxDb.query(new Query(selectSql, DATABASE), TimeUnit.MILLISECONDS); @@ -182,12 +187,12 @@ public Map> getHistoryMetricData(Long monitorId, String app, } @Override - public Map> getHistoryIntervalMetricData(Long monitorId, String app, String metrics, String metric, String instance, String history) { + public Map> getHistoryIntervalMetricData(Long monitorId, String app, String metrics, String metric, String label, String history) { String table = this.generateTable(app, metrics, monitorId); Map> instanceValueMap = new HashMap<>(8); Set instances = new HashSet<>(8); - if (instance != null) { - instances.add(instance); + if (label != null) { + instances.add(label); } if (instances.isEmpty()) { // query the instance near 1week diff --git a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryIotDbDataStorage.java b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryIotDbDataStorage.java index 8ef04428de9..bce500645ab 100644 --- a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryIotDbDataStorage.java +++ b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryIotDbDataStorage.java @@ -20,6 +20,7 @@ import org.dromara.hertzbeat.common.entity.dto.Value; import org.dromara.hertzbeat.common.entity.message.CollectRep; import org.dromara.hertzbeat.common.constants.CommonConstants; +import org.dromara.hertzbeat.common.util.JsonUtil; import org.dromara.hertzbeat.warehouse.config.IotDbVersion; import org.dromara.hertzbeat.warehouse.config.WarehouseProperties; import lombok.extern.slf4j.Slf4j; @@ -50,7 +51,6 @@ @Slf4j public class HistoryIotDbDataStorage extends AbstractHistoryDataStorage { private static final String BACK_QUOTE = "`"; - private static final String DOUBLE_QUOTATION_MARKS = "\""; /** * set ttl never expire */ @@ -79,7 +79,7 @@ public class HistoryIotDbDataStorage extends AbstractHistoryDataStorage { private static final String QUERY_HISTORY_SQL = "SELECT %s FROM %s WHERE Time >= now() - %s order by Time desc"; private static final String QUERY_HISTORY_INTERVAL_WITH_INSTANCE_SQL - = "SELECT FIRST_VALUE(%s), AVG(%s), MIN_VALUE(%s), MAX_VALUE(%s) FROM %s GROUP BY ([now() - %s, now()), 4h) WITHOUT NULL ANY"; + = "SELECT FIRST_VALUE(%s), AVG(%s), MIN_VALUE(%s), MAX_VALUE(%s) FROM %s GROUP BY ([now() - %s, now()), 4h)"; private SessionPool sessionPool; @@ -207,29 +207,34 @@ void saveData(CollectRep.MetricsData metricsData) { try { long now = System.currentTimeMillis(); for (CollectRep.ValueRow valueRow : metricsData.getValuesList()) { - String instance = valueRow.getInstance(); - if (!instance.isEmpty()) { - instance = String.format("\"%s\"", instance); + Map labels = new HashMap<>(8); + for (int i = 0; i < fieldsList.size(); i++) { + CollectRep.Field field = fieldsList.get(i); + if (field.getLabel() && !CommonConstants.NULL_VALUE.equals(valueRow.getColumns(i))) { + labels.put(field.getName(), valueRow.getColumns(i)); + } } - String deviceId = getDeviceId(metricsData.getApp(), metricsData.getMetrics(), metricsData.getId(), instance, false); - if (tabletMap.containsKey(instance)) { + String label = JsonUtil.toJson(labels); + String deviceId = getDeviceId(metricsData.getApp(), metricsData.getMetrics(), metricsData.getId(), label, false); + if (tabletMap.containsKey(label)) { // 避免Time重复 now++; } else { - tabletMap.put(instance, new Tablet(deviceId, schemaList)); + tabletMap.put(label, new Tablet(deviceId, schemaList)); } - Tablet tablet = tabletMap.get(instance); + Tablet tablet = tabletMap.get(label); int rowIndex = tablet.rowSize++; tablet.addTimestamp(rowIndex, now); for (int i = 0; i < fieldsList.size(); i++) { + CollectRep.Field field = fieldsList.get(i); if (!CommonConstants.NULL_VALUE.equals(valueRow.getColumns(i))) { - if (fieldsList.get(i).getType() == CommonConstants.TYPE_NUMBER) { - tablet.addValue(fieldsList.get(i).getName(), rowIndex, Double.parseDouble(valueRow.getColumns(i))); - } else if (fieldsList.get(i).getType() == CommonConstants.TYPE_STRING) { - tablet.addValue(fieldsList.get(i).getName(), rowIndex, valueRow.getColumns(i)); + if (field.getType() == CommonConstants.TYPE_NUMBER) { + tablet.addValue(field.getName(), rowIndex, Double.parseDouble(valueRow.getColumns(i))); + } else if (field.getType() == CommonConstants.TYPE_STRING) { + tablet.addValue(field.getName(), rowIndex, valueRow.getColumns(i)); } } else { - tablet.addValue(fieldsList.get(i).getName(), rowIndex, null); + tablet.addValue(field.getName(), rowIndex, null); } } } @@ -248,7 +253,7 @@ void saveData(CollectRep.MetricsData metricsData) { @Override public Map> getHistoryMetricData(Long monitorId, String app, String metrics, String metric, - String instance, String history) { + String label, String history) { Map> instanceValuesMap = new HashMap<>(8); if (!isServerAvailable()) { log.error("\n\t---------------IotDb Init Failed---------------\n" + @@ -256,10 +261,10 @@ public Map> getHistoryMetricData(Long monitorId, String app, "\t----------Can Not Use Metric History Now----------\n"); return instanceValuesMap; } - String deviceId = getDeviceId(app, metrics, monitorId, instance, true); + String deviceId = getDeviceId(app, metrics, monitorId, label, true); String selectSql = ""; try { - if (instance != null) { + if (label != null) { selectSql = String.format(QUERY_HISTORY_SQL, addQuote(metric), deviceId, history); handleHistorySelect(selectSql, "", instanceValuesMap); } else { @@ -285,7 +290,7 @@ public Map> getHistoryMetricData(Long monitorId, String app, return instanceValuesMap; } - private void handleHistorySelect(String selectSql, String instanceId, Map> instanceValuesMap) + private void handleHistorySelect(String selectSql, String labels, Map> instanceValuesMap) throws IoTDBConnectionException, StatementExecutionException { SessionDataSetWrapper dataSet = null; try { @@ -296,7 +301,7 @@ private void handleHistorySelect(String selectSql, String instanceId, Map valueList = instanceValuesMap.computeIfAbsent(instanceId, k -> new LinkedList<>()); + List valueList = instanceValuesMap.computeIfAbsent(labels, k -> new LinkedList<>()); valueList.add(new Value(strValue, timestamp)); } } finally { @@ -309,7 +314,7 @@ private void handleHistorySelect(String selectSql, String instanceId, Map> getHistoryIntervalMetricData(Long monitorId, String app, String metrics, - String metric, String instance, String history) { + String metric, String label, String history) { Map> instanceValuesMap = new HashMap<>(8); if (!isServerAvailable()) { log.error("\n\t---------------IotDb Init Failed---------------\n" + @@ -317,9 +322,9 @@ public Map> getHistoryIntervalMetricData(Long monitorId, Str "\t----------Can Not Use Metric History Now----------\n"); return instanceValuesMap; } - String deviceId = getDeviceId(app, metrics, monitorId, instance, true); + String deviceId = getDeviceId(app, metrics, monitorId, label, true); String selectSql; - if (instance != null) { + if (label != null) { selectSql = String.format(QUERY_HISTORY_INTERVAL_WITH_INSTANCE_SQL, addQuote(metric), addQuote(metric), addQuote(metric), addQuote(metric), deviceId, history); handleHistoryIntervalSelect(selectSql, "", instanceValuesMap); @@ -332,17 +337,17 @@ public Map> getHistoryIntervalMetricData(Long monitorId, Str } else { for (String device : devices) { String prefixDeviceId = getDeviceId(app, metrics, monitorId, null, false); - String instanceId = device.substring(prefixDeviceId.length() + 1); + String instance = device.substring(prefixDeviceId.length() + 1); selectSql = String.format(QUERY_HISTORY_INTERVAL_WITH_INSTANCE_SQL, - addQuote(metric), addQuote(metric), addQuote(metric), addQuote(metric), deviceId + "." + addQuote(instanceId), history); - handleHistoryIntervalSelect(selectSql, instanceId, instanceValuesMap); + addQuote(metric), addQuote(metric), addQuote(metric), addQuote(metric), deviceId + "." + addQuote(instance), history); + handleHistoryIntervalSelect(selectSql, instance, instanceValuesMap); } } } return instanceValuesMap; } - private void handleHistoryIntervalSelect(String selectSql, String instanceId, + private void handleHistoryIntervalSelect(String selectSql, String instance, Map> instanceValuesMap) { SessionDataSetWrapper dataSet = null; try { @@ -350,6 +355,9 @@ private void handleHistoryIntervalSelect(String selectSql, String instanceId, log.debug("iot select sql: {}", selectSql); while (dataSet.hasNext()) { RowRecord rowRecord = dataSet.next(); + if (rowRecord.hasNullField()) { + continue; + } long timestamp = rowRecord.getTimestamp(); double origin = rowRecord.getFields().get(0).getDoubleV(); String originStr = BigDecimal.valueOf(origin).setScale(4, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString(); @@ -364,7 +372,7 @@ private void handleHistoryIntervalSelect(String selectSql, String instanceId, .min(minStr).max(maxStr) .time(timestamp) .build(); - List valueList = instanceValuesMap.computeIfAbsent(instanceId, k -> new LinkedList<>()); + List valueList = instanceValuesMap.computeIfAbsent(instance, k -> new LinkedList<>()); valueList.add(value); } } catch (StatementExecutionException | IoTDBConnectionException e) { @@ -407,17 +415,17 @@ private List queryAllDevices(String deviceId) { /** * 获取设备id - * 有instanceId的使用 ${group}.${app}.${metrics}.${monitor}.${instanceId} 的方式 + * 有instanceId的使用 ${group}.${app}.${metrics}.${monitor}.${labels} 的方式 * 否则使用 ${group}.${app}.${metrics}.${monitor} 的方式 * 查询时可以通过 ${group}.${app}.${metrics}.${monitor}.* 的方式获取所有instance数据 */ - private String getDeviceId(String app, String metrics, Long monitorId, String instanceId, boolean useQuote) { + private String getDeviceId(String app, String metrics, Long monitorId, String labels, boolean useQuote) { String deviceId = STORAGE_GROUP + "." + (useQuote ? addQuote(app) : app) + "." + (useQuote ? addQuote(metrics) : metrics) + "." + ((IotDbVersion.V_1_0.equals(version) || useQuote) ? addQuote(monitorId.toString()) : monitorId.toString()); - if (instanceId != null && !instanceId.isEmpty() && !instanceId.equals(CommonConstants.NULL_VALUE)) { - deviceId += "." + addQuote(instanceId); + if (labels != null && !labels.isEmpty() && !labels.equals(CommonConstants.NULL_VALUE)) { + deviceId += "." + addQuote(labels); } return deviceId; } @@ -429,14 +437,6 @@ private String addQuote(String text) { if (text == null || text.isEmpty() || (text.startsWith(BACK_QUOTE) && text.endsWith(BACK_QUOTE))) { return text; } - if ((text.startsWith(DOUBLE_QUOTATION_MARKS) && text.endsWith(DOUBLE_QUOTATION_MARKS))) { - if (IotDbVersion.V_1_0.equals(version)) { - text = text.replace("\"", "`"); - } - return text; - } - text = text.replace("'", "\\'"); - text = text.replace("\"", "\\\""); text = text.replace("*", "-"); text = String.format("`%s`", text); return text; diff --git a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryJpaDatabaseDataStorage.java b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryJpaDatabaseDataStorage.java index 5bdc2e22787..047edefe408 100644 --- a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryJpaDatabaseDataStorage.java +++ b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryJpaDatabaseDataStorage.java @@ -22,6 +22,7 @@ import org.dromara.hertzbeat.common.entity.message.CollectRep; import org.dromara.hertzbeat.common.entity.warehouse.History; import org.dromara.hertzbeat.common.constants.CommonConstants; +import org.dromara.hertzbeat.common.util.JsonUtil; import org.dromara.hertzbeat.common.util.TimePeriodUtil; import org.dromara.hertzbeat.warehouse.config.WarehouseProperties; import org.dromara.hertzbeat.warehouse.dao.HistoryDao; @@ -132,13 +133,7 @@ void saveData(CollectRep.MetricsData metricsData) { .metrics(metrics) .time(metricsData.getTime()); for (CollectRep.ValueRow valueRow : metricsData.getValuesList()) { - String instance = valueRow.getInstance(); - if (!instance.isEmpty()) { - instance = formatStrValue(instance); - historyBuilder.instance(instance); - } else { - historyBuilder.instance(null); - } + Map labels = new HashMap<>(8); for (int i = 0; i < fieldsList.size(); i++) { CollectRep.Field field = fieldsList.get(i); // ignore string value store in db @@ -154,6 +149,9 @@ void saveData(CollectRep.MetricsData metricsData) { historyBuilder.metricType(CommonConstants.TYPE_STRING) .str(formatStrValue(valueRow.getColumns(i))); } + if (field.getLabel()) { + labels.put(field.getName(), valueRow.getColumns(i)); + } } else { if (field.getType() == CommonConstants.TYPE_NUMBER) { historyBuilder.metricType(CommonConstants.TYPE_NUMBER).dou(null); @@ -163,6 +161,7 @@ void saveData(CollectRep.MetricsData metricsData) { } historyList.add(historyBuilder.build()); } + historyBuilder.instance(JsonUtil.toJson(labels)); } historyDao.saveAll(historyList); } catch (Exception e) { @@ -177,12 +176,12 @@ void saveData(CollectRep.MetricsData metricsData) { * @param app 监控类型 * @param metrics 指标集合名 * @param metric 指标名 - * @param instance 实例 + * @param label 实例 * @param history 历史范围 * @return 指标历史数据列表 */ @Override - public Map> getHistoryMetricData(Long monitorId, String app, String metrics, String metric, String instance, String history) { + public Map> getHistoryMetricData(Long monitorId, String app, String metrics, String metric, String label, String history) { Map> instanceValuesMap = new HashMap<>(8); Specification specification = (root, query, criteriaBuilder) -> { List andList = new ArrayList<>(); @@ -194,8 +193,8 @@ public Map> getHistoryMetricData(Long monitorId, String app, andList.add(predicateMonitorType); andList.add(predicateMonitorMetrics); andList.add(predicateMonitorMetric); - if (instance != null && !"".equals(instance)) { - Predicate predicateMonitorInstance = criteriaBuilder.equal(root.get("instance"), instance); + if (label != null && !"".equals(label)) { + Predicate predicateMonitorInstance = criteriaBuilder.equal(root.get("instance"), label); andList.add(predicateMonitorInstance); } if (history != null) { @@ -247,7 +246,7 @@ private String formatStrValue(String value) { } @Override - public Map> getHistoryIntervalMetricData(Long monitorId, String app, String metrics, String metric, String instance, String history) { + public Map> getHistoryIntervalMetricData(Long monitorId, String app, String metrics, String metric, String label, String history) { return new HashMap<>(8); } diff --git a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryTdEngineDataStorage.java b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryTdEngineDataStorage.java index 4dbf1c1eac8..604f69f2458 100644 --- a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryTdEngineDataStorage.java +++ b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryTdEngineDataStorage.java @@ -20,6 +20,7 @@ import org.dromara.hertzbeat.common.entity.dto.Value; import org.dromara.hertzbeat.common.entity.message.CollectRep; import org.dromara.hertzbeat.common.constants.CommonConstants; +import org.dromara.hertzbeat.common.util.JsonUtil; import org.dromara.hertzbeat.warehouse.config.WarehouseProperties; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; @@ -128,8 +129,8 @@ public void saveData(CollectRep.MetricsData metricsData) { for (CollectRep.ValueRow valueRow : metricsData.getValuesList()) { StringBuilder sqlRowBuffer = new StringBuilder("("); sqlRowBuffer.append(metricsData.getTime() + i++).append(", "); - String instance = formatStringValue(valueRow.getInstance()); - sqlRowBuffer.append("'").append(instance).append("', "); + Map labels = new HashMap<>(8); + sqlRowBuffer.append("'").append("%s").append("', "); for (int index = 0; index < fields.size(); index++) { CollectRep.Field field = fields.get(index); String value = valueRow.getColumns(index); @@ -154,12 +155,15 @@ public void saveData(CollectRep.MetricsData metricsData) { sqlRowBuffer.append("'").append(formatStringValue(value)).append("'"); } } + if (field.getLabel() && !CommonConstants.NULL_VALUE.equals(value)) { + labels.put(field.getName(), formatStringValue(value)); + } if (index != fields.size() - 1) { sqlRowBuffer.append(", "); } } sqlRowBuffer.append(")"); - sqlBuffer.append(" ").append(sqlRowBuffer); + sqlBuffer.append(" ").append(String.format(sqlRowBuffer.toString(), formatStringValue(JsonUtil.toJson(labels)))); } String insertDataSql = String.format(INSERT_TABLE_DATA_SQL, table, superTable, monitorId, sqlBuffer); log.debug(insertDataSql); @@ -235,15 +239,15 @@ public void destroy() { * @param app 监控类型 * @param metrics 指标集合名 * @param metric 指标名 - * @param instance 实例 + * @param label 实例 * @param history 历史范围 * @return 指标历史数据列表 */ @Override - public Map> getHistoryMetricData(Long monitorId, String app, String metrics, String metric, String instance, String history) { + public Map> getHistoryMetricData(Long monitorId, String app, String metrics, String metric, String label, String history) { String table = app + "_" + metrics + "_" + monitorId; - String selectSql = instance == null ? String.format(QUERY_HISTORY_SQL, metric, table, history) : - String.format(QUERY_HISTORY_WITH_INSTANCE_SQL, metric, table, instance, history); + String selectSql = label == null ? String.format(QUERY_HISTORY_SQL, metric, table, history) : + String.format(QUERY_HISTORY_WITH_INSTANCE_SQL, metric, table, label, history); log.debug(selectSql); Connection connection = null; Map> instanceValuesMap = new HashMap<>(8); @@ -294,7 +298,7 @@ public Map> getHistoryMetricData(Long monitorId, String app, @Override public Map> getHistoryIntervalMetricData(Long monitorId, String app, String metrics, - String metric, String instance, String history) { + String metric, String label, String history) { if (!serverAvailable) { log.error("\n\t---------------TdEngine Init Failed---------------\n" + "\t--------------Please Config Tdengine--------------\n" + @@ -303,8 +307,8 @@ public Map> getHistoryIntervalMetricData(Long monitorId, Str } String table = app + "_" + metrics + "_" + monitorId; List instances = new LinkedList<>(); - if (instance != null) { - instances.add(instance); + if (label != null) { + instances.add(label); } if (instances.isEmpty()) { // 若未指定instance,需查询当前指标数据前1周有多少个instance diff --git a/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryVictoriaMetricsDataStorage.java b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryVictoriaMetricsDataStorage.java new file mode 100644 index 00000000000..a2d0e1b78bd --- /dev/null +++ b/warehouse/src/main/java/org/dromara/hertzbeat/warehouse/store/HistoryVictoriaMetricsDataStorage.java @@ -0,0 +1,515 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.dromara.hertzbeat.warehouse.store; + +import com.fasterxml.jackson.databind.JsonNode; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang3.math.NumberUtils; +import org.dromara.hertzbeat.common.constants.CommonConstants; +import org.dromara.hertzbeat.common.entity.dto.Value; +import org.dromara.hertzbeat.common.entity.message.CollectRep; +import org.dromara.hertzbeat.common.util.CommonUtil; +import org.dromara.hertzbeat.common.util.JsonUtil; +import org.dromara.hertzbeat.common.util.TimePeriodUtil; +import org.dromara.hertzbeat.warehouse.config.WarehouseProperties; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Primary; +import org.springframework.http.*; +import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; +import org.springframework.web.client.RestTemplate; +import org.springframework.web.util.UriComponentsBuilder; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.net.URI; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.time.ZonedDateTime; +import java.time.temporal.TemporalAmount; +import java.util.*; +import java.util.stream.Collectors; + +/** + * tdengine data storage + * @author tom + * + */ +@Primary +@Component +@ConditionalOnProperty(prefix = "warehouse.store.victoria-metrics", + name = "enabled", havingValue = "true") +@Slf4j +public class HistoryVictoriaMetricsDataStorage extends AbstractHistoryDataStorage { + + private static final String IMPORT_PATH = "/api/v1/import"; + /** + * + * https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#how-to-export-data-in-json-line-format + * + */ + private static final String EXPORT_PATH = "/api/v1/export"; + private static final String QUERY_RANGE_PATH = "/api/v1/query_range"; + private static final String STATUS_PATH = "/api/v1/status/tsdb"; + private static final String STATUS = "status"; + private static final String STATUS_SUCCESS = "success"; + private static final String NAME_KEY = "__name__"; + private static final String SPILT = "_"; + private static final String BASIC = "Basic"; + private static final String MONITOR_TYPE_KEY = "__app__"; + private static final String MONITOR_METRICS_KEY = "__metrics__"; + private static final String MONITOR_METRIC_KEY = "__metric__"; + private static final String MONITOR_ID_KEY = "__monitorId__"; + + private final WarehouseProperties.StoreProperties.VictoriaMetricsProperties victoriaMetricsProp; + + private final RestTemplate restTemplate; + + public HistoryVictoriaMetricsDataStorage(WarehouseProperties properties, RestTemplate restTemplate) { + if (properties == null || properties.getStore() == null || properties.getStore().getVictoriaMetrics() == null) { + log.error("init error, please config Warehouse victoriaMetrics props in application.yml"); + throw new IllegalArgumentException("please config Warehouse victoriaMetrics props"); + } + this.restTemplate = restTemplate; + victoriaMetricsProp = properties.getStore().getVictoriaMetrics(); + serverAvailable = initVictoriaMetricsDatasource(); + } + + private boolean initVictoriaMetricsDatasource() { + // check server status + try { + String result = restTemplate.getForObject(victoriaMetricsProp.getUrl() + STATUS_PATH, String.class); + + JsonNode jsonNode = JsonUtil.fromJson(result); + if (jsonNode != null && STATUS_SUCCESS.equalsIgnoreCase(jsonNode.get(STATUS).asText())) { + return true; + } + log.error("check victoria metrics server status not success: {}.", result); + } catch (Exception e) { + log.error("check victoria metrics server status error: {}.", e.getMessage(), e); + } + log.warn("\n\t------------------WARN WARN WARN------------------\n" + + "\t---------------Init VictoriaMetrics Failed---------------\n" + + "\t--------------Please Config VictoriaMetrics--------------\n" + + "\t---------Or Can Not Use Metric History Now---------\n"); + return false; + } + + @Override + public void saveData(CollectRep.MetricsData metricsData) { + if (!isServerAvailable() || metricsData.getCode() != CollectRep.Code.SUCCESS) { + return; + } + if (metricsData.getValuesList().isEmpty()) { + log.info("[warehouse victoria-metrics] flush metrics data {} is null, ignore.", metricsData.getId()); + return; + } + Map defaultLabels = new HashMap<>(8); + defaultLabels.put(MONITOR_ID_KEY, String.valueOf(metricsData.getId())); + defaultLabels.put(MONITOR_TYPE_KEY, metricsData.getApp()); + defaultLabels.put(MONITOR_METRICS_KEY, metricsData.getMetrics()); + + List fields = metricsData.getFieldsList(); + Long[] timestamp = new Long[]{metricsData.getTime()}; + Map fieldsValue = new HashMap<>(fields.size()); + Map labels = new HashMap<>(fields.size()); + for (CollectRep.ValueRow valueRow : metricsData.getValuesList()) { + fieldsValue.clear(); + labels.clear(); + for (int index = 0; index < fields.size(); index++) { + CollectRep.Field field = fields.get(index); + String value = valueRow.getColumns(index); + if (field.getType() == CommonConstants.TYPE_NUMBER && !field.getLabel()) { + // number metrics data + if (!CommonConstants.NULL_VALUE.equals(value)) { + fieldsValue.put(field.getName(), CommonUtil.parseStrDouble(value)); + } + } + // label + if (field.getLabel() && !CommonConstants.NULL_VALUE.equals(value)) { + labels.put(field.getName(), value); + } + } + for (Map.Entry entry : fieldsValue.entrySet()) { + if (entry.getKey() != null && entry.getValue() != null) { + try { + labels.putAll(defaultLabels); + labels.put(NAME_KEY, metricsData.getApp() + SPILT + metricsData.getMetrics() + SPILT + entry.getKey()); + labels.put(MONITOR_METRIC_KEY, entry.getKey()); + VictoriaMetricsContent content = VictoriaMetricsContent.builder() + .metric(labels) + .values(new Double[]{entry.getValue()}) + .timestamps(timestamp) + .build(); + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + if (StringUtils.hasText(victoriaMetricsProp.getUsername()) + && StringUtils.hasText(victoriaMetricsProp.getPassword())) { + String authStr = victoriaMetricsProp.getUsername() + ":" + victoriaMetricsProp.getPassword(); + String encodedAuth = new String(Base64.encodeBase64(authStr.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8); + headers.add(HttpHeaders.AUTHORIZATION, BASIC + " " + encodedAuth); + } + HttpEntity httpEntity = new HttpEntity<>(content, headers); + ResponseEntity responseEntity = restTemplate.postForEntity(victoriaMetricsProp.getUrl() + IMPORT_PATH, + httpEntity, String.class); + if (responseEntity.getStatusCode().is2xxSuccessful()) { + log.debug("insert metrics data to victoria-metrics success. {}", content); + } else { + log.error("insert metrics data to victoria-metrics failed. {}", content); + } + } catch (Exception e) { + log.error("flush metrics data to victoria-metrics error: {}.", e.getMessage(), e); + } + + } + } + } + } + + @Override + public void destroy() {} + + /** + * 从TD ENGINE时序数据库获取指标历史数据 + * + * @param monitorId 监控任务ID + * @param app 监控类型 + * @param metrics 指标集合名 + * @param metric 指标名 + * @param label 实例 + * @param history 历史范围 + * @return 指标历史数据列表 + */ + @Override + public Map> getHistoryMetricData(Long monitorId, String app, String metrics, String metric, String label, String history) { + String timeSeriesSelector = NAME_KEY + "=\"" + app + SPILT + metrics + SPILT + metric + "\"" + + "," + MONITOR_ID_KEY + "=\"" + monitorId + "\""; + Map> instanceValuesMap = new HashMap<>(8); + try { + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + headers.setAccept(List.of(MediaType.APPLICATION_JSON)); + if (StringUtils.hasText(victoriaMetricsProp.getUsername()) + && StringUtils.hasText(victoriaMetricsProp.getPassword())) { + String authStr = victoriaMetricsProp.getUsername() + ":" + victoriaMetricsProp.getPassword(); + String encodedAuth = new String(Base64.encodeBase64(authStr.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8); + headers.add(HttpHeaders.AUTHORIZATION, BASIC + " " + encodedAuth); + } + HttpEntity httpEntity = new HttpEntity<>(headers); + URI uri = UriComponentsBuilder.fromHttpUrl(victoriaMetricsProp.getUrl() + EXPORT_PATH) + .queryParam(URLEncoder.encode("match[]", StandardCharsets.UTF_8), URLEncoder.encode("{" + timeSeriesSelector + "}", StandardCharsets.UTF_8)) + .build(true).toUri(); + ResponseEntity responseEntity = restTemplate.exchange(uri, + HttpMethod.GET, httpEntity, String.class); + if (responseEntity.getStatusCode().is2xxSuccessful()) { + log.debug("query metrics data from victoria-metrics success. {}", uri); + if (StringUtils.hasText(responseEntity.getBody())) { + String[] contentJsonArr = responseEntity.getBody().split("\n"); + List contents = Arrays.stream(contentJsonArr).map( + item -> JsonUtil.fromJson(item, VictoriaMetricsContent.class) + ).collect(Collectors.toList()); + for (VictoriaMetricsContent content : contents) { + Map labels = content.getMetric(); + labels.remove(NAME_KEY); + labels.remove(MONITOR_ID_KEY); + labels.remove(MONITOR_TYPE_KEY); + labels.remove(MONITOR_METRICS_KEY); + labels.remove(MONITOR_METRIC_KEY); + String labelStr = JsonUtil.toJson(labels); + if (content.getValues() != null && content.getTimestamps() != null) { + List valueList = instanceValuesMap.computeIfAbsent(labelStr, k -> new LinkedList<>()); + if (content.getValues().length != content.getTimestamps().length) { + log.error("content.getValues().length != content.getTimestamps().length"); + continue; + } + Double[] values = content.getValues(); + Long[] timestamps = content.getTimestamps(); + for (int index = 0; index < content.getValues().length; index++) { + String strValue = BigDecimal.valueOf(values[index]).setScale(4, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString(); + // read timestamp here is ms unit + valueList.add(new Value(strValue, timestamps[index])); + } + } + } + } + } else { + log.error("query metrics data from victoria-metrics failed. {}", responseEntity); + } + } catch (Exception e) { + log.error("query metrics data from victoria-metrics error. {}.", e.getMessage(), e); + } + return instanceValuesMap; + } + + @Override + public Map> getHistoryIntervalMetricData(Long monitorId, String app, String metrics, + String metric, String label, String history) { + if (!serverAvailable) { + log.error("\n\t---------------VictoriaMetrics Init Failed---------------\n" + + "\t--------------Please Config VictoriaMetrics--------------\n" + + "\t----------Can Not Use Metric History Now----------\n"); + return Collections.emptyMap(); + } + long endTime = ZonedDateTime.now().toEpochSecond(); + long startTime; + try { + if (NumberUtils.isParsable(history)) { + startTime = NumberUtils.toLong(history); + startTime = (ZonedDateTime.now().toEpochSecond() - startTime); + } else { + TemporalAmount temporalAmount = TimePeriodUtil.parseTokenTime(history); + ZonedDateTime dateTime = ZonedDateTime.now().minus(temporalAmount); + startTime = dateTime.toEpochSecond(); + } + } catch (Exception e) { + log.error("history time error: {}. use default: 6h", e.getMessage()); + ZonedDateTime dateTime = ZonedDateTime.now().minus(Duration.ofHours(6)); + startTime = dateTime.toEpochSecond(); + } + String timeSeriesSelector = NAME_KEY + "=\"" + app + SPILT + metrics + SPILT + metric + "\"" + + "," + MONITOR_ID_KEY + "=\"" + monitorId + "\""; + Map> instanceValuesMap = new HashMap<>(8); + try { + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + headers.setAccept(List.of(MediaType.APPLICATION_JSON)); + if (StringUtils.hasText(victoriaMetricsProp.getUsername()) + && StringUtils.hasText(victoriaMetricsProp.getPassword())) { + String authStr = victoriaMetricsProp.getUsername() + ":" + victoriaMetricsProp.getPassword(); + String encodedAuth = new String(Base64.encodeBase64(authStr.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8); + headers.add(HttpHeaders.AUTHORIZATION, BASIC + " " + encodedAuth); + } + HttpEntity httpEntity = new HttpEntity<>(headers); + URI uri = UriComponentsBuilder.fromHttpUrl(victoriaMetricsProp.getUrl() + QUERY_RANGE_PATH) + .queryParam(URLEncoder.encode("query", StandardCharsets.UTF_8), URLEncoder.encode("{" + timeSeriesSelector + "}", StandardCharsets.UTF_8)) + .queryParam("step", "4h") + .queryParam("start", startTime) + .queryParam("end", endTime) + .build(true).toUri(); + ResponseEntity responseEntity = restTemplate.exchange(uri, + HttpMethod.GET, httpEntity, VictoriaMetricsQueryContent.class); + if (responseEntity.getStatusCode().is2xxSuccessful()) { + log.debug("query metrics data from victoria-metrics success. {}", uri); + if (responseEntity.getBody() != null && responseEntity.getBody().getData() != null + && responseEntity.getBody().getData().getResult() != null) { + List contents = responseEntity.getBody().getData().getResult(); + for (VictoriaMetricsQueryContent.ContentData.Content content : contents) { + Map labels = content.getMetric(); + labels.remove(NAME_KEY); + labels.remove(MONITOR_ID_KEY); + labels.remove(MONITOR_TYPE_KEY); + labels.remove(MONITOR_METRICS_KEY); + labels.remove(MONITOR_METRIC_KEY); + String labelStr = JsonUtil.toJson(labels); + if (content.getValues() != null && !content.getValues().isEmpty()) { + List valueList = instanceValuesMap.computeIfAbsent(labelStr, k -> new LinkedList<>()); + for (Object[] valueArr : content.getValues()) { + long timestamp = Long.parseLong(String.valueOf(valueArr[0])); + String value = String.valueOf(valueArr[1]); + // read timestamp here is s unit + valueList.add(new Value(value, timestamp * 1000)); + } + } + } + } + } else { + log.error("query metrics data from victoria-metrics failed. {}", responseEntity); + } + // max + uri = UriComponentsBuilder.fromHttpUrl(victoriaMetricsProp.getUrl() + QUERY_RANGE_PATH) + .queryParam(URLEncoder.encode("query", StandardCharsets.UTF_8), URLEncoder.encode("max_over_time({" + timeSeriesSelector + "})", StandardCharsets.UTF_8)) + .queryParam("step", "4h") + .queryParam("start", startTime) + .queryParam("end", endTime) + .build(true).toUri(); + responseEntity = restTemplate.exchange(uri, + HttpMethod.GET, httpEntity, VictoriaMetricsQueryContent.class); + if (responseEntity.getStatusCode().is2xxSuccessful()) { + if (responseEntity.getBody() != null && responseEntity.getBody().getData() != null + && responseEntity.getBody().getData().getResult() != null) { + List contents = responseEntity.getBody().getData().getResult(); + for (VictoriaMetricsQueryContent.ContentData.Content content : contents) { + Map labels = content.getMetric(); + labels.remove(NAME_KEY); + labels.remove(MONITOR_ID_KEY); + labels.remove(MONITOR_TYPE_KEY); + labels.remove(MONITOR_METRICS_KEY); + labels.remove(MONITOR_METRIC_KEY); + String labelStr = JsonUtil.toJson(labels); + if (content.getValues() != null && !content.getValues().isEmpty()) { + List valueList = instanceValuesMap.computeIfAbsent(labelStr, k -> new LinkedList<>()); + if (valueList.size() == content.getValues().size()) { + for (int timestampIndex = 0; timestampIndex < valueList.size(); timestampIndex++) { + Value value = valueList.get(timestampIndex); + Object[] valueArr = content.getValues().get(timestampIndex); + value.setMax(String.valueOf(valueArr[1])); + } + } + } + } + } + } + // min + uri = UriComponentsBuilder.fromHttpUrl(victoriaMetricsProp.getUrl() + QUERY_RANGE_PATH) + .queryParam(URLEncoder.encode("query", StandardCharsets.UTF_8), URLEncoder.encode("min_over_time({" + timeSeriesSelector + "})", StandardCharsets.UTF_8)) + .queryParam("step", "4h") + .queryParam("start", startTime) + .queryParam("end", endTime) + .build(true).toUri(); + responseEntity = restTemplate.exchange(uri, + HttpMethod.GET, httpEntity, VictoriaMetricsQueryContent.class); + if (responseEntity.getStatusCode().is2xxSuccessful()) { + if (responseEntity.getBody() != null && responseEntity.getBody().getData() != null + && responseEntity.getBody().getData().getResult() != null) { + List contents = responseEntity.getBody().getData().getResult(); + for (VictoriaMetricsQueryContent.ContentData.Content content : contents) { + Map labels = content.getMetric(); + labels.remove(NAME_KEY); + labels.remove(MONITOR_ID_KEY); + labels.remove(MONITOR_TYPE_KEY); + labels.remove(MONITOR_METRICS_KEY); + labels.remove(MONITOR_METRIC_KEY); + String labelStr = JsonUtil.toJson(labels); + if (content.getValues() != null && !content.getValues().isEmpty()) { + List valueList = instanceValuesMap.computeIfAbsent(labelStr, k -> new LinkedList<>()); + if (valueList.size() == content.getValues().size()) { + for (int timestampIndex = 0; timestampIndex < valueList.size(); timestampIndex++) { + Value value = valueList.get(timestampIndex); + Object[] valueArr = content.getValues().get(timestampIndex); + value.setMin(String.valueOf(valueArr[1])); + } + } + } + } + } + } + // avg + uri = UriComponentsBuilder.fromHttpUrl(victoriaMetricsProp.getUrl() + QUERY_RANGE_PATH) + .queryParam(URLEncoder.encode("query", StandardCharsets.UTF_8), URLEncoder.encode("avg_over_time({" + timeSeriesSelector + "})", StandardCharsets.UTF_8)) + .queryParam("step", "4h") + .queryParam("start", startTime) + .queryParam("end", endTime) + .build(true).toUri(); + responseEntity = restTemplate.exchange(uri, + HttpMethod.GET, httpEntity, VictoriaMetricsQueryContent.class); + if (responseEntity.getStatusCode().is2xxSuccessful()) { + if (responseEntity.getBody() != null && responseEntity.getBody().getData() != null + && responseEntity.getBody().getData().getResult() != null) { + List contents = responseEntity.getBody().getData().getResult(); + for (VictoriaMetricsQueryContent.ContentData.Content content : contents) { + Map labels = content.getMetric(); + labels.remove(NAME_KEY); + labels.remove(MONITOR_ID_KEY); + labels.remove(MONITOR_TYPE_KEY); + labels.remove(MONITOR_METRICS_KEY); + labels.remove(MONITOR_METRIC_KEY); + String labelStr = JsonUtil.toJson(labels); + if (content.getValues() != null && !content.getValues().isEmpty()) { + List valueList = instanceValuesMap.computeIfAbsent(labelStr, k -> new LinkedList<>()); + if (valueList.size() == content.getValues().size()) { + for (int timestampIndex = 0; timestampIndex < valueList.size(); timestampIndex++) { + Value value = valueList.get(timestampIndex); + Object[] valueArr = content.getValues().get(timestampIndex); + value.setMean(String.valueOf(valueArr[1])); + } + } + } + } + } + } + } catch (Exception e) { + log.error("query metrics data from victoria-metrics error. {}.", e.getMessage(), e); + } + return instanceValuesMap; + } + + @Data + @Builder + @AllArgsConstructor + @NoArgsConstructor + public static final class VictoriaMetricsContent { + + /** + * metric contains metric name plus labels for a particular time series + */ + private Map metric; + + /** + * values contains raw sample values for the given time series + */ + private Double[] values; + + /** + * timestamps contains raw sample UNIX timestamps in milliseconds for the given time series + * every timestamp is associated with the value at the corresponding position + */ + private Long[] timestamps; + } + + @Data + @Builder + @AllArgsConstructor + @NoArgsConstructor + public static final class VictoriaMetricsQueryContent { + + private String status; + + private ContentData data; + + @Data + @AllArgsConstructor + @NoArgsConstructor + public static final class ContentData { + + private String resultType; + + private List result; + + @Data + @AllArgsConstructor + @NoArgsConstructor + public static final class Content { + + /** + * metric contains metric name plus labels for a particular time series + */ + private Map metric; + + /** + * values contains raw sample values for the given time series + * value-timestamp + * [1700993195,"436960986"] + */ + private Object[] value; + + /** + * values contains raw sample values for the given time series + * value-timestamp list + * [[1700993195,"436960986"],[1700993195,"436960986"]...] + */ + private List values; + } + } + } +} diff --git a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html index d258248ef68..436d5786e45 100644 --- a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html +++ b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html @@ -188,9 +188,6 @@ {{ item.type === 0 ? ('alert.setting.number' | i18n) : ('alert.setting.string' | i18n) }} - - instance : {{ 'alert.setting.target.instance' | i18n }} - {{ 'alert.setting.operator' | i18n }} : equals(str1,str2), contains(str1,str2), exists(keyName), matches(str,regex), ==, @@ -400,9 +397,6 @@ }} - - ${instance} : {{ 'alert.setting.template.instance-value' | i18n }} - diff --git a/web-app/src/assets/i18n/en-US.json b/web-app/src/assets/i18n/en-US.json index bbcad9c37a3..e6c4bad5d83 100644 --- a/web-app/src/assets/i18n/en-US.json +++ b/web-app/src/assets/i18n/en-US.json @@ -156,7 +156,6 @@ "alert.setting.template.metric-name": "Metric Name", "alert.setting.template.metric-value": "Metric Value", "alert.setting.template.other-value": "Other Metric Value", - "alert.setting.template.instance-value": "Instance Value", "alert.setting.default": "Global Default", "alert.setting.default.tip": "Whether this alarm threshold configuration applies to all this type of monitoring globally", "alert.setting.enable": "Enable Threshold", @@ -172,7 +171,6 @@ "alert.setting.priority.tip": "The alarm level that triggers the threshold, from low to high:Warning,Critical,Emergency", "alert.setting.target.tip": "The selected metric object", "alert.setting.target.other": "Other metric objects of the row", - "alert.setting.target.instance": "Instance of the row", "alert.setting.target.system_value_row_count": "System-Metrics value row count", "alert.setting.operator": "Supported operator functions", "alert.setting.search": "Search Threshold", diff --git a/web-app/src/assets/i18n/zh-CN.json b/web-app/src/assets/i18n/zh-CN.json index 0204a0bff52..d9d8b752e12 100644 --- a/web-app/src/assets/i18n/zh-CN.json +++ b/web-app/src/assets/i18n/zh-CN.json @@ -156,7 +156,6 @@ "alert.setting.template.metric-name": "监控指标名称", "alert.setting.template.metric-value": "指标值", "alert.setting.template.other-value": "所属行其它指标值", - "alert.setting.template.instance-value": "所属行实例值", "alert.setting.default": "应用全局", "alert.setting.default.tip": "此告警阈值配置是否应用于全局所有此类型监控", "alert.setting.enable": "启用阈值", @@ -172,7 +171,6 @@ "alert.setting.priority.tip": "触发阈值的告警级别,从低到高依次为:警告-warning,严重-critical,紧急-emergency", "alert.setting.target.tip": "选中的指标对象", "alert.setting.target.other": "所属行其它指标对象", - "alert.setting.target.instance": "所属行实例", "alert.setting.target.system_value_row_count": "系统-指标值行数量", "alert.setting.operator": "支持操作符函数", "alert.setting.search": "搜索阈值", diff --git a/web-app/src/assets/i18n/zh-TW.json b/web-app/src/assets/i18n/zh-TW.json index 39d076a930e..6433585c981 100644 --- a/web-app/src/assets/i18n/zh-TW.json +++ b/web-app/src/assets/i18n/zh-TW.json @@ -155,7 +155,6 @@ "alert.setting.template.metric-name": "監控指標名稱", "alert.setting.template.metric-value": "指標值", "alert.setting.template.other-value": "所屬行其它指標值", - "alert.setting.template.instance-value": "所屬行實例值", "alert.setting.default": "應用全域", "alert.setting.default.tip": "此告警阈值配置是否應用于全局所有此類型監控", "alert.setting.enable": "啓用閾值", @@ -171,7 +170,6 @@ "alert.setting.priority.tip": "觸發阈值的告警級別,從低到高依次爲:警告-warning,嚴重-critical,緊急-emergency", "alert.setting.target.tip": "選中的指標對象", "alert.setting.target.other": "所屬行其它指標對象", - "alert.setting.target.instance": "所屬行實例", "alert.setting.target.system_value_row_count": "系統-指標值行數量", "alert.setting.operator": "支持操作符函數", "alert.setting.search": "搜尋閾值",