mirror of
https://github.com/dromara/hertzbeat.git
synced 2026-09-17 18:19:02 +00:00
Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b65d57b492 | ||
|
|
33d9764631 | ||
|
|
5d1b1eade7 | ||
|
|
26f9e66143 | ||
|
|
dca55b6d99 | ||
|
|
48b1e52585 | ||
|
|
2a20150d7c |
@@ -53,5 +53,4 @@ body:
|
||||
validations:
|
||||
required: false
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: "Please read the [Contribution Guideline](https://hertzbeat.apache.org/docs/community/contribution) before submitting the PR"
|
||||
value: "Please read the [Contribution Guideline](https://hertzbeat.apache.org/docs/community/contribution) before submitting the PR"
|
||||
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
- uses: ./script/ci/github-actions/setup-deps
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvnd clean -B package -Prelease -Dmaven.test.skip=false --file pom.xml
|
||||
run: mvn clean -B package -Prelease -Dmaven.test.skip=false --file pom.xml
|
||||
|
||||
- name: Upload coverage reports to Codecov
|
||||
uses: codecov/codecov-action@v4.0.1
|
||||
|
||||
-3
@@ -139,9 +139,6 @@ public class RealTimeAlertCalculator {
|
||||
String instanceHost = metricsData.getInstanceHost();
|
||||
String app = metricsData.getApp();
|
||||
String metrics = metricsData.getMetrics();
|
||||
if ((CommonConstants.PROMETHEUS_APP_PREFIX + instanceName).equals(metricsData.getApp())) {
|
||||
app = CommonConstants.PROMETHEUS;
|
||||
}
|
||||
int priority = metricsData.getPriority();
|
||||
int code = metricsData.getCode().getNumber();
|
||||
Map<String, String> labels = metricsData.getLabels();
|
||||
|
||||
-184
@@ -1,184 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.alert.dto;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* Alibaba Cloud 'Simple Log Service(SLS)' alert content entity.
|
||||
*
|
||||
* @see <a href="https://help.aliyun.com/zh/sls/user-guide/variables-in-new-alert-templates"/>
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AlibabaCloudSlsExternAlert {
|
||||
|
||||
/**
|
||||
* The id of the instance on which the alarm was triggered
|
||||
*/
|
||||
@JsonProperty("alert_instance_id")
|
||||
private String alertInstanceId;
|
||||
|
||||
/**
|
||||
* Alarm rule id, unique within project
|
||||
*/
|
||||
@JsonProperty("alert_id")
|
||||
private String alertId;
|
||||
|
||||
/**
|
||||
* Alarm rule name
|
||||
*/
|
||||
@JsonProperty("alert_name")
|
||||
private String alertName;
|
||||
|
||||
/**
|
||||
* Region
|
||||
*/
|
||||
private String region;
|
||||
|
||||
/**
|
||||
* Alarm rule belongs to Project
|
||||
*/
|
||||
private String project;
|
||||
|
||||
/**
|
||||
* Time of this evaluation
|
||||
*/
|
||||
@JsonProperty("alert_time")
|
||||
private int alertTime;
|
||||
|
||||
/**
|
||||
* First trigger time
|
||||
*/
|
||||
@JsonProperty("fire_time")
|
||||
private int fireTime;
|
||||
|
||||
/**
|
||||
* Alarm recovery time
|
||||
* If the alarm status is firing, the value is 0.
|
||||
* If the alarm state is resolved, the value is the specific recovery time.
|
||||
*/
|
||||
@JsonProperty("resolve_time")
|
||||
private int resolveTime;
|
||||
|
||||
/**
|
||||
* Alarm status.
|
||||
* firing: Triggers an alarm.
|
||||
* resolved: Notification of resumption.
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* The total number of entries in the data that triggered the alert,
|
||||
* which may be more than 100, for example after a Cartesian product operation.
|
||||
*/
|
||||
@JsonProperty("fire_results_count")
|
||||
private int fireResultsCount;
|
||||
|
||||
/**
|
||||
* Tag list
|
||||
* Example: {"env":"test"}
|
||||
*/
|
||||
private Map<String, String> labels;
|
||||
|
||||
/**
|
||||
* Labeled lists
|
||||
* Example: { "title": "Alarm title","desc": "Alarm desc" }
|
||||
*/
|
||||
private Map<String, String> annotations;
|
||||
|
||||
/**
|
||||
* Alarm severity.
|
||||
*
|
||||
* 10: Critical
|
||||
* 8: High
|
||||
* 6: Medium
|
||||
* 4: Low
|
||||
* 2: Report only
|
||||
*/
|
||||
private int severity;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@JsonProperty("signin_url")
|
||||
private String signinUrl;
|
||||
|
||||
|
||||
public String getAnnotation(String key) {
|
||||
if (null == this.annotations || this.annotations.isEmpty()) {
|
||||
return "N/A";
|
||||
}
|
||||
return this.annotations.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Severity
|
||||
*/
|
||||
public enum Severity {
|
||||
|
||||
CRITICAL(10, "Critical"),
|
||||
|
||||
HIGH(8, "High"),
|
||||
|
||||
MEDIUM(6, "Medium"),
|
||||
|
||||
LOW(4, "Low"),
|
||||
|
||||
REPORT_ONLY(2, "Report only");
|
||||
|
||||
private static final Map<Integer, Severity> STATUS_MAP;
|
||||
|
||||
static {
|
||||
STATUS_MAP = Arrays.stream(Severity.values()).collect(Collectors.toMap(Severity::getStatus, t -> t, (oldVal, newVal) -> newVal));
|
||||
}
|
||||
|
||||
private final int status;
|
||||
private final String alias;
|
||||
|
||||
Severity(int status, String alias) {
|
||||
this.status = status;
|
||||
this.alias = alias;
|
||||
}
|
||||
|
||||
public static Optional<Severity> convert(int severity) {
|
||||
return Optional.ofNullable(STATUS_MAP.get(severity));
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public String getAlias() {
|
||||
return alias;
|
||||
}
|
||||
}
|
||||
}
|
||||
-237
@@ -1,237 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.alert.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Huawei Cloud (CES) alert content entity.
|
||||
*
|
||||
* @see <a href="https://support.huaweicloud.com/usermanual-ces/ces_01_0218.html"/>
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class HuaweiCloudExternAlert {
|
||||
|
||||
public static final String FIELD_MESSAGE = "message";
|
||||
public static final String FIELD_MESSAGE_ID = "message_id";
|
||||
public static final String FIELD_TIMESTAMP = "timestamp";
|
||||
public static final String FIELD_TOPIC_URN = "topic_urn";
|
||||
public static final String FIELD_TYPE = "type";
|
||||
public static final String FIELD_SUBJECT = "subject";
|
||||
public static final String FIELD_SUBSCRIBE_URL = "subscribe_url";
|
||||
|
||||
/**
|
||||
* Signature information.
|
||||
*/
|
||||
private String signature;
|
||||
|
||||
/**
|
||||
* Subject
|
||||
*/
|
||||
private String subject;
|
||||
|
||||
/**
|
||||
* The unique identifier of a topic, indicating the topic to which the message belongs.
|
||||
*/
|
||||
@JsonProperty("topic_urn")
|
||||
private String topicUrn;
|
||||
|
||||
/**
|
||||
* Message unique identifier.
|
||||
*/
|
||||
@JsonProperty("message_id")
|
||||
private String messageId;
|
||||
|
||||
/**
|
||||
* Message
|
||||
*/
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* message types, the message types are respectively:
|
||||
* SubscriptionConfirmation、Notification、UnsubscribeConfirmation
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* Subscription confirms the URL that needs to be accessed
|
||||
*/
|
||||
@JsonProperty("subscribe_url")
|
||||
private String subscribeUrl;
|
||||
|
||||
/**
|
||||
* The certificate URL used for message signing, which does not require authentication and can be accessed directly.
|
||||
*/
|
||||
@JsonProperty("signing_cert_url")
|
||||
private String signingCertUrl;
|
||||
|
||||
/**
|
||||
* The timestamp of when the message was first sent.
|
||||
*/
|
||||
private String timestamp;
|
||||
|
||||
/**
|
||||
* Alert message
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class AlertMessage {
|
||||
|
||||
private String version;
|
||||
|
||||
private AlertData data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alert data
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class AlertData {
|
||||
|
||||
/**
|
||||
* Whether an alarm occurs.
|
||||
* Note: Empty and false are both recovery notifications.
|
||||
* Note: There are no recovery notifications for event types
|
||||
*/
|
||||
@JsonProperty("IsAlarm")
|
||||
private Boolean alarm;
|
||||
|
||||
/**
|
||||
* Alarm time
|
||||
*/
|
||||
@JsonProperty("AlarmTime")
|
||||
private String alarmTime;
|
||||
|
||||
/**
|
||||
* Resource ID
|
||||
*/
|
||||
@JsonProperty("ResourceId")
|
||||
private String resourceId;
|
||||
|
||||
/**
|
||||
* The name of the metric
|
||||
*/
|
||||
@JsonProperty("MetricName")
|
||||
private String metricName;
|
||||
|
||||
/**
|
||||
* Specifies the alarm severity, which can be Critical, Major, Minor, or Informational.
|
||||
*/
|
||||
@JsonProperty("AlarmLevel")
|
||||
private String alarmLevel;
|
||||
|
||||
/**
|
||||
* Namespace
|
||||
*/
|
||||
@JsonProperty("Namespace")
|
||||
private String namespace;
|
||||
|
||||
/**
|
||||
* Region
|
||||
*/
|
||||
@JsonProperty("Region")
|
||||
private String region;
|
||||
|
||||
/**
|
||||
* Dimension name
|
||||
*/
|
||||
@JsonProperty("DimensionName")
|
||||
private String dimensionName;
|
||||
|
||||
/**
|
||||
* Resource name
|
||||
*/
|
||||
@JsonProperty("ResourceName")
|
||||
private String resourceName;
|
||||
|
||||
/**
|
||||
* Alarm record ID
|
||||
*/
|
||||
@JsonProperty("AlarmRecordID")
|
||||
private String alarmRecordId;
|
||||
|
||||
/**
|
||||
* Current data
|
||||
*/
|
||||
@JsonProperty("CurrentData")
|
||||
private String currentData;
|
||||
|
||||
/**
|
||||
* The comparison conditions for the alarm thresholds can be >, =, <, >=, <=.
|
||||
*/
|
||||
@JsonProperty("ComparisonOperator")
|
||||
private String comparisonOperator;
|
||||
|
||||
/**
|
||||
* Alarm value
|
||||
*/
|
||||
@JsonProperty("Value")
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* Number of consecutive occurrences of triggered alarms
|
||||
*/
|
||||
@JsonProperty("Count")
|
||||
private int count;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Huawei cloud alert type
|
||||
*/
|
||||
public enum AlertType {
|
||||
|
||||
SUBSCRIPTION("SubscriptionConfirmation"),
|
||||
|
||||
UNSUBSCRIBE("UnsubscribeConfirmation"),
|
||||
|
||||
NOTIFICATION("Notification");
|
||||
|
||||
private final String type;
|
||||
|
||||
AlertType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public static boolean valid(String type) {
|
||||
if (null == type || type.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
return Arrays.stream(AlertType.values()).anyMatch(alertType -> alertType.getType().equals(type));
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
-121
@@ -1,121 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.alert.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* volcengine event alert entity class
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class VolcEngineExternEventAlert {
|
||||
@JsonProperty("Type")
|
||||
private String type;
|
||||
|
||||
@JsonProperty("AccountId")
|
||||
private String accountId;
|
||||
|
||||
@JsonProperty("Source")
|
||||
private String source;
|
||||
|
||||
@JsonProperty("ProjectName")
|
||||
private String projectName;
|
||||
|
||||
@JsonProperty("Id")
|
||||
private String id;
|
||||
|
||||
@JsonProperty("EventType")
|
||||
private String eventType;
|
||||
|
||||
@JsonProperty("DescriptionCN")
|
||||
private String descriptionCn;
|
||||
|
||||
@JsonProperty("HappenedAt")
|
||||
private Long happenedAt;
|
||||
|
||||
@JsonProperty("Region")
|
||||
private String region;
|
||||
|
||||
@JsonProperty("Details")
|
||||
private EventDetails details;
|
||||
|
||||
@JsonProperty("Rules")
|
||||
private List<EventRule> rules;
|
||||
|
||||
/**
|
||||
* event details
|
||||
*/
|
||||
@Data
|
||||
public static class EventDetails {
|
||||
@JsonProperty("specversion")
|
||||
private String specVersion;
|
||||
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
|
||||
@JsonProperty("source")
|
||||
private String source;
|
||||
|
||||
@JsonProperty("type")
|
||||
private String type;
|
||||
|
||||
@JsonProperty("volcpublishtime")
|
||||
private String volcPublishTime;
|
||||
|
||||
@JsonProperty("volcregion")
|
||||
private String volcRegion;
|
||||
|
||||
@JsonProperty("volcaccountid")
|
||||
private String volcAccountId;
|
||||
|
||||
@JsonProperty("volceventbusname")
|
||||
private String volcEventBusName;
|
||||
|
||||
@JsonProperty("volcresourcename")
|
||||
private String volcResourceName;
|
||||
|
||||
@JsonProperty("subject")
|
||||
private String subject;
|
||||
|
||||
@JsonProperty("time")
|
||||
private String time;
|
||||
}
|
||||
|
||||
/**
|
||||
* event rule
|
||||
*/
|
||||
@Data
|
||||
public static class EventRule {
|
||||
@JsonProperty("RuleId")
|
||||
private String ruleId;
|
||||
|
||||
@JsonProperty("RuleName")
|
||||
private String ruleName;
|
||||
|
||||
@JsonProperty("Level")
|
||||
private String level;
|
||||
}
|
||||
}
|
||||
-203
@@ -1,203 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.alert.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Volcengine alarm entity class
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class VolcEngineExternMetricAlert {
|
||||
|
||||
@JsonProperty("Type")
|
||||
private String type;
|
||||
|
||||
@JsonProperty("AccountId")
|
||||
private String accountId;
|
||||
|
||||
@JsonProperty("RuleName")
|
||||
private String ruleName;
|
||||
|
||||
@JsonProperty("RuleId")
|
||||
private String ruleId;
|
||||
|
||||
@JsonProperty("Namespace")
|
||||
private String namespace;
|
||||
|
||||
@JsonProperty("SubNamespace")
|
||||
private String subNamespace;
|
||||
|
||||
@JsonProperty("Level")
|
||||
private String level;
|
||||
|
||||
@JsonProperty("HappenedAt")
|
||||
private String happenedAt;
|
||||
|
||||
@JsonProperty("RuleCondition")
|
||||
private String ruleCondition;
|
||||
|
||||
@JsonProperty("Resources")
|
||||
private List<Resource> resources;
|
||||
|
||||
@JsonProperty("RecoveredResources")
|
||||
private List<Resource> recoveredResources;
|
||||
|
||||
@JsonProperty("NoDataResources")
|
||||
private List<NoDataResource> noDataResources;
|
||||
|
||||
@JsonProperty("NoDataRecoveredResources")
|
||||
private List<NoDataRecoveredResource> noDataRecoveredResources;
|
||||
|
||||
/**
|
||||
* alert resource entity class
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public static class Resource {
|
||||
@JsonProperty("Id")
|
||||
private String id;
|
||||
|
||||
@JsonProperty("Name")
|
||||
private String name;
|
||||
|
||||
@JsonProperty("Region")
|
||||
private String region;
|
||||
|
||||
@JsonProperty("FirstAlertTime")
|
||||
private Long firstAlertTime;
|
||||
|
||||
@JsonProperty("LastAlertTime")
|
||||
private Long lastAlertTime;
|
||||
|
||||
@JsonProperty("Metrics")
|
||||
private List<Metric> metrics;
|
||||
|
||||
@JsonProperty("AlertGroupId")
|
||||
private String alertGroupId;
|
||||
|
||||
@JsonProperty("Dimensions")
|
||||
private List<Dimension> dimensions;
|
||||
}
|
||||
|
||||
/**
|
||||
* alert no data resource entity class
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class NoDataResource extends Resource {
|
||||
@JsonProperty("NoDataMetrics")
|
||||
private List<Metric> noDataMetrics;
|
||||
}
|
||||
|
||||
/**
|
||||
* alert no data recovered resource entity class
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class NoDataRecoveredResource extends Resource {
|
||||
@JsonProperty("DroppedMetrics")
|
||||
private List<DroppedMetric> droppedMetrics;
|
||||
}
|
||||
|
||||
/**
|
||||
* alert metric entity class
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class Metric {
|
||||
@JsonProperty("Name")
|
||||
private String name;
|
||||
|
||||
@JsonProperty("Unit")
|
||||
private String unit;
|
||||
|
||||
@JsonProperty("Threshold")
|
||||
private Double threshold;
|
||||
|
||||
@JsonProperty("CurrentValue")
|
||||
private Object currentValue;
|
||||
|
||||
@JsonProperty("Description")
|
||||
private String description;
|
||||
|
||||
@JsonProperty("Warning")
|
||||
private Boolean warning;
|
||||
}
|
||||
|
||||
/**
|
||||
* alert dropped metric entity class
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class DroppedMetric extends Metric {
|
||||
@JsonProperty("Reason")
|
||||
private String reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* resource dimension entity class
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class Dimension {
|
||||
@JsonProperty("Name")
|
||||
private String name;
|
||||
|
||||
@JsonProperty("NameCN")
|
||||
private String nameCn;
|
||||
|
||||
@JsonProperty("Value")
|
||||
private String value;
|
||||
|
||||
@JsonProperty("Description")
|
||||
private String description;
|
||||
}
|
||||
|
||||
|
||||
public static final String ALERT_TYPE_METRIC = "Metric";
|
||||
public static final String ALERT_TYPE_EVENT = "Event";
|
||||
public static final String ALERT_TYPE_METRIC_RECOVERED = "MetricRecovered";
|
||||
public static final String ALERT_TYPE_METRICS_NODATA = "MetricsNoData";
|
||||
public static final String ALERT_TYPE_NO_DATA_RECOVERED = "NoDataRecovered";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+10
-250
@@ -47,6 +47,14 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
|
||||
*/
|
||||
@Override public T visitAndExpr(AlertExpressionParser.AndExprContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitQueryExpr(AlertExpressionParser.QueryExprContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
@@ -63,22 +71,6 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
|
||||
*/
|
||||
@Override public T visitUnlessExpr(AlertExpressionParser.UnlessExprContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitSqlExpr(AlertExpressionParser.SqlExprContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitSqlCallExpr(AlertExpressionParser.SqlCallExprContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
@@ -96,23 +88,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
|
||||
@Override public T visitParenExpr(AlertExpressionParser.ParenExprContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitPromqlCallExpr(AlertExpressionParser.PromqlCallExprContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitPromqlExpr(AlertExpressionParser.PromqlExprContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
@@ -125,23 +101,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitFunctionCall(AlertExpressionParser.FunctionCallContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitParameterList(AlertExpressionParser.ParameterListContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitParameter(AlertExpressionParser.ParameterContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitIdentifier(AlertExpressionParser.IdentifierContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
@@ -150,204 +110,4 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitNumber(AlertExpressionParser.NumberContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitString(AlertExpressionParser.StringContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitDuration(AlertExpressionParser.DurationContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitFunctionName(AlertExpressionParser.FunctionNameContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitSelectSql(AlertExpressionParser.SelectSqlContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitSelectFieldList(AlertExpressionParser.SelectFieldListContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitSelectField(AlertExpressionParser.SelectFieldContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitGroupByList(AlertExpressionParser.GroupByListContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitOrderByList(AlertExpressionParser.OrderByListContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitOrderByField(AlertExpressionParser.OrderByFieldContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitLimitClause(AlertExpressionParser.LimitClauseContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitRelList(AlertExpressionParser.RelListContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitRelation(AlertExpressionParser.RelationContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitConditionList(AlertExpressionParser.ConditionListContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitCompOp(AlertExpressionParser.CompOpContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitCondition(AlertExpressionParser.ConditionContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitConditionUnit(AlertExpressionParser.ConditionUnitContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitPromql(AlertExpressionParser.PromqlContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitMetricSelector(AlertExpressionParser.MetricSelectorContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitLabelMatcherList(AlertExpressionParser.LabelMatcherListContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitLabelMatcherItem(AlertExpressionParser.LabelMatcherItemContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitLabelMatcherOp(AlertExpressionParser.LabelMatcherOpContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitLabelList(AlertExpressionParser.LabelListContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitInstantVectorOp(AlertExpressionParser.InstantVectorOpContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitAggregationOperator(AlertExpressionParser.AggregationOperatorContext ctx) { return visitChildren(ctx); }
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitBinaryOperator(AlertExpressionParser.BinaryOperatorContext ctx) { return visitChildren(ctx); }
|
||||
}
|
||||
+42
-71
@@ -17,7 +17,6 @@
|
||||
|
||||
package org.apache.hertzbeat.alert.expr;
|
||||
|
||||
import org.antlr.v4.runtime.CommonTokenStream;
|
||||
import org.apache.hertzbeat.warehouse.db.QueryExecutor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -25,8 +24,6 @@ import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Alert expression visitor implement
|
||||
@@ -34,16 +31,12 @@ import java.util.stream.Collectors;
|
||||
public class AlertExpressionEvalVisitor extends AlertExpressionBaseVisitor<List<Map<String, Object>>> {
|
||||
|
||||
private static final String THRESHOLD = "__threshold__";
|
||||
private static final String NAME = "__name__";
|
||||
private static final String VALUE = "__value__";
|
||||
private static final String TIMESTAMP = "__timestamp__";
|
||||
|
||||
private final QueryExecutor executor;
|
||||
private final CommonTokenStream tokens;
|
||||
|
||||
public AlertExpressionEvalVisitor(QueryExecutor executor, CommonTokenStream tokens) {
|
||||
public AlertExpressionEvalVisitor(QueryExecutor executor) {
|
||||
this.executor = executor;
|
||||
this.tokens = tokens;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -73,11 +66,10 @@ public class AlertExpressionEvalVisitor extends AlertExpressionBaseVisitor<List<
|
||||
}
|
||||
// queryValues may be a list of values, or a single value
|
||||
Object matchValue = evaluateCondition(queryValues, operator, threshold);
|
||||
Map<String, Object> resultMap = new HashMap(item);
|
||||
resultMap.put(VALUE, matchValue);
|
||||
item.put(VALUE, matchValue);
|
||||
// if matchValue is null, mean not match the threshold
|
||||
// if not null, mean match the threshold
|
||||
result.add(resultMap);
|
||||
result.add(new HashMap<>(item));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -88,26 +80,42 @@ public class AlertExpressionEvalVisitor extends AlertExpressionBaseVisitor<List<
|
||||
public List<Map<String, Object>> visitAndExpr(AlertExpressionParser.AndExprContext ctx) {
|
||||
List<Map<String, Object>> leftOperand = visit(ctx.left);
|
||||
List<Map<String, Object>> rightOperand = visit(ctx.right);
|
||||
List<Map<String, Object>> results = new ArrayList<>();
|
||||
|
||||
// build a hash set of the right-side tag collection
|
||||
Set<String> rightLabelsSet = rightOperand.stream()
|
||||
.filter(item -> item.get(VALUE) != null)
|
||||
.map(this::labelKey)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
// iterate over the left side, O(1) match
|
||||
for (Map<String, Object> leftItem : leftOperand) {
|
||||
Object leftVal = leftItem.get(VALUE);
|
||||
if (leftVal == null) {
|
||||
continue;
|
||||
Map<String, Object> leftMap = null;
|
||||
boolean leftMatch = false;
|
||||
Map<String, Object> rightMap = null;
|
||||
boolean rightMatch = false;
|
||||
for (Map<String, Object> item : leftOperand) {
|
||||
if (leftMap == null) {
|
||||
leftMap = item;
|
||||
}
|
||||
String labelKey = labelKey(leftItem);
|
||||
if (rightLabelsSet.contains(labelKey)) {
|
||||
results.add(new HashMap<>(leftItem));
|
||||
if (item.get(VALUE) != null) {
|
||||
leftMap = item;
|
||||
leftMatch = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return results;
|
||||
for (Map<String, Object> item : rightOperand) {
|
||||
if (rightMap == null) {
|
||||
rightMap = item;
|
||||
}
|
||||
if (item.get(VALUE) != null) {
|
||||
rightMap = item;
|
||||
rightMatch = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (leftMatch && rightMatch) {
|
||||
rightMap.putAll(leftMap);
|
||||
return new LinkedList<>(List.of(rightMap));
|
||||
} else if (leftMap != null) {
|
||||
leftMap.put(VALUE, null);
|
||||
return new LinkedList<>(List.of(leftMap));
|
||||
} else if (rightMap != null) {
|
||||
rightMap.put(VALUE, null);
|
||||
return new LinkedList<>(List.of(rightMap));
|
||||
}
|
||||
return new LinkedList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -203,6 +211,12 @@ public class AlertExpressionEvalVisitor extends AlertExpressionBaseVisitor<List<
|
||||
return new LinkedList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> visitQueryExpr(AlertExpressionParser.QueryExprContext ctx) {
|
||||
String query = ctx.identifier().getText();
|
||||
return executor.execute(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> visitLiteralExpr(AlertExpressionParser.LiteralExprContext ctx) {
|
||||
double value = Double.parseDouble(ctx.number().getText());
|
||||
@@ -213,28 +227,6 @@ public class AlertExpressionEvalVisitor extends AlertExpressionBaseVisitor<List<
|
||||
return numAsList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> visitPromqlExpr(AlertExpressionParser.PromqlExprContext ctx) {
|
||||
String rawPromql = tokens.getText(ctx.promql());
|
||||
return executor.execute(rawPromql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> visitSqlExpr(AlertExpressionParser.SqlExprContext ctx) {
|
||||
String rawSql = tokens.getText(ctx.selectSql());
|
||||
return executor.execute(rawSql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> visitSqlCallExpr(AlertExpressionParser.SqlCallExprContext ctx) {
|
||||
return callSqlOrPromql(tokens.getText(ctx.string()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> visitPromqlCallExpr(AlertExpressionParser.PromqlCallExprContext ctx) {
|
||||
return callSqlOrPromql(tokens.getText(ctx.string()));
|
||||
}
|
||||
|
||||
private Object evaluateCondition(Object value, String operator, Double threshold) {
|
||||
// value may be a list of values, or a single value
|
||||
switch (operator) {
|
||||
@@ -310,25 +302,4 @@ public class AlertExpressionEvalVisitor extends AlertExpressionBaseVisitor<List<
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private List<Map<String, Object>> callSqlOrPromql(String text){
|
||||
String script = text.substring(1, text.length() - 1);
|
||||
return executor.execute(script);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate tag key (excluding `__name__` and `__value__` and `__timestamp__`)
|
||||
*/
|
||||
private String labelKey(Map<String, Object> labelsMap) {
|
||||
if (null == labelsMap || labelsMap.isEmpty()) {
|
||||
return "-";
|
||||
}
|
||||
String key = labelsMap.entrySet().stream()
|
||||
.filter(e -> !e.getKey().equals(VALUE) && !e.getKey().equals(NAME) && !e.getKey().equals(TIMESTAMP))
|
||||
.sorted(Map.Entry.comparingByKey())
|
||||
.map(e -> e.getKey() + "=" + (e.getValue() == null ? "" : e.getValue()))
|
||||
.collect(Collectors.joining(","));
|
||||
return key.isEmpty() ? "-" : key;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+66
-396
@@ -36,66 +36,37 @@ public class AlertExpressionLexer extends Lexer {
|
||||
|
||||
protected static final DFA[] _decisionToDFA;
|
||||
protected static final PredictionContextCache _sharedContextCache =
|
||||
new PredictionContextCache();
|
||||
new PredictionContextCache();
|
||||
public static final int
|
||||
AND=1, OR=2, UNLESS=3, NOT=4, SELECT=5, FROM=6, WHERE=7, GROUP=8, BY=9,
|
||||
HAVING=10, ORDER=11, LIMIT=12, OFFSET=13, AS=14, ASC=15, DESC=16, IN=17,
|
||||
IS=18, NULL=19, LIKE=20, BETWEEN=21, STAR=22, COUNT=23, SUM=24, AVG=25,
|
||||
MIN=26, MAX=27, STDDEV=28, STDVAR=29, VARIANCE=30, RATE_FUNCTION=31, INCREASE_FUNCTION=32,
|
||||
HISTOGRAM_QUANTILE_FUNCTION=33, TOPK=34, BOTTOMK=35, QUANTILE=36, BY_FUNCTION=37,
|
||||
WITHOUT_FUNCTION=38, GROUP_LEFT_FUNCTION=39, GROUP_RIGHT_FUNCTION=40,
|
||||
IGNORING_FUNCTION=41, ON_FUNCTION=42, SQL_FUNCTION=43, PROMQL_FUNCTION=44,
|
||||
GT=45, GE=46, LT=47, LE=48, EQ=49, NE=50, LPAREN=51, RPAREN=52, LBRACE=53,
|
||||
RBRACE=54, LBRACKET=55, RBRACKET=56, COMMA=57, DOT=58, COLON=59, SEMICOLON=60,
|
||||
SCIENTIFIC_NUMBER=61, FLOAT=62, NUMBER=63, DURATION=64, STRING=65, IDENTIFIER=66,
|
||||
WS=67, LINE_COMMENT=68, BLOCK_COMMENT=69;
|
||||
AND=1, OR=2, UNLESS=3, GT=4, GE=5, LT=6, LE=7, EQ=8, NE=9, LPAREN=10,
|
||||
RPAREN=11, IDENTIFIER=12, NUMBER=13, WS=14;
|
||||
public static String[] channelNames = {
|
||||
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
|
||||
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
|
||||
};
|
||||
|
||||
public static String[] modeNames = {
|
||||
"DEFAULT_MODE"
|
||||
"DEFAULT_MODE"
|
||||
};
|
||||
|
||||
private static String[] makeRuleNames() {
|
||||
return new String[] {
|
||||
"AND", "OR", "UNLESS", "NOT", "SELECT", "FROM", "WHERE", "GROUP", "BY",
|
||||
"HAVING", "ORDER", "LIMIT", "OFFSET", "AS", "ASC", "DESC", "IN", "IS",
|
||||
"NULL", "LIKE", "BETWEEN", "STAR", "COUNT", "SUM", "AVG", "MIN", "MAX",
|
||||
"STDDEV", "STDVAR", "VARIANCE", "RATE_FUNCTION", "INCREASE_FUNCTION",
|
||||
"HISTOGRAM_QUANTILE_FUNCTION", "TOPK", "BOTTOMK", "QUANTILE", "BY_FUNCTION",
|
||||
"WITHOUT_FUNCTION", "GROUP_LEFT_FUNCTION", "GROUP_RIGHT_FUNCTION", "IGNORING_FUNCTION",
|
||||
"ON_FUNCTION", "SQL_FUNCTION", "PROMQL_FUNCTION", "GT", "GE", "LT", "LE",
|
||||
"EQ", "NE", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACKET", "RBRACKET",
|
||||
"COMMA", "DOT", "COLON", "SEMICOLON", "SCIENTIFIC_NUMBER", "FLOAT", "NUMBER",
|
||||
"DURATION", "STRING", "IDENTIFIER", "WS", "LINE_COMMENT", "BLOCK_COMMENT"
|
||||
"AND", "OR", "UNLESS", "GT", "GE", "LT", "LE", "EQ", "NE", "LPAREN",
|
||||
"RPAREN", "IDENTIFIER", "NUMBER", "WS"
|
||||
};
|
||||
}
|
||||
public static final String[] ruleNames = makeRuleNames();
|
||||
|
||||
private static String[] makeLiteralNames() {
|
||||
return new String[] {
|
||||
null, null, null, null, null, null, null, null, null, null, null, null,
|
||||
null, null, null, null, null, null, null, null, null, null, "'*'", null,
|
||||
null, null, null, null, null, null, null, null, null, null, null, null,
|
||||
null, null, null, null, null, null, null, null, null, "'>'", "'>='",
|
||||
"'<'", "'<='", null, "'!='", "'('", "')'", "'{'", "'}'", "'['", "']'",
|
||||
"','", "'.'", "':'", "';'"
|
||||
null, "'and'", "'or'", "'unless'", "'>'", "'>='", "'<'", "'<='", "'=='",
|
||||
"'!='", "'('", "')'"
|
||||
};
|
||||
}
|
||||
private static final String[] _LITERAL_NAMES = makeLiteralNames();
|
||||
private static String[] makeSymbolicNames() {
|
||||
return new String[] {
|
||||
null, "AND", "OR", "UNLESS", "NOT", "SELECT", "FROM", "WHERE", "GROUP",
|
||||
"BY", "HAVING", "ORDER", "LIMIT", "OFFSET", "AS", "ASC", "DESC", "IN",
|
||||
"IS", "NULL", "LIKE", "BETWEEN", "STAR", "COUNT", "SUM", "AVG", "MIN",
|
||||
"MAX", "STDDEV", "STDVAR", "VARIANCE", "RATE_FUNCTION", "INCREASE_FUNCTION",
|
||||
"HISTOGRAM_QUANTILE_FUNCTION", "TOPK", "BOTTOMK", "QUANTILE", "BY_FUNCTION",
|
||||
"WITHOUT_FUNCTION", "GROUP_LEFT_FUNCTION", "GROUP_RIGHT_FUNCTION", "IGNORING_FUNCTION",
|
||||
"ON_FUNCTION", "SQL_FUNCTION", "PROMQL_FUNCTION", "GT", "GE", "LT", "LE",
|
||||
"EQ", "NE", "LPAREN", "RPAREN", "LBRACE", "RBRACE", "LBRACKET", "RBRACKET",
|
||||
"COMMA", "DOT", "COLON", "SEMICOLON", "SCIENTIFIC_NUMBER", "FLOAT", "NUMBER",
|
||||
"DURATION", "STRING", "IDENTIFIER", "WS", "LINE_COMMENT", "BLOCK_COMMENT"
|
||||
null, "AND", "OR", "UNLESS", "GT", "GE", "LT", "LE", "EQ", "NE", "LPAREN",
|
||||
"RPAREN", "IDENTIFIER", "NUMBER", "WS"
|
||||
};
|
||||
}
|
||||
private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
|
||||
@@ -157,363 +128,62 @@ public class AlertExpressionLexer extends Lexer {
|
||||
public ATN getATN() { return _ATN; }
|
||||
|
||||
public static final String _serializedATN =
|
||||
"\u0004\u0000E\u0228\u0006\uffff\uffff\u0002\u0000\u0007\u0000\u0002\u0001"+
|
||||
"\u0007\u0001\u0002\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004"+
|
||||
"\u0007\u0004\u0002\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007"+
|
||||
"\u0007\u0007\u0002\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b"+
|
||||
"\u0007\u000b\u0002\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0002"+
|
||||
"\u000f\u0007\u000f\u0002\u0010\u0007\u0010\u0002\u0011\u0007\u0011\u0002"+
|
||||
"\u0012\u0007\u0012\u0002\u0013\u0007\u0013\u0002\u0014\u0007\u0014\u0002"+
|
||||
"\u0015\u0007\u0015\u0002\u0016\u0007\u0016\u0002\u0017\u0007\u0017\u0002"+
|
||||
"\u0018\u0007\u0018\u0002\u0019\u0007\u0019\u0002\u001a\u0007\u001a\u0002"+
|
||||
"\u001b\u0007\u001b\u0002\u001c\u0007\u001c\u0002\u001d\u0007\u001d\u0002"+
|
||||
"\u001e\u0007\u001e\u0002\u001f\u0007\u001f\u0002 \u0007 \u0002!\u0007"+
|
||||
"!\u0002\"\u0007\"\u0002#\u0007#\u0002$\u0007$\u0002%\u0007%\u0002&\u0007"+
|
||||
"&\u0002\'\u0007\'\u0002(\u0007(\u0002)\u0007)\u0002*\u0007*\u0002+\u0007"+
|
||||
"+\u0002,\u0007,\u0002-\u0007-\u0002.\u0007.\u0002/\u0007/\u00020\u0007"+
|
||||
"0\u00021\u00071\u00022\u00072\u00023\u00073\u00024\u00074\u00025\u0007"+
|
||||
"5\u00026\u00076\u00027\u00077\u00028\u00078\u00029\u00079\u0002:\u0007"+
|
||||
":\u0002;\u0007;\u0002<\u0007<\u0002=\u0007=\u0002>\u0007>\u0002?\u0007"+
|
||||
"?\u0002@\u0007@\u0002A\u0007A\u0002B\u0007B\u0002C\u0007C\u0002D\u0007"+
|
||||
"D\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0001"+
|
||||
"\u0001\u0001\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002"+
|
||||
"\u0001\u0002\u0001\u0002\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003"+
|
||||
"\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004"+
|
||||
"\u0001\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005"+
|
||||
"\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006"+
|
||||
"\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007"+
|
||||
"\u0001\b\u0001\b\u0001\b\u0001\t\u0001\t\u0001\t\u0001\t\u0001\t\u0001"+
|
||||
"\t\u0001\t\u0001\n\u0001\n\u0001\n\u0001\n\u0001\n\u0001\n\u0001\u000b"+
|
||||
"\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\f\u0001"+
|
||||
"\f\u0001\f\u0001\f\u0001\f\u0001\f\u0001\f\u0001\r\u0001\r\u0001\r\u0001"+
|
||||
"\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000f\u0001\u000f\u0001"+
|
||||
"\u000f\u0001\u000f\u0001\u000f\u0001\u0010\u0001\u0010\u0001\u0010\u0001"+
|
||||
"\u0011\u0001\u0011\u0001\u0011\u0001\u0012\u0001\u0012\u0001\u0012\u0001"+
|
||||
"\u0012\u0001\u0012\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001"+
|
||||
"\u0013\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001"+
|
||||
"\u0014\u0001\u0014\u0001\u0014\u0001\u0015\u0001\u0015\u0001\u0016\u0001"+
|
||||
"\u0016\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0017\u0001"+
|
||||
"\u0017\u0001\u0017\u0001\u0017\u0001\u0018\u0001\u0018\u0001\u0018\u0001"+
|
||||
"\u0018\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u001a\u0001"+
|
||||
"\u001a\u0001\u001a\u0001\u001a\u0001\u001b\u0001\u001b\u0001\u001b\u0001"+
|
||||
"\u001b\u0001\u001b\u0001\u001b\u0001\u001b\u0001\u001c\u0001\u001c\u0001"+
|
||||
"\u001c\u0001\u001c\u0001\u001c\u0001\u001c\u0001\u001c\u0001\u001d\u0001"+
|
||||
"\u001d\u0001\u001d\u0001\u001d\u0001\u001d\u0001\u001d\u0001\u001d\u0001"+
|
||||
"\u001d\u0001\u001d\u0001\u001e\u0001\u001e\u0001\u001e\u0001\u001e\u0001"+
|
||||
"\u001e\u0001\u001f\u0001\u001f\u0001\u001f\u0001\u001f\u0001\u001f\u0001"+
|
||||
"\u001f\u0001\u001f\u0001\u001f\u0001\u001f\u0001 \u0001 \u0001 \u0001"+
|
||||
" \u0001 \u0001 \u0001 \u0001 \u0001 \u0001 \u0001 \u0001 \u0001 \u0001"+
|
||||
" \u0001 \u0001 \u0001 \u0001 \u0001 \u0001!\u0001!\u0001!\u0001!\u0001"+
|
||||
"!\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001"+
|
||||
"#\u0001#\u0001#\u0001#\u0001#\u0001#\u0001#\u0001#\u0001#\u0001$\u0001"+
|
||||
"$\u0001$\u0001%\u0001%\u0001%\u0001%\u0001%\u0001%\u0001%\u0001%\u0001"+
|
||||
"&\u0001&\u0001&\u0001&\u0001&\u0001&\u0001&\u0001&\u0001&\u0001&\u0001"+
|
||||
"&\u0001\'\u0001\'\u0001\'\u0001\'\u0001\'\u0001\'\u0001\'\u0001\'\u0001"+
|
||||
"\'\u0001\'\u0001\'\u0001\'\u0001(\u0001(\u0001(\u0001(\u0001(\u0001(\u0001"+
|
||||
"(\u0001(\u0001(\u0001)\u0001)\u0001)\u0001*\u0001*\u0001*\u0001*\u0001"+
|
||||
"+\u0001+\u0001+\u0001+\u0001+\u0001+\u0001+\u0001,\u0001,\u0001-\u0001"+
|
||||
"-\u0001-\u0001.\u0001.\u0001/\u0001/\u0001/\u00010\u00010\u00010\u0003"+
|
||||
"0\u01a3\b0\u00011\u00011\u00011\u00012\u00012\u00013\u00013\u00014\u0001"+
|
||||
"4\u00015\u00015\u00016\u00016\u00017\u00017\u00018\u00018\u00019\u0001"+
|
||||
"9\u0001:\u0001:\u0001;\u0001;\u0001<\u0004<\u01bd\b<\u000b<\f<\u01be\u0001"+
|
||||
"<\u0001<\u0004<\u01c3\b<\u000b<\f<\u01c4\u0003<\u01c7\b<\u0001<\u0001"+
|
||||
"<\u0003<\u01cb\b<\u0001<\u0004<\u01ce\b<\u000b<\f<\u01cf\u0001=\u0004"+
|
||||
"=\u01d3\b=\u000b=\f=\u01d4\u0001=\u0001=\u0004=\u01d9\b=\u000b=\f=\u01da"+
|
||||
"\u0001>\u0004>\u01de\b>\u000b>\f>\u01df\u0001?\u0004?\u01e3\b?\u000b?"+
|
||||
"\f?\u01e4\u0001?\u0004?\u01e8\b?\u000b?\f?\u01e9\u0001@\u0001@\u0001@"+
|
||||
"\u0001@\u0005@\u01f0\b@\n@\f@\u01f3\t@\u0001@\u0001@\u0001@\u0001@\u0001"+
|
||||
"@\u0005@\u01fa\b@\n@\f@\u01fd\t@\u0001@\u0003@\u0200\b@\u0001A\u0001A"+
|
||||
"\u0005A\u0204\bA\nA\fA\u0207\tA\u0001B\u0004B\u020a\bB\u000bB\fB\u020b"+
|
||||
"\u0001B\u0001B\u0001C\u0001C\u0001C\u0001C\u0005C\u0214\bC\nC\fC\u0217"+
|
||||
"\tC\u0001C\u0001C\u0001D\u0001D\u0001D\u0001D\u0005D\u021f\bD\nD\fD\u0222"+
|
||||
"\tD\u0001D\u0001D\u0001D\u0001D\u0001D\u0001\u0220\u0000E\u0001\u0001"+
|
||||
"\u0003\u0002\u0005\u0003\u0007\u0004\t\u0005\u000b\u0006\r\u0007\u000f"+
|
||||
"\b\u0011\t\u0013\n\u0015\u000b\u0017\f\u0019\r\u001b\u000e\u001d\u000f"+
|
||||
"\u001f\u0010!\u0011#\u0012%\u0013\'\u0014)\u0015+\u0016-\u0017/\u0018"+
|
||||
"1\u00193\u001a5\u001b7\u001c9\u001d;\u001e=\u001f? A!C\"E#G$I%K&M\'O("+
|
||||
"Q)S*U+W,Y-[.]/_0a1c2e3g4i5k6m7o8q9s:u;w<y={>}?\u007f@\u0081A\u0083B\u0085"+
|
||||
"C\u0087D\u0089E\u0001\u0000!\u0002\u0000AAaa\u0002\u0000NNnn\u0002\u0000"+
|
||||
"DDdd\u0002\u0000OOoo\u0002\u0000RRrr\u0002\u0000UUuu\u0002\u0000LLll\u0002"+
|
||||
"\u0000EEee\u0002\u0000SSss\u0002\u0000TTtt\u0002\u0000CCcc\u0002\u0000"+
|
||||
"FFff\u0002\u0000MMmm\u0002\u0000WWww\u0002\u0000HHhh\u0002\u0000GGgg\u0002"+
|
||||
"\u0000PPpp\u0002\u0000BBbb\u0002\u0000YYyy\u0002\u0000VVvv\u0002\u0000"+
|
||||
"IIii\u0002\u0000KKkk\u0002\u0000XXxx\u0002\u0000QQqq\u0001\u000009\u0002"+
|
||||
"\u0000++--\u0002\u0000AZaz\u0004\u0000\n\n\r\r\"\"\\\\\u0004\u0000\n\n"+
|
||||
"\r\r\'\'\\\\\u0003\u0000AZ__az\n\u0000\"\"-.09==A[]]__a{}~\u8000\uff5e"+
|
||||
"\u8000\uff5e\u0003\u0000\t\n\r\r \u0002\u0000\n\n\r\r\u023b\u0000\u0001"+
|
||||
"\u0001\u0000\u0000\u0000\u0000\u0003\u0001\u0000\u0000\u0000\u0000\u0005"+
|
||||
"\u0001\u0000\u0000\u0000\u0000\u0007\u0001\u0000\u0000\u0000\u0000\t\u0001"+
|
||||
"\u0000\u0000\u0000\u0000\u000b\u0001\u0000\u0000\u0000\u0000\r\u0001\u0000"+
|
||||
"\u0000\u0000\u0000\u000f\u0001\u0000\u0000\u0000\u0000\u0011\u0001\u0000"+
|
||||
"\u0000\u0000\u0000\u0013\u0001\u0000\u0000\u0000\u0000\u0015\u0001\u0000"+
|
||||
"\u0000\u0000\u0000\u0017\u0001\u0000\u0000\u0000\u0000\u0019\u0001\u0000"+
|
||||
"\u0000\u0000\u0000\u001b\u0001\u0000\u0000\u0000\u0000\u001d\u0001\u0000"+
|
||||
"\u0000\u0000\u0000\u001f\u0001\u0000\u0000\u0000\u0000!\u0001\u0000\u0000"+
|
||||
"\u0000\u0000#\u0001\u0000\u0000\u0000\u0000%\u0001\u0000\u0000\u0000\u0000"+
|
||||
"\'\u0001\u0000\u0000\u0000\u0000)\u0001\u0000\u0000\u0000\u0000+\u0001"+
|
||||
"\u0000\u0000\u0000\u0000-\u0001\u0000\u0000\u0000\u0000/\u0001\u0000\u0000"+
|
||||
"\u0000\u00001\u0001\u0000\u0000\u0000\u00003\u0001\u0000\u0000\u0000\u0000"+
|
||||
"5\u0001\u0000\u0000\u0000\u00007\u0001\u0000\u0000\u0000\u00009\u0001"+
|
||||
"\u0000\u0000\u0000\u0000;\u0001\u0000\u0000\u0000\u0000=\u0001\u0000\u0000"+
|
||||
"\u0000\u0000?\u0001\u0000\u0000\u0000\u0000A\u0001\u0000\u0000\u0000\u0000"+
|
||||
"C\u0001\u0000\u0000\u0000\u0000E\u0001\u0000\u0000\u0000\u0000G\u0001"+
|
||||
"\u0000\u0000\u0000\u0000I\u0001\u0000\u0000\u0000\u0000K\u0001\u0000\u0000"+
|
||||
"\u0000\u0000M\u0001\u0000\u0000\u0000\u0000O\u0001\u0000\u0000\u0000\u0000"+
|
||||
"Q\u0001\u0000\u0000\u0000\u0000S\u0001\u0000\u0000\u0000\u0000U\u0001"+
|
||||
"\u0000\u0000\u0000\u0000W\u0001\u0000\u0000\u0000\u0000Y\u0001\u0000\u0000"+
|
||||
"\u0000\u0000[\u0001\u0000\u0000\u0000\u0000]\u0001\u0000\u0000\u0000\u0000"+
|
||||
"_\u0001\u0000\u0000\u0000\u0000a\u0001\u0000\u0000\u0000\u0000c\u0001"+
|
||||
"\u0000\u0000\u0000\u0000e\u0001\u0000\u0000\u0000\u0000g\u0001\u0000\u0000"+
|
||||
"\u0000\u0000i\u0001\u0000\u0000\u0000\u0000k\u0001\u0000\u0000\u0000\u0000"+
|
||||
"m\u0001\u0000\u0000\u0000\u0000o\u0001\u0000\u0000\u0000\u0000q\u0001"+
|
||||
"\u0000\u0000\u0000\u0000s\u0001\u0000\u0000\u0000\u0000u\u0001\u0000\u0000"+
|
||||
"\u0000\u0000w\u0001\u0000\u0000\u0000\u0000y\u0001\u0000\u0000\u0000\u0000"+
|
||||
"{\u0001\u0000\u0000\u0000\u0000}\u0001\u0000\u0000\u0000\u0000\u007f\u0001"+
|
||||
"\u0000\u0000\u0000\u0000\u0081\u0001\u0000\u0000\u0000\u0000\u0083\u0001"+
|
||||
"\u0000\u0000\u0000\u0000\u0085\u0001\u0000\u0000\u0000\u0000\u0087\u0001"+
|
||||
"\u0000\u0000\u0000\u0000\u0089\u0001\u0000\u0000\u0000\u0001\u008b\u0001"+
|
||||
"\u0000\u0000\u0000\u0003\u008f\u0001\u0000\u0000\u0000\u0005\u0092\u0001"+
|
||||
"\u0000\u0000\u0000\u0007\u0099\u0001\u0000\u0000\u0000\t\u009d\u0001\u0000"+
|
||||
"\u0000\u0000\u000b\u00a4\u0001\u0000\u0000\u0000\r\u00a9\u0001\u0000\u0000"+
|
||||
"\u0000\u000f\u00af\u0001\u0000\u0000\u0000\u0011\u00b5\u0001\u0000\u0000"+
|
||||
"\u0000\u0013\u00b8\u0001\u0000\u0000\u0000\u0015\u00bf\u0001\u0000\u0000"+
|
||||
"\u0000\u0017\u00c5\u0001\u0000\u0000\u0000\u0019\u00cb\u0001\u0000\u0000"+
|
||||
"\u0000\u001b\u00d2\u0001\u0000\u0000\u0000\u001d\u00d5\u0001\u0000\u0000"+
|
||||
"\u0000\u001f\u00d9\u0001\u0000\u0000\u0000!\u00de\u0001\u0000\u0000\u0000"+
|
||||
"#\u00e1\u0001\u0000\u0000\u0000%\u00e4\u0001\u0000\u0000\u0000\'\u00e9"+
|
||||
"\u0001\u0000\u0000\u0000)\u00ee\u0001\u0000\u0000\u0000+\u00f6\u0001\u0000"+
|
||||
"\u0000\u0000-\u00f8\u0001\u0000\u0000\u0000/\u00fe\u0001\u0000\u0000\u0000"+
|
||||
"1\u0102\u0001\u0000\u0000\u00003\u0106\u0001\u0000\u0000\u00005\u010a"+
|
||||
"\u0001\u0000\u0000\u00007\u010e\u0001\u0000\u0000\u00009\u0115\u0001\u0000"+
|
||||
"\u0000\u0000;\u011c\u0001\u0000\u0000\u0000=\u0125\u0001\u0000\u0000\u0000"+
|
||||
"?\u012a\u0001\u0000\u0000\u0000A\u0133\u0001\u0000\u0000\u0000C\u0146"+
|
||||
"\u0001\u0000\u0000\u0000E\u014b\u0001\u0000\u0000\u0000G\u0153\u0001\u0000"+
|
||||
"\u0000\u0000I\u015c\u0001\u0000\u0000\u0000K\u015f\u0001\u0000\u0000\u0000"+
|
||||
"M\u0167\u0001\u0000\u0000\u0000O\u0172\u0001\u0000\u0000\u0000Q\u017e"+
|
||||
"\u0001\u0000\u0000\u0000S\u0187\u0001\u0000\u0000\u0000U\u018a\u0001\u0000"+
|
||||
"\u0000\u0000W\u018e\u0001\u0000\u0000\u0000Y\u0195\u0001\u0000\u0000\u0000"+
|
||||
"[\u0197\u0001\u0000\u0000\u0000]\u019a\u0001\u0000\u0000\u0000_\u019c"+
|
||||
"\u0001\u0000\u0000\u0000a\u01a2\u0001\u0000\u0000\u0000c\u01a4\u0001\u0000"+
|
||||
"\u0000\u0000e\u01a7\u0001\u0000\u0000\u0000g\u01a9\u0001\u0000\u0000\u0000"+
|
||||
"i\u01ab\u0001\u0000\u0000\u0000k\u01ad\u0001\u0000\u0000\u0000m\u01af"+
|
||||
"\u0001\u0000\u0000\u0000o\u01b1\u0001\u0000\u0000\u0000q\u01b3\u0001\u0000"+
|
||||
"\u0000\u0000s\u01b5\u0001\u0000\u0000\u0000u\u01b7\u0001\u0000\u0000\u0000"+
|
||||
"w\u01b9\u0001\u0000\u0000\u0000y\u01bc\u0001\u0000\u0000\u0000{\u01d2"+
|
||||
"\u0001\u0000\u0000\u0000}\u01dd\u0001\u0000\u0000\u0000\u007f\u01e2\u0001"+
|
||||
"\u0000\u0000\u0000\u0081\u01ff\u0001\u0000\u0000\u0000\u0083\u0201\u0001"+
|
||||
"\u0000\u0000\u0000\u0085\u0209\u0001\u0000\u0000\u0000\u0087\u020f\u0001"+
|
||||
"\u0000\u0000\u0000\u0089\u021a\u0001\u0000\u0000\u0000\u008b\u008c\u0007"+
|
||||
"\u0000\u0000\u0000\u008c\u008d\u0007\u0001\u0000\u0000\u008d\u008e\u0007"+
|
||||
"\u0002\u0000\u0000\u008e\u0002\u0001\u0000\u0000\u0000\u008f\u0090\u0007"+
|
||||
"\u0003\u0000\u0000\u0090\u0091\u0007\u0004\u0000\u0000\u0091\u0004\u0001"+
|
||||
"\u0000\u0000\u0000\u0092\u0093\u0007\u0005\u0000\u0000\u0093\u0094\u0007"+
|
||||
"\u0001\u0000\u0000\u0094\u0095\u0007\u0006\u0000\u0000\u0095\u0096\u0007"+
|
||||
"\u0007\u0000\u0000\u0096\u0097\u0007\b\u0000\u0000\u0097\u0098\u0007\b"+
|
||||
"\u0000\u0000\u0098\u0006\u0001\u0000\u0000\u0000\u0099\u009a\u0007\u0001"+
|
||||
"\u0000\u0000\u009a\u009b\u0007\u0003\u0000\u0000\u009b\u009c\u0007\t\u0000"+
|
||||
"\u0000\u009c\b\u0001\u0000\u0000\u0000\u009d\u009e\u0007\b\u0000\u0000"+
|
||||
"\u009e\u009f\u0007\u0007\u0000\u0000\u009f\u00a0\u0007\u0006\u0000\u0000"+
|
||||
"\u00a0\u00a1\u0007\u0007\u0000\u0000\u00a1\u00a2\u0007\n\u0000\u0000\u00a2"+
|
||||
"\u00a3\u0007\t\u0000\u0000\u00a3\n\u0001\u0000\u0000\u0000\u00a4\u00a5"+
|
||||
"\u0007\u000b\u0000\u0000\u00a5\u00a6\u0007\u0004\u0000\u0000\u00a6\u00a7"+
|
||||
"\u0007\u0003\u0000\u0000\u00a7\u00a8\u0007\f\u0000\u0000\u00a8\f\u0001"+
|
||||
"\u0000\u0000\u0000\u00a9\u00aa\u0007\r\u0000\u0000\u00aa\u00ab\u0007\u000e"+
|
||||
"\u0000\u0000\u00ab\u00ac\u0007\u0007\u0000\u0000\u00ac\u00ad\u0007\u0004"+
|
||||
"\u0000\u0000\u00ad\u00ae\u0007\u0007\u0000\u0000\u00ae\u000e\u0001\u0000"+
|
||||
"\u0000\u0000\u00af\u00b0\u0007\u000f\u0000\u0000\u00b0\u00b1\u0007\u0004"+
|
||||
"\u0000\u0000\u00b1\u00b2\u0007\u0003\u0000\u0000\u00b2\u00b3\u0007\u0005"+
|
||||
"\u0000\u0000\u00b3\u00b4\u0007\u0010\u0000\u0000\u00b4\u0010\u0001\u0000"+
|
||||
"\u0000\u0000\u00b5\u00b6\u0007\u0011\u0000\u0000\u00b6\u00b7\u0007\u0012"+
|
||||
"\u0000\u0000\u00b7\u0012\u0001\u0000\u0000\u0000\u00b8\u00b9\u0007\u000e"+
|
||||
"\u0000\u0000\u00b9\u00ba\u0007\u0000\u0000\u0000\u00ba\u00bb\u0007\u0013"+
|
||||
"\u0000\u0000\u00bb\u00bc\u0007\u0014\u0000\u0000\u00bc\u00bd\u0007\u0001"+
|
||||
"\u0000\u0000\u00bd\u00be\u0007\u000f\u0000\u0000\u00be\u0014\u0001\u0000"+
|
||||
"\u0000\u0000\u00bf\u00c0\u0007\u0003\u0000\u0000\u00c0\u00c1\u0007\u0004"+
|
||||
"\u0000\u0000\u00c1\u00c2\u0007\u0002\u0000\u0000\u00c2\u00c3\u0007\u0007"+
|
||||
"\u0000\u0000\u00c3\u00c4\u0007\u0004\u0000\u0000\u00c4\u0016\u0001\u0000"+
|
||||
"\u0000\u0000\u00c5\u00c6\u0007\u0006\u0000\u0000\u00c6\u00c7\u0007\u0014"+
|
||||
"\u0000\u0000\u00c7\u00c8\u0007\f\u0000\u0000\u00c8\u00c9\u0007\u0014\u0000"+
|
||||
"\u0000\u00c9\u00ca\u0007\t\u0000\u0000\u00ca\u0018\u0001\u0000\u0000\u0000"+
|
||||
"\u00cb\u00cc\u0007\u0003\u0000\u0000\u00cc\u00cd\u0007\u000b\u0000\u0000"+
|
||||
"\u00cd\u00ce\u0007\u000b\u0000\u0000\u00ce\u00cf\u0007\b\u0000\u0000\u00cf"+
|
||||
"\u00d0\u0007\u0007\u0000\u0000\u00d0\u00d1\u0007\t\u0000\u0000\u00d1\u001a"+
|
||||
"\u0001\u0000\u0000\u0000\u00d2\u00d3\u0007\u0000\u0000\u0000\u00d3\u00d4"+
|
||||
"\u0007\b\u0000\u0000\u00d4\u001c\u0001\u0000\u0000\u0000\u00d5\u00d6\u0007"+
|
||||
"\u0000\u0000\u0000\u00d6\u00d7\u0007\b\u0000\u0000\u00d7\u00d8\u0007\n"+
|
||||
"\u0000\u0000\u00d8\u001e\u0001\u0000\u0000\u0000\u00d9\u00da\u0007\u0002"+
|
||||
"\u0000\u0000\u00da\u00db\u0007\u0007\u0000\u0000\u00db\u00dc\u0007\b\u0000"+
|
||||
"\u0000\u00dc\u00dd\u0007\n\u0000\u0000\u00dd \u0001\u0000\u0000\u0000"+
|
||||
"\u00de\u00df\u0007\u0014\u0000\u0000\u00df\u00e0\u0007\u0001\u0000\u0000"+
|
||||
"\u00e0\"\u0001\u0000\u0000\u0000\u00e1\u00e2\u0007\u0014\u0000\u0000\u00e2"+
|
||||
"\u00e3\u0007\b\u0000\u0000\u00e3$\u0001\u0000\u0000\u0000\u00e4\u00e5"+
|
||||
"\u0007\u0001\u0000\u0000\u00e5\u00e6\u0007\u0005\u0000\u0000\u00e6\u00e7"+
|
||||
"\u0007\u0006\u0000\u0000\u00e7\u00e8\u0007\u0006\u0000\u0000\u00e8&\u0001"+
|
||||
"\u0000\u0000\u0000\u00e9\u00ea\u0007\u0006\u0000\u0000\u00ea\u00eb\u0007"+
|
||||
"\u0014\u0000\u0000\u00eb\u00ec\u0007\u0015\u0000\u0000\u00ec\u00ed\u0007"+
|
||||
"\u0007\u0000\u0000\u00ed(\u0001\u0000\u0000\u0000\u00ee\u00ef\u0007\u0011"+
|
||||
"\u0000\u0000\u00ef\u00f0\u0007\u0007\u0000\u0000\u00f0\u00f1\u0007\t\u0000"+
|
||||
"\u0000\u00f1\u00f2\u0007\r\u0000\u0000\u00f2\u00f3\u0007\u0007\u0000\u0000"+
|
||||
"\u00f3\u00f4\u0007\u0007\u0000\u0000\u00f4\u00f5\u0007\u0001\u0000\u0000"+
|
||||
"\u00f5*\u0001\u0000\u0000\u0000\u00f6\u00f7\u0005*\u0000\u0000\u00f7,"+
|
||||
"\u0001\u0000\u0000\u0000\u00f8\u00f9\u0007\n\u0000\u0000\u00f9\u00fa\u0007"+
|
||||
"\u0003\u0000\u0000\u00fa\u00fb\u0007\u0005\u0000\u0000\u00fb\u00fc\u0007"+
|
||||
"\u0001\u0000\u0000\u00fc\u00fd\u0007\t\u0000\u0000\u00fd.\u0001\u0000"+
|
||||
"\u0000\u0000\u00fe\u00ff\u0007\b\u0000\u0000\u00ff\u0100\u0007\u0005\u0000"+
|
||||
"\u0000\u0100\u0101\u0007\f\u0000\u0000\u01010\u0001\u0000\u0000\u0000"+
|
||||
"\u0102\u0103\u0007\u0000\u0000\u0000\u0103\u0104\u0007\u0013\u0000\u0000"+
|
||||
"\u0104\u0105\u0007\u000f\u0000\u0000\u01052\u0001\u0000\u0000\u0000\u0106"+
|
||||
"\u0107\u0007\f\u0000\u0000\u0107\u0108\u0007\u0014\u0000\u0000\u0108\u0109"+
|
||||
"\u0007\u0001\u0000\u0000\u01094\u0001\u0000\u0000\u0000\u010a\u010b\u0007"+
|
||||
"\f\u0000\u0000\u010b\u010c\u0007\u0000\u0000\u0000\u010c\u010d\u0007\u0016"+
|
||||
"\u0000\u0000\u010d6\u0001\u0000\u0000\u0000\u010e\u010f\u0007\b\u0000"+
|
||||
"\u0000\u010f\u0110\u0007\t\u0000\u0000\u0110\u0111\u0007\u0002\u0000\u0000"+
|
||||
"\u0111\u0112\u0007\u0002\u0000\u0000\u0112\u0113\u0007\u0007\u0000\u0000"+
|
||||
"\u0113\u0114\u0007\u0013\u0000\u0000\u01148\u0001\u0000\u0000\u0000\u0115"+
|
||||
"\u0116\u0007\b\u0000\u0000\u0116\u0117\u0007\t\u0000\u0000\u0117\u0118"+
|
||||
"\u0007\u0002\u0000\u0000\u0118\u0119\u0007\u0013\u0000\u0000\u0119\u011a"+
|
||||
"\u0007\u0000\u0000\u0000\u011a\u011b\u0007\u0004\u0000\u0000\u011b:\u0001"+
|
||||
"\u0000\u0000\u0000\u011c\u011d\u0007\u0013\u0000\u0000\u011d\u011e\u0007"+
|
||||
"\u0000\u0000\u0000\u011e\u011f\u0007\u0004\u0000\u0000\u011f\u0120\u0007"+
|
||||
"\u0014\u0000\u0000\u0120\u0121\u0007\u0000\u0000\u0000\u0121\u0122\u0007"+
|
||||
"\u0001\u0000\u0000\u0122\u0123\u0007\n\u0000\u0000\u0123\u0124\u0007\u0007"+
|
||||
"\u0000\u0000\u0124<\u0001\u0000\u0000\u0000\u0125\u0126\u0007\u0004\u0000"+
|
||||
"\u0000\u0126\u0127\u0007\u0000\u0000\u0000\u0127\u0128\u0007\t\u0000\u0000"+
|
||||
"\u0128\u0129\u0007\u0007\u0000\u0000\u0129>\u0001\u0000\u0000\u0000\u012a"+
|
||||
"\u012b\u0007\u0014\u0000\u0000\u012b\u012c\u0007\u0001\u0000\u0000\u012c"+
|
||||
"\u012d\u0007\n\u0000\u0000\u012d\u012e\u0007\u0004\u0000\u0000\u012e\u012f"+
|
||||
"\u0007\u0007\u0000\u0000\u012f\u0130\u0007\u0000\u0000\u0000\u0130\u0131"+
|
||||
"\u0007\b\u0000\u0000\u0131\u0132\u0007\u0007\u0000\u0000\u0132@\u0001"+
|
||||
"\u0000\u0000\u0000\u0133\u0134\u0007\u000e\u0000\u0000\u0134\u0135\u0007"+
|
||||
"\u0014\u0000\u0000\u0135\u0136\u0007\b\u0000\u0000\u0136\u0137\u0007\t"+
|
||||
"\u0000\u0000\u0137\u0138\u0007\u0003\u0000\u0000\u0138\u0139\u0007\u000f"+
|
||||
"\u0000\u0000\u0139\u013a\u0007\u0004\u0000\u0000\u013a\u013b\u0007\u0000"+
|
||||
"\u0000\u0000\u013b\u013c\u0007\f\u0000\u0000\u013c\u013d\u0005_\u0000"+
|
||||
"\u0000\u013d\u013e\u0007\u0017\u0000\u0000\u013e\u013f\u0007\u0005\u0000"+
|
||||
"\u0000\u013f\u0140\u0007\u0000\u0000\u0000\u0140\u0141\u0007\u0001\u0000"+
|
||||
"\u0000\u0141\u0142\u0007\t\u0000\u0000\u0142\u0143\u0007\u0014\u0000\u0000"+
|
||||
"\u0143\u0144\u0007\u0006\u0000\u0000\u0144\u0145\u0007\u0007\u0000\u0000"+
|
||||
"\u0145B\u0001\u0000\u0000\u0000\u0146\u0147\u0007\t\u0000\u0000\u0147"+
|
||||
"\u0148\u0007\u0003\u0000\u0000\u0148\u0149\u0007\u0010\u0000\u0000\u0149"+
|
||||
"\u014a\u0007\u0015\u0000\u0000\u014aD\u0001\u0000\u0000\u0000\u014b\u014c"+
|
||||
"\u0007\u0011\u0000\u0000\u014c\u014d\u0007\u0003\u0000\u0000\u014d\u014e"+
|
||||
"\u0007\t\u0000\u0000\u014e\u014f\u0007\t\u0000\u0000\u014f\u0150\u0007"+
|
||||
"\u0003\u0000\u0000\u0150\u0151\u0007\f\u0000\u0000\u0151\u0152\u0007\u0015"+
|
||||
"\u0000\u0000\u0152F\u0001\u0000\u0000\u0000\u0153\u0154\u0007\u0017\u0000"+
|
||||
"\u0000\u0154\u0155\u0007\u0005\u0000\u0000\u0155\u0156\u0007\u0000\u0000"+
|
||||
"\u0000\u0156\u0157\u0007\u0001\u0000\u0000\u0157\u0158\u0007\t\u0000\u0000"+
|
||||
"\u0158\u0159\u0007\u0014\u0000\u0000\u0159\u015a\u0007\u0006\u0000\u0000"+
|
||||
"\u015a\u015b\u0007\u0007\u0000\u0000\u015bH\u0001\u0000\u0000\u0000\u015c"+
|
||||
"\u015d\u0007\u0011\u0000\u0000\u015d\u015e\u0007\u0012\u0000\u0000\u015e"+
|
||||
"J\u0001\u0000\u0000\u0000\u015f\u0160\u0007\r\u0000\u0000\u0160\u0161"+
|
||||
"\u0007\u0014\u0000\u0000\u0161\u0162\u0007\t\u0000\u0000\u0162\u0163\u0007"+
|
||||
"\u000e\u0000\u0000\u0163\u0164\u0007\u0003\u0000\u0000\u0164\u0165\u0007"+
|
||||
"\u0005\u0000\u0000\u0165\u0166\u0007\t\u0000\u0000\u0166L\u0001\u0000"+
|
||||
"\u0000\u0000\u0167\u0168\u0007\u000f\u0000\u0000\u0168\u0169\u0007\u0004"+
|
||||
"\u0000\u0000\u0169\u016a\u0007\u0003\u0000\u0000\u016a\u016b\u0007\u0005"+
|
||||
"\u0000\u0000\u016b\u016c\u0007\u0010\u0000\u0000\u016c\u016d\u0005_\u0000"+
|
||||
"\u0000\u016d\u016e\u0007\u0006\u0000\u0000\u016e\u016f\u0007\u0007\u0000"+
|
||||
"\u0000\u016f\u0170\u0007\u000b\u0000\u0000\u0170\u0171\u0007\t\u0000\u0000"+
|
||||
"\u0171N\u0001\u0000\u0000\u0000\u0172\u0173\u0007\u000f\u0000\u0000\u0173"+
|
||||
"\u0174\u0007\u0004\u0000\u0000\u0174\u0175\u0007\u0003\u0000\u0000\u0175"+
|
||||
"\u0176\u0007\u0005\u0000\u0000\u0176\u0177\u0007\u0010\u0000\u0000\u0177"+
|
||||
"\u0178\u0005_\u0000\u0000\u0178\u0179\u0007\u0004\u0000\u0000\u0179\u017a"+
|
||||
"\u0007\u0014\u0000\u0000\u017a\u017b\u0007\u000f\u0000\u0000\u017b\u017c"+
|
||||
"\u0007\u000e\u0000\u0000\u017c\u017d\u0007\t\u0000\u0000\u017dP\u0001"+
|
||||
"\u0000\u0000\u0000\u017e\u017f\u0007\u0014\u0000\u0000\u017f\u0180\u0007"+
|
||||
"\u000f\u0000\u0000\u0180\u0181\u0007\u0001\u0000\u0000\u0181\u0182\u0007"+
|
||||
"\u0003\u0000\u0000\u0182\u0183\u0007\u0004\u0000\u0000\u0183\u0184\u0007"+
|
||||
"\u0014\u0000\u0000\u0184\u0185\u0007\u0001\u0000\u0000\u0185\u0186\u0007"+
|
||||
"\u000f\u0000\u0000\u0186R\u0001\u0000\u0000\u0000\u0187\u0188\u0007\u0003"+
|
||||
"\u0000\u0000\u0188\u0189\u0007\u0001\u0000\u0000\u0189T\u0001\u0000\u0000"+
|
||||
"\u0000\u018a\u018b\u0007\b\u0000\u0000\u018b\u018c\u0007\u0017\u0000\u0000"+
|
||||
"\u018c\u018d\u0007\u0006\u0000\u0000\u018dV\u0001\u0000\u0000\u0000\u018e"+
|
||||
"\u018f\u0007\u0010\u0000\u0000\u018f\u0190\u0007\u0004\u0000\u0000\u0190"+
|
||||
"\u0191\u0007\u0003\u0000\u0000\u0191\u0192\u0007\f\u0000\u0000\u0192\u0193"+
|
||||
"\u0007\u0017\u0000\u0000\u0193\u0194\u0007\u0006\u0000\u0000\u0194X\u0001"+
|
||||
"\u0000\u0000\u0000\u0195\u0196\u0005>\u0000\u0000\u0196Z\u0001\u0000\u0000"+
|
||||
"\u0000\u0197\u0198\u0005>\u0000\u0000\u0198\u0199\u0005=\u0000\u0000\u0199"+
|
||||
"\\\u0001\u0000\u0000\u0000\u019a\u019b\u0005<\u0000\u0000\u019b^\u0001"+
|
||||
"\u0000\u0000\u0000\u019c\u019d\u0005<\u0000\u0000\u019d\u019e\u0005=\u0000"+
|
||||
"\u0000\u019e`\u0001\u0000\u0000\u0000\u019f\u01a0\u0005=\u0000\u0000\u01a0"+
|
||||
"\u01a3\u0005=\u0000\u0000\u01a1\u01a3\u0005=\u0000\u0000\u01a2\u019f\u0001"+
|
||||
"\u0000\u0000\u0000\u01a2\u01a1\u0001\u0000\u0000\u0000\u01a3b\u0001\u0000"+
|
||||
"\u0000\u0000\u01a4\u01a5\u0005!\u0000\u0000\u01a5\u01a6\u0005=\u0000\u0000"+
|
||||
"\u01a6d\u0001\u0000\u0000\u0000\u01a7\u01a8\u0005(\u0000\u0000\u01a8f"+
|
||||
"\u0001\u0000\u0000\u0000\u01a9\u01aa\u0005)\u0000\u0000\u01aah\u0001\u0000"+
|
||||
"\u0000\u0000\u01ab\u01ac\u0005{\u0000\u0000\u01acj\u0001\u0000\u0000\u0000"+
|
||||
"\u01ad\u01ae\u0005}\u0000\u0000\u01ael\u0001\u0000\u0000\u0000\u01af\u01b0"+
|
||||
"\u0005[\u0000\u0000\u01b0n\u0001\u0000\u0000\u0000\u01b1\u01b2\u0005]"+
|
||||
"\u0000\u0000\u01b2p\u0001\u0000\u0000\u0000\u01b3\u01b4\u0005,\u0000\u0000"+
|
||||
"\u01b4r\u0001\u0000\u0000\u0000\u01b5\u01b6\u0005.\u0000\u0000\u01b6t"+
|
||||
"\u0001\u0000\u0000\u0000\u01b7\u01b8\u0005:\u0000\u0000\u01b8v\u0001\u0000"+
|
||||
"\u0000\u0000\u01b9\u01ba\u0005;\u0000\u0000\u01bax\u0001\u0000\u0000\u0000"+
|
||||
"\u01bb\u01bd\u0007\u0018\u0000\u0000\u01bc\u01bb\u0001\u0000\u0000\u0000"+
|
||||
"\u01bd\u01be\u0001\u0000\u0000\u0000\u01be\u01bc\u0001\u0000\u0000\u0000"+
|
||||
"\u01be\u01bf\u0001\u0000\u0000\u0000\u01bf\u01c6\u0001\u0000\u0000\u0000"+
|
||||
"\u01c0\u01c2\u0005.\u0000\u0000\u01c1\u01c3\u0007\u0018\u0000\u0000\u01c2"+
|
||||
"\u01c1\u0001\u0000\u0000\u0000\u01c3\u01c4\u0001\u0000\u0000\u0000\u01c4"+
|
||||
"\u01c2\u0001\u0000\u0000\u0000\u01c4\u01c5\u0001\u0000\u0000\u0000\u01c5"+
|
||||
"\u01c7\u0001\u0000\u0000\u0000\u01c6\u01c0\u0001\u0000\u0000\u0000\u01c6"+
|
||||
"\u01c7\u0001\u0000\u0000\u0000\u01c7\u01c8\u0001\u0000\u0000\u0000\u01c8"+
|
||||
"\u01ca\u0007\u0007\u0000\u0000\u01c9\u01cb\u0007\u0019\u0000\u0000\u01ca"+
|
||||
"\u01c9\u0001\u0000\u0000\u0000\u01ca\u01cb\u0001\u0000\u0000\u0000\u01cb"+
|
||||
"\u01cd\u0001\u0000\u0000\u0000\u01cc\u01ce\u0007\u0018\u0000\u0000\u01cd"+
|
||||
"\u01cc\u0001\u0000\u0000\u0000\u01ce\u01cf\u0001\u0000\u0000\u0000\u01cf"+
|
||||
"\u01cd\u0001\u0000\u0000\u0000\u01cf\u01d0\u0001\u0000\u0000\u0000\u01d0"+
|
||||
"z\u0001\u0000\u0000\u0000\u01d1\u01d3\u0007\u0018\u0000\u0000\u01d2\u01d1"+
|
||||
"\u0001\u0000\u0000\u0000\u01d3\u01d4\u0001\u0000\u0000\u0000\u01d4\u01d2"+
|
||||
"\u0001\u0000\u0000\u0000\u01d4\u01d5\u0001\u0000\u0000\u0000\u01d5\u01d6"+
|
||||
"\u0001\u0000\u0000\u0000\u01d6\u01d8\u0005.\u0000\u0000\u01d7\u01d9\u0007"+
|
||||
"\u0018\u0000\u0000\u01d8\u01d7\u0001\u0000\u0000\u0000\u01d9\u01da\u0001"+
|
||||
"\u0000\u0000\u0000\u01da\u01d8\u0001\u0000\u0000\u0000\u01da\u01db\u0001"+
|
||||
"\u0000\u0000\u0000\u01db|\u0001\u0000\u0000\u0000\u01dc\u01de\u0007\u0018"+
|
||||
"\u0000\u0000\u01dd\u01dc\u0001\u0000\u0000\u0000\u01de\u01df\u0001\u0000"+
|
||||
"\u0000\u0000\u01df\u01dd\u0001\u0000\u0000\u0000\u01df\u01e0\u0001\u0000"+
|
||||
"\u0000\u0000\u01e0~\u0001\u0000\u0000\u0000\u01e1\u01e3\u0007\u0018\u0000"+
|
||||
"\u0000\u01e2\u01e1\u0001\u0000\u0000\u0000\u01e3\u01e4\u0001\u0000\u0000"+
|
||||
"\u0000\u01e4\u01e2\u0001\u0000\u0000\u0000\u01e4\u01e5\u0001\u0000\u0000"+
|
||||
"\u0000\u01e5\u01e7\u0001\u0000\u0000\u0000\u01e6\u01e8\u0007\u001a\u0000"+
|
||||
"\u0000\u01e7\u01e6\u0001\u0000\u0000\u0000\u01e8\u01e9\u0001\u0000\u0000"+
|
||||
"\u0000\u01e9\u01e7\u0001\u0000\u0000\u0000\u01e9\u01ea\u0001\u0000\u0000"+
|
||||
"\u0000\u01ea\u0080\u0001\u0000\u0000\u0000\u01eb\u01f1\u0005\"\u0000\u0000"+
|
||||
"\u01ec\u01f0\b\u001b\u0000\u0000\u01ed\u01ee\u0005\\\u0000\u0000\u01ee"+
|
||||
"\u01f0\t\u0000\u0000\u0000\u01ef\u01ec\u0001\u0000\u0000\u0000\u01ef\u01ed"+
|
||||
"\u0001\u0000\u0000\u0000\u01f0\u01f3\u0001\u0000\u0000\u0000\u01f1\u01ef"+
|
||||
"\u0001\u0000\u0000\u0000\u01f1\u01f2\u0001\u0000\u0000\u0000\u01f2\u01f4"+
|
||||
"\u0001\u0000\u0000\u0000\u01f3\u01f1\u0001\u0000\u0000\u0000\u01f4\u0200"+
|
||||
"\u0005\"\u0000\u0000\u01f5\u01fb\u0005\'\u0000\u0000\u01f6\u01fa\b\u001c"+
|
||||
"\u0000\u0000\u01f7\u01f8\u0005\\\u0000\u0000\u01f8\u01fa\t\u0000\u0000"+
|
||||
"\u0000\u01f9\u01f6\u0001\u0000\u0000\u0000\u01f9\u01f7\u0001\u0000\u0000"+
|
||||
"\u0000\u01fa\u01fd\u0001\u0000\u0000\u0000\u01fb\u01f9\u0001\u0000\u0000"+
|
||||
"\u0000\u01fb\u01fc\u0001\u0000\u0000\u0000\u01fc\u01fe\u0001\u0000\u0000"+
|
||||
"\u0000\u01fd\u01fb\u0001\u0000\u0000\u0000\u01fe\u0200\u0005\'\u0000\u0000"+
|
||||
"\u01ff\u01eb\u0001\u0000\u0000\u0000\u01ff\u01f5\u0001\u0000\u0000\u0000"+
|
||||
"\u0200\u0082\u0001\u0000\u0000\u0000\u0201\u0205\u0007\u001d\u0000\u0000"+
|
||||
"\u0202\u0204\u0007\u001e\u0000\u0000\u0203\u0202\u0001\u0000\u0000\u0000"+
|
||||
"\u0204\u0207\u0001\u0000\u0000\u0000\u0205\u0203\u0001\u0000\u0000\u0000"+
|
||||
"\u0205\u0206\u0001\u0000\u0000\u0000\u0206\u0084\u0001\u0000\u0000\u0000"+
|
||||
"\u0207\u0205\u0001\u0000\u0000\u0000\u0208\u020a\u0007\u001f\u0000\u0000"+
|
||||
"\u0209\u0208\u0001\u0000\u0000\u0000\u020a\u020b\u0001\u0000\u0000\u0000"+
|
||||
"\u020b\u0209\u0001\u0000\u0000\u0000\u020b\u020c\u0001\u0000\u0000\u0000"+
|
||||
"\u020c\u020d\u0001\u0000\u0000\u0000\u020d\u020e\u0006B\u0000\u0000\u020e"+
|
||||
"\u0086\u0001\u0000\u0000\u0000\u020f\u0210\u0005/\u0000\u0000\u0210\u0211"+
|
||||
"\u0005/\u0000\u0000\u0211\u0215\u0001\u0000\u0000\u0000\u0212\u0214\b"+
|
||||
" \u0000\u0000\u0213\u0212\u0001\u0000\u0000\u0000\u0214\u0217\u0001\u0000"+
|
||||
"\u0000\u0000\u0215\u0213\u0001\u0000\u0000\u0000\u0215\u0216\u0001\u0000"+
|
||||
"\u0000\u0000\u0216\u0218\u0001\u0000\u0000\u0000\u0217\u0215\u0001\u0000"+
|
||||
"\u0000\u0000\u0218\u0219\u0006C\u0001\u0000\u0219\u0088\u0001\u0000\u0000"+
|
||||
"\u0000\u021a\u021b\u0005/\u0000\u0000\u021b\u021c\u0005*\u0000\u0000\u021c"+
|
||||
"\u0220\u0001\u0000\u0000\u0000\u021d\u021f\t\u0000\u0000\u0000\u021e\u021d"+
|
||||
"\u0001\u0000\u0000\u0000\u021f\u0222\u0001\u0000\u0000\u0000\u0220\u0221"+
|
||||
"\u0001\u0000\u0000\u0000\u0220\u021e\u0001\u0000\u0000\u0000\u0221\u0223"+
|
||||
"\u0001\u0000\u0000\u0000\u0222\u0220\u0001\u0000\u0000\u0000\u0223\u0224"+
|
||||
"\u0005*\u0000\u0000\u0224\u0225\u0005/\u0000\u0000\u0225\u0226\u0001\u0000"+
|
||||
"\u0000\u0000\u0226\u0227\u0006D\u0001\u0000\u0227\u008a\u0001\u0000\u0000"+
|
||||
"\u0000\u0015\u0000\u01a2\u01be\u01c4\u01c6\u01ca\u01cf\u01d4\u01da\u01df"+
|
||||
"\u01e4\u01e9\u01ef\u01f1\u01f9\u01fb\u01ff\u0205\u020b\u0215\u0220\u0002"+
|
||||
"\u0000\u0001\u0000\u0006\u0000\u0000";
|
||||
"\u0004\u0000\u000eZ\u0006\uffff\uffff\u0002\u0000\u0007\u0000\u0002\u0001"+
|
||||
"\u0007\u0001\u0002\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004"+
|
||||
"\u0007\u0004\u0002\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007"+
|
||||
"\u0007\u0007\u0002\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b"+
|
||||
"\u0007\u000b\u0002\f\u0007\f\u0002\r\u0007\r\u0001\u0000\u0001\u0000\u0001"+
|
||||
"\u0000\u0001\u0000\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0002\u0001"+
|
||||
"\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001"+
|
||||
"\u0003\u0001\u0003\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0005\u0001"+
|
||||
"\u0005\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0007\u0001\u0007\u0001"+
|
||||
"\u0007\u0001\b\u0001\b\u0001\b\u0001\t\u0001\t\u0001\n\u0001\n\u0001\u000b"+
|
||||
"\u0001\u000b\u0005\u000bB\b\u000b\n\u000b\f\u000bE\t\u000b\u0001\f\u0004"+
|
||||
"\fH\b\f\u000b\f\f\fI\u0001\f\u0001\f\u0004\fN\b\f\u000b\f\f\fO\u0003\f"+
|
||||
"R\b\f\u0001\r\u0004\rU\b\r\u000b\r\f\rV\u0001\r\u0001\r\u0000\u0000\u000e"+
|
||||
"\u0001\u0001\u0003\u0002\u0005\u0003\u0007\u0004\t\u0005\u000b\u0006\r"+
|
||||
"\u0007\u000f\b\u0011\t\u0013\n\u0015\u000b\u0017\f\u0019\r\u001b\u000e"+
|
||||
"\u0001\u0000\u0004\u0003\u0000AZ__az\n\u0000\"\"..09==A[]]__a{}}\u8000"+
|
||||
"\uff5e\u8000\uff5e\u0001\u000009\u0003\u0000\t\n\r\r ^\u0000\u0001\u0001"+
|
||||
"\u0000\u0000\u0000\u0000\u0003\u0001\u0000\u0000\u0000\u0000\u0005\u0001"+
|
||||
"\u0000\u0000\u0000\u0000\u0007\u0001\u0000\u0000\u0000\u0000\t\u0001\u0000"+
|
||||
"\u0000\u0000\u0000\u000b\u0001\u0000\u0000\u0000\u0000\r\u0001\u0000\u0000"+
|
||||
"\u0000\u0000\u000f\u0001\u0000\u0000\u0000\u0000\u0011\u0001\u0000\u0000"+
|
||||
"\u0000\u0000\u0013\u0001\u0000\u0000\u0000\u0000\u0015\u0001\u0000\u0000"+
|
||||
"\u0000\u0000\u0017\u0001\u0000\u0000\u0000\u0000\u0019\u0001\u0000\u0000"+
|
||||
"\u0000\u0000\u001b\u0001\u0000\u0000\u0000\u0001\u001d\u0001\u0000\u0000"+
|
||||
"\u0000\u0003!\u0001\u0000\u0000\u0000\u0005$\u0001\u0000\u0000\u0000\u0007"+
|
||||
"+\u0001\u0000\u0000\u0000\t-\u0001\u0000\u0000\u0000\u000b0\u0001\u0000"+
|
||||
"\u0000\u0000\r2\u0001\u0000\u0000\u0000\u000f5\u0001\u0000\u0000\u0000"+
|
||||
"\u00118\u0001\u0000\u0000\u0000\u0013;\u0001\u0000\u0000\u0000\u0015="+
|
||||
"\u0001\u0000\u0000\u0000\u0017?\u0001\u0000\u0000\u0000\u0019G\u0001\u0000"+
|
||||
"\u0000\u0000\u001bT\u0001\u0000\u0000\u0000\u001d\u001e\u0005a\u0000\u0000"+
|
||||
"\u001e\u001f\u0005n\u0000\u0000\u001f \u0005d\u0000\u0000 \u0002\u0001"+
|
||||
"\u0000\u0000\u0000!\"\u0005o\u0000\u0000\"#\u0005r\u0000\u0000#\u0004"+
|
||||
"\u0001\u0000\u0000\u0000$%\u0005u\u0000\u0000%&\u0005n\u0000\u0000&\'"+
|
||||
"\u0005l\u0000\u0000\'(\u0005e\u0000\u0000()\u0005s\u0000\u0000)*\u0005"+
|
||||
"s\u0000\u0000*\u0006\u0001\u0000\u0000\u0000+,\u0005>\u0000\u0000,\b\u0001"+
|
||||
"\u0000\u0000\u0000-.\u0005>\u0000\u0000./\u0005=\u0000\u0000/\n\u0001"+
|
||||
"\u0000\u0000\u000001\u0005<\u0000\u00001\f\u0001\u0000\u0000\u000023\u0005"+
|
||||
"<\u0000\u000034\u0005=\u0000\u00004\u000e\u0001\u0000\u0000\u000056\u0005"+
|
||||
"=\u0000\u000067\u0005=\u0000\u00007\u0010\u0001\u0000\u0000\u000089\u0005"+
|
||||
"!\u0000\u00009:\u0005=\u0000\u0000:\u0012\u0001\u0000\u0000\u0000;<\u0005"+
|
||||
"(\u0000\u0000<\u0014\u0001\u0000\u0000\u0000=>\u0005)\u0000\u0000>\u0016"+
|
||||
"\u0001\u0000\u0000\u0000?C\u0007\u0000\u0000\u0000@B\u0007\u0001\u0000"+
|
||||
"\u0000A@\u0001\u0000\u0000\u0000BE\u0001\u0000\u0000\u0000CA\u0001\u0000"+
|
||||
"\u0000\u0000CD\u0001\u0000\u0000\u0000D\u0018\u0001\u0000\u0000\u0000"+
|
||||
"EC\u0001\u0000\u0000\u0000FH\u0007\u0002\u0000\u0000GF\u0001\u0000\u0000"+
|
||||
"\u0000HI\u0001\u0000\u0000\u0000IG\u0001\u0000\u0000\u0000IJ\u0001\u0000"+
|
||||
"\u0000\u0000JQ\u0001\u0000\u0000\u0000KM\u0005.\u0000\u0000LN\u0007\u0002"+
|
||||
"\u0000\u0000ML\u0001\u0000\u0000\u0000NO\u0001\u0000\u0000\u0000OM\u0001"+
|
||||
"\u0000\u0000\u0000OP\u0001\u0000\u0000\u0000PR\u0001\u0000\u0000\u0000"+
|
||||
"QK\u0001\u0000\u0000\u0000QR\u0001\u0000\u0000\u0000R\u001a\u0001\u0000"+
|
||||
"\u0000\u0000SU\u0007\u0003\u0000\u0000TS\u0001\u0000\u0000\u0000UV\u0001"+
|
||||
"\u0000\u0000\u0000VT\u0001\u0000\u0000\u0000VW\u0001\u0000\u0000\u0000"+
|
||||
"WX\u0001\u0000\u0000\u0000XY\u0006\r\u0000\u0000Y\u001c\u0001\u0000\u0000"+
|
||||
"\u0000\u0006\u0000CIOQV\u0001\u0006\u0000\u0000";
|
||||
public static final ATN _ATN =
|
||||
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
|
||||
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
|
||||
static {
|
||||
_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
|
||||
for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
|
||||
|
||||
+192
-2738
File diff suppressed because it is too large
Load Diff
+16
-229
@@ -39,15 +39,23 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code AndExpr}
|
||||
* labeled alternative in {@link AlertExpressionParser#expr}.
|
||||
* labeled alternative in AlertExpressionParser#expr
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitAndExpr(AlertExpressionParser.AndExprContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code QueryExpr}
|
||||
* labeled alternative in AlertExpressionParser#expr
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitQueryExpr(AlertExpressionParser.QueryExprContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code ComparisonExpr}
|
||||
* labeled alternative in {@link AlertExpressionParser#expr}.
|
||||
* labeled alternative in AlertExpressionParser#expr
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
@@ -55,31 +63,15 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code UnlessExpr}
|
||||
* labeled alternative in {@link AlertExpressionParser#expr}.
|
||||
* labeled alternative in AlertExpressionParser#expr
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitUnlessExpr(AlertExpressionParser.UnlessExprContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code SqlExpr}
|
||||
* labeled alternative in {@link AlertExpressionParser#expr}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitSqlExpr(AlertExpressionParser.SqlExprContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code SqlCallExpr}
|
||||
* labeled alternative in {@link AlertExpressionParser#expr}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitSqlCallExpr(AlertExpressionParser.SqlCallExprContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code LiteralExpr}
|
||||
* labeled alternative in {@link AlertExpressionParser#expr}.
|
||||
* labeled alternative in AlertExpressionParser#expr
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
@@ -87,56 +79,26 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code ParenExpr}
|
||||
* labeled alternative in {@link AlertExpressionParser#expr}.
|
||||
* labeled alternative in AlertExpressionParser#expr
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitParenExpr(AlertExpressionParser.ParenExprContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code PromqlCallExpr}
|
||||
* labeled alternative in {@link AlertExpressionParser#expr}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitPromqlCallExpr(AlertExpressionParser.PromqlCallExprContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code PromqlExpr}
|
||||
* labeled alternative in {@link AlertExpressionParser#expr}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitPromqlExpr(AlertExpressionParser.PromqlExprContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code OrExpr}
|
||||
* labeled alternative in {@link AlertExpressionParser#expr}.
|
||||
* labeled alternative in AlertExpressionParser#expr
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitOrExpr(AlertExpressionParser.OrExprContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#functionCall}.
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#identifier}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitFunctionCall(AlertExpressionParser.FunctionCallContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#parameterList}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitParameterList(AlertExpressionParser.ParameterListContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#parameter}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitParameter(AlertExpressionParser.ParameterContext ctx);
|
||||
T visitIdentifier(AlertExpressionParser.IdentifierContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#number}.
|
||||
@@ -144,179 +106,4 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitNumber(AlertExpressionParser.NumberContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#string}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitString(AlertExpressionParser.StringContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#duration}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitDuration(AlertExpressionParser.DurationContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#functionName}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitFunctionName(AlertExpressionParser.FunctionNameContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#selectSql}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitSelectSql(AlertExpressionParser.SelectSqlContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#selectFieldList}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitSelectFieldList(AlertExpressionParser.SelectFieldListContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#selectField}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitSelectField(AlertExpressionParser.SelectFieldContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#groupByList}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitGroupByList(AlertExpressionParser.GroupByListContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#orderByList}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitOrderByList(AlertExpressionParser.OrderByListContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#orderByField}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitOrderByField(AlertExpressionParser.OrderByFieldContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#limitClause}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitLimitClause(AlertExpressionParser.LimitClauseContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#relList}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitRelList(AlertExpressionParser.RelListContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#relation}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitRelation(AlertExpressionParser.RelationContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#conditionList}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitConditionList(AlertExpressionParser.ConditionListContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#compOp}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitCompOp(AlertExpressionParser.CompOpContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#condition}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitCondition(AlertExpressionParser.ConditionContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#conditionUnit}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitConditionUnit(AlertExpressionParser.ConditionUnitContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#promql}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitPromql(AlertExpressionParser.PromqlContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#metricSelector}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitMetricSelector(AlertExpressionParser.MetricSelectorContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#labelMatcherList}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitLabelMatcherList(AlertExpressionParser.LabelMatcherListContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#labelMatcherItem}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitLabelMatcherItem(AlertExpressionParser.LabelMatcherItemContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#labelMatcherOp}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitLabelMatcherOp(AlertExpressionParser.LabelMatcherOpContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#labelList}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitLabelList(AlertExpressionParser.LabelListContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#instantVectorOp}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitInstantVectorOp(AlertExpressionParser.InstantVectorOpContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#aggregationOperator}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitAggregationOperator(AlertExpressionParser.AggregationOperatorContext ctx);
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by {@link AlertExpressionParser#binaryOperator}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitBinaryOperator(AlertExpressionParser.BinaryOperatorContext ctx);
|
||||
}
|
||||
-185
@@ -1,185 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.alert.service.impl;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.hertzbeat.alert.dto.AlibabaCloudSlsExternAlert;
|
||||
import org.apache.hertzbeat.alert.reduce.AlarmCommonReduce;
|
||||
import org.apache.hertzbeat.alert.service.ExternAlertService;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.entity.alerter.SingleAlert;
|
||||
import org.apache.hertzbeat.common.util.IpDomainUtil;
|
||||
import org.apache.hertzbeat.common.util.JsonUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Alibaba Cloud 'Simple Log Service(SLS)' external alarm service impl
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class AlibabaCloudSlsExternAlertService implements ExternAlertService {
|
||||
|
||||
private final AlarmCommonReduce alarmCommonReduce;
|
||||
|
||||
public AlibabaCloudSlsExternAlertService(AlarmCommonReduce alarmCommonReduce) {
|
||||
this.alarmCommonReduce = alarmCommonReduce;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addExternAlert(String content) {
|
||||
AlibabaCloudSlsExternAlert externAlert = JsonUtil.fromJson(content, AlibabaCloudSlsExternAlert.class);
|
||||
if (externAlert == null) {
|
||||
log.warn("Failure to parse external alert content. content: {}", content);
|
||||
return;
|
||||
}
|
||||
SingleAlert singleAlert = new AlibabaCloudSlsConverter().convert(externAlert);
|
||||
alarmCommonReduce.reduceAndSendAlarm(singleAlert);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String supportSource() {
|
||||
return "alibabacloud-sls";
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static class AlibabaCloudSlsConverter {
|
||||
|
||||
/**
|
||||
* convert
|
||||
*
|
||||
* @param externAlert alert content entity
|
||||
* @return Single alert
|
||||
*/
|
||||
public SingleAlert convert(AlibabaCloudSlsExternAlert externAlert) {
|
||||
return SingleAlert.builder()
|
||||
.triggerTimes(1)
|
||||
.status(externAlert.getStatus())
|
||||
.startAt(Instant.ofEpochSecond(externAlert.getFireTime()).toEpochMilli())
|
||||
.activeAt(Instant.ofEpochSecond(externAlert.getAlertTime()).toEpochMilli())
|
||||
.endAt(convertResolveTime(externAlert.getStatus(), externAlert.getResolveTime()))
|
||||
.labels(buildLabels(externAlert))
|
||||
.annotations(buildAnnotations(externAlert))
|
||||
.content(formatContent(externAlert))
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* todo i18n
|
||||
*
|
||||
* @param externAlert alert content entity
|
||||
* @return content
|
||||
*/
|
||||
private String formatContent(AlibabaCloudSlsExternAlert externAlert) {
|
||||
// convet severity
|
||||
Optional<AlibabaCloudSlsExternAlert.Severity> severity = AlibabaCloudSlsExternAlert.Severity.convert(externAlert.getSeverity());
|
||||
// If the alarm state is resolved, the value is the specific recovery time.
|
||||
Long resolveTimeMilli = convertResolveTime(externAlert.getStatus(), externAlert.getResolveTime());
|
||||
|
||||
return MessageFormat.format(
|
||||
"AlibabaCloud-sls alert , {0} - [{1}], level: [{2}], desc: {3}, fire_time:{4}, resolve_time:{5}",
|
||||
externAlert.getAnnotation("title"),
|
||||
externAlert.getStatus(),
|
||||
severity.isPresent() ? severity.get().getAlias() : "N/A",
|
||||
externAlert.getAnnotation("desc"),
|
||||
timeSecondToDate(Instant.ofEpochSecond(externAlert.getFireTime()).toEpochMilli()),
|
||||
null != resolveTimeMilli ? timeSecondToDate(resolveTimeMilli) : "N/A"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a timestamp (milliseconds) to a formatted date-time string.
|
||||
*
|
||||
* @param timestampMillis timestamp in milliseconds
|
||||
* @return formatted date-time string in the pattern: yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
private String timeSecondToDate(long timestampMillis) {
|
||||
LocalDateTime dateTime = LocalDateTime.ofInstant(
|
||||
Instant.ofEpochMilli(timestampMillis),
|
||||
ZoneId.systemDefault()
|
||||
);
|
||||
return dateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Build basic annotations and fill annotations for alibaba cloud sls.
|
||||
*
|
||||
* @param externAlert alert content entity
|
||||
* @return annotations
|
||||
*/
|
||||
private Map<String, String> buildAnnotations(AlibabaCloudSlsExternAlert externAlert) {
|
||||
Map<String, String> annotations = new HashMap<>(8);
|
||||
Optional<AlibabaCloudSlsExternAlert.Severity> severity = AlibabaCloudSlsExternAlert.Severity.convert(externAlert.getSeverity());
|
||||
severity.ifPresent(value -> annotations.put("severity", value.getAlias()));
|
||||
// Notification templates for sls need to be configured.
|
||||
if (StringUtils.isNotBlank(externAlert.getSigninUrl()) && IpDomainUtil.isHasSchema(externAlert.getSigninUrl())) {
|
||||
annotations.put("signinUrl", "<a target=\"_blank\" href=\"" + externAlert.getSigninUrl() + "\">View Details</a>");
|
||||
}
|
||||
// Filling the annotations with the alibaba cloud sls.
|
||||
if (null != externAlert.getAnnotations() && !externAlert.getAnnotations().isEmpty()) {
|
||||
annotations.putAll(externAlert.getAnnotations());
|
||||
}
|
||||
|
||||
return annotations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build basic labels and fill labels for alibaba cloud sls.
|
||||
*
|
||||
* @param externAlert alert content entity
|
||||
* @return labels
|
||||
*/
|
||||
private Map<String, String> buildLabels(AlibabaCloudSlsExternAlert externAlert) {
|
||||
Map<String, String> labels = new HashMap<>(8);
|
||||
labels.put("__source__", "alibabacloud-sls");
|
||||
labels.put("alertname", externAlert.getAlertName());
|
||||
labels.put("region", externAlert.getRegion());
|
||||
// The project name is globally unique.
|
||||
labels.put("project", externAlert.getProject());
|
||||
// Filling the labels with the alibaba cloud sls.
|
||||
if (null != externAlert.getLabels() && !externAlert.getLabels().isEmpty()){
|
||||
labels.putAll(externAlert.getLabels());
|
||||
}
|
||||
return labels;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the alarm status is firing, the value is 0.
|
||||
* If the alarm state is resolved, the value is the specific recovery time.
|
||||
*
|
||||
* @param status alert status
|
||||
* @param resolveTimeSecond recovery time
|
||||
* @return milliseconds
|
||||
*/
|
||||
private Long convertResolveTime(String status, int resolveTimeSecond) {
|
||||
return CommonConstants.ALERT_STATUS_RESOLVED.equals(status) ? Instant.ofEpochSecond(resolveTimeSecond).toEpochMilli() : null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+6
-4
@@ -87,10 +87,12 @@ public class DataSourceServiceImpl implements DataSourceService {
|
||||
}
|
||||
|
||||
private List<Map<String, Object>> evaluate(String expr, QueryExecutor executor) {
|
||||
CommonTokenStream tokens = tokenStreamCache.get(expr, this::createTokenStream);
|
||||
AlertExpressionParser parser = new AlertExpressionParser(tokens);
|
||||
ParseTree tree = expressionCache.get(expr, e -> parser.expr());
|
||||
AlertExpressionEvalVisitor visitor = new AlertExpressionEvalVisitor(executor, tokens);
|
||||
ParseTree tree = expressionCache.get(expr, e -> {
|
||||
CommonTokenStream tokens = tokenStreamCache.get(e, this::createTokenStream);
|
||||
AlertExpressionParser parser = new AlertExpressionParser(tokens);
|
||||
return parser.expr();
|
||||
});
|
||||
AlertExpressionEvalVisitor visitor = new AlertExpressionEvalVisitor(executor);
|
||||
return visitor.visit(tree);
|
||||
|
||||
}
|
||||
|
||||
-343
@@ -1,343 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.alert.service.impl;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.hertzbeat.alert.dto.HuaweiCloudExternAlert;
|
||||
import org.apache.hertzbeat.alert.reduce.AlarmCommonReduce;
|
||||
import org.apache.hertzbeat.alert.service.ExternAlertService;
|
||||
import org.apache.hertzbeat.alert.util.DateUtil;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.entity.alerter.SingleAlert;
|
||||
import org.apache.hertzbeat.common.support.exception.IgnoreException;
|
||||
import org.apache.hertzbeat.common.util.JsonUtil;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.Signature;
|
||||
import java.security.cert.CertificateFactory;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.text.MessageFormat;
|
||||
import java.time.Instant;
|
||||
import java.util.Base64;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.apache.hertzbeat.alert.dto.HuaweiCloudExternAlert.AlertType.NOTIFICATION;
|
||||
import static org.apache.hertzbeat.alert.dto.HuaweiCloudExternAlert.AlertType.SUBSCRIPTION;
|
||||
import static org.apache.hertzbeat.alert.dto.HuaweiCloudExternAlert.AlertType.UNSUBSCRIBE;
|
||||
import static org.apache.hertzbeat.alert.dto.HuaweiCloudExternAlert.FIELD_MESSAGE;
|
||||
import static org.apache.hertzbeat.alert.dto.HuaweiCloudExternAlert.FIELD_MESSAGE_ID;
|
||||
import static org.apache.hertzbeat.alert.dto.HuaweiCloudExternAlert.FIELD_SUBJECT;
|
||||
import static org.apache.hertzbeat.alert.dto.HuaweiCloudExternAlert.FIELD_SUBSCRIBE_URL;
|
||||
import static org.apache.hertzbeat.alert.dto.HuaweiCloudExternAlert.FIELD_TIMESTAMP;
|
||||
import static org.apache.hertzbeat.alert.dto.HuaweiCloudExternAlert.FIELD_TOPIC_URN;
|
||||
import static org.apache.hertzbeat.alert.dto.HuaweiCloudExternAlert.FIELD_TYPE;
|
||||
|
||||
/**
|
||||
* Huawei cloud external alarm service impl
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class HuaweiCloudExternAlertService implements ExternAlertService {
|
||||
|
||||
private static final String CERTIFICATE_TYPE = "X.509";
|
||||
|
||||
private static final String CHARSET_UTF8 = StandardCharsets.UTF_8.name();
|
||||
|
||||
private final AlarmCommonReduce alarmCommonReduce;
|
||||
|
||||
public HuaweiCloudExternAlertService(AlarmCommonReduce alarmCommonReduce) {
|
||||
this.alarmCommonReduce = alarmCommonReduce;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addExternAlert(String content) {
|
||||
HuaweiCloudExternAlert externAlert = JsonUtil.fromJson(content, HuaweiCloudExternAlert.class);
|
||||
if (externAlert == null || StringUtils.isBlank(externAlert.getMessage())) {
|
||||
log.warn("Failure to parse external alert content. content: {}", content);
|
||||
return;
|
||||
}
|
||||
if (!isMessageValid(externAlert)) {
|
||||
log.warn("Huawei cloud alert verify failed. content: {}", content);
|
||||
return;
|
||||
}
|
||||
process(externAlert);
|
||||
}
|
||||
|
||||
/**
|
||||
* Process according to different types
|
||||
*
|
||||
* @param externAlert alert content entity
|
||||
*/
|
||||
private void process(HuaweiCloudExternAlert externAlert) {
|
||||
if (NOTIFICATION.getType().equals(externAlert.getType())) {
|
||||
Optional.ofNullable(buildSendAlert(externAlert)).ifPresent(alarmCommonReduce::reduceAndSendAlarm);
|
||||
} else if (SUBSCRIPTION.getType().equals(externAlert.getType())) {
|
||||
autoSubscribeForUrl(externAlert.getSubscribeUrl());
|
||||
} else if (UNSUBSCRIBE.getType().equals(externAlert.getType())) {
|
||||
log.warn("Huawei cloud notifies the recipient of the notification to cancel the subscription.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build single alert.
|
||||
*
|
||||
* @param externAlert alert content entity
|
||||
* @return single alert
|
||||
*/
|
||||
private SingleAlert buildSendAlert(HuaweiCloudExternAlert externAlert) {
|
||||
HuaweiCloudExternAlert.AlertMessage message = JsonUtil.fromJson(externAlert.getMessage(), HuaweiCloudExternAlert.AlertMessage.class);
|
||||
if (null == message || null == message.getData()) {
|
||||
log.warn("Failure to parse external alert message. message: {}", externAlert.getMessage());
|
||||
return null;
|
||||
}
|
||||
// Note: Empty and false are both recovery notifications.
|
||||
// Note: There are no recovery notifications for event types
|
||||
boolean isAlarm = null != message.getData().getAlarm() && message.getData().getAlarm();
|
||||
Long alarmTime = DateUtil.getZonedTimeStampFromFormat(message.getData().getAlarmTime(), "yyyy/MM/dd HH:mm:ss 'GMT'XXX");
|
||||
return SingleAlert.builder()
|
||||
.triggerTimes(1)
|
||||
.status(isAlarm ? CommonConstants.ALERT_STATUS_FIRING : CommonConstants.ALERT_STATUS_RESOLVED)
|
||||
.startAt(alarmTime)
|
||||
.activeAt(Instant.now().toEpochMilli())
|
||||
.endAt(isAlarm ? null : alarmTime)
|
||||
.labels(buildLabels(message.getData()))
|
||||
.annotations(buildAnnotations(message.getData()))
|
||||
.content(formatContent(externAlert.getSubject(), message.getData()))
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Build basic annotations and fill annotations for huawei cloud.
|
||||
*
|
||||
* @param alertData alert content entity
|
||||
* @return annotations
|
||||
*/
|
||||
private Map<String, String> buildAnnotations(HuaweiCloudExternAlert.AlertData alertData) {
|
||||
Map<String, String> annotations = new HashMap<>(8);
|
||||
if (null != alertData) {
|
||||
putIfNotBlank(annotations, "region", alertData.getRegion());
|
||||
putIfNotBlank(annotations, "dimensionName", alertData.getDimensionName());
|
||||
putIfNotBlank(annotations, "resourceName", alertData.getResourceName());
|
||||
putIfNotBlank(annotations, "alarmRecordId", alertData.getAlarmRecordId());
|
||||
}
|
||||
return annotations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build basic labels and fill labels for huawei cloud.
|
||||
*
|
||||
* @param alertData alert content entity
|
||||
* @return labels
|
||||
*/
|
||||
private Map<String, String> buildLabels(HuaweiCloudExternAlert.AlertData alertData) {
|
||||
Map<String, String> labels = new HashMap<>(8);
|
||||
labels.put("__source__", "huaweicloud-ces");
|
||||
if (null != alertData) {
|
||||
putIfNotBlank(labels, "namespace", alertData.getNamespace());
|
||||
putIfNotBlank(labels, "metricName", alertData.getMetricName());
|
||||
putIfNotBlank(labels, "resourceId", alertData.getResourceId());
|
||||
putIfNotBlank(labels, "level", alertData.getAlarmLevel());
|
||||
}
|
||||
return labels;
|
||||
}
|
||||
|
||||
/**
|
||||
* todo i18n
|
||||
*
|
||||
* @param subject alert subject
|
||||
* @param alertData alert content entity
|
||||
* @return content
|
||||
*/
|
||||
private String formatContent(String subject, HuaweiCloudExternAlert.AlertData alertData) {
|
||||
if (null == alertData) {
|
||||
return subject;
|
||||
}
|
||||
return MessageFormat.format(
|
||||
"{0} threshold:{1}{2}, current:{3}",
|
||||
subject,
|
||||
alertData.getComparisonOperator(),
|
||||
alertData.getValue(),
|
||||
alertData.getCurrentData()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Automatic subscription url.
|
||||
*
|
||||
* @param subscribeUrl subscribeUrl
|
||||
*/
|
||||
public void autoSubscribeForUrl(String subscribeUrl) {
|
||||
if (StringUtils.isBlank(subscribeUrl)) {
|
||||
return;
|
||||
}
|
||||
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
|
||||
HttpGet httpGet = new HttpGet(subscribeUrl);
|
||||
try (CloseableHttpResponse response = httpClient.execute(httpGet)) {
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
String responseBody = EntityUtils.toString(response.getEntity());
|
||||
|
||||
if (statusCode != 200) {
|
||||
log.error("Subscribe url request failed with status code: " + statusCode + ", response: " + responseBody);
|
||||
return;
|
||||
}
|
||||
JsonNode jsonResponse = JsonUtil.fromJson(responseBody);
|
||||
if (jsonResponse == null) {
|
||||
throw new IgnoreException("Subscribe url failed with status code: " + statusCode + ", response: " + responseBody);
|
||||
}
|
||||
JsonNode surnNode = jsonResponse.get("subscription_urn");
|
||||
if (surnNode == null || StringUtils.isBlank(surnNode.asText())) {
|
||||
throw new IgnoreException("Subscribe url failed with status code: " + statusCode + ", response: " + responseBody);
|
||||
}
|
||||
log.info("Successfully subscribed to Huawei Cloud(SMN) url.");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to subscribe url request: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifying the signature of huawei cloud alert message.
|
||||
*
|
||||
* @param externAlert alert content entity
|
||||
* @return verification result
|
||||
* @throws SecurityException thrown when validation fails
|
||||
*/
|
||||
private boolean isMessageValid(HuaweiCloudExternAlert externAlert) {
|
||||
try {
|
||||
String signMessage = buildSignMessage(externAlert);
|
||||
if (StringUtils.isBlank(signMessage)) {
|
||||
throw new SecurityException("Verify sign message is null");
|
||||
}
|
||||
X509Certificate cert = getCertificate(externAlert.getSigningCertUrl());
|
||||
return verifySignature(signMessage, cert, externAlert.getSignature());
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to verify message signature: ", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build sign message.
|
||||
*
|
||||
* @param externAlert alert content entity
|
||||
* @return sign message
|
||||
*/
|
||||
private String buildSignMessage(HuaweiCloudExternAlert externAlert) {
|
||||
if (NOTIFICATION.getType().equals(externAlert.getType())) {
|
||||
return buildNotificationMessage(externAlert);
|
||||
} else if (SUBSCRIPTION.getType().equals(externAlert.getType()) || UNSUBSCRIBE.getType().equals(externAlert.getType())){
|
||||
return buildSubscriptionMessage(externAlert);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Building sign message of 'Notification' type
|
||||
*
|
||||
* @param externAlert alert content entity
|
||||
* @return sign message
|
||||
*/
|
||||
private String buildNotificationMessage(HuaweiCloudExternAlert externAlert) {
|
||||
StringBuilder message = new StringBuilder();
|
||||
appendField(message, FIELD_MESSAGE, externAlert.getMessage());
|
||||
appendField(message, FIELD_MESSAGE_ID, externAlert.getMessageId());
|
||||
if (StringUtils.isNotBlank(externAlert.getSubject())) {
|
||||
appendField(message, FIELD_SUBJECT, externAlert.getSubject());
|
||||
}
|
||||
appendField(message, FIELD_TIMESTAMP, externAlert.getTimestamp());
|
||||
appendField(message, FIELD_TOPIC_URN, externAlert.getTopicUrn());
|
||||
appendField(message, FIELD_TYPE, externAlert.getType());
|
||||
return message.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Building sign message of 'SubscriptionConfirmation' or 'UnsubscribeConfirmation' type
|
||||
*
|
||||
* @param externAlert alert content entity
|
||||
* @return sign message
|
||||
*/
|
||||
private String buildSubscriptionMessage(HuaweiCloudExternAlert externAlert) {
|
||||
StringBuilder message = new StringBuilder();
|
||||
appendField(message, FIELD_MESSAGE, externAlert.getMessage());
|
||||
appendField(message, FIELD_MESSAGE_ID, externAlert.getMessageId());
|
||||
appendField(message, FIELD_SUBSCRIBE_URL, externAlert.getSubscribeUrl());
|
||||
appendField(message, FIELD_TIMESTAMP, externAlert.getTimestamp());
|
||||
appendField(message, FIELD_TOPIC_URN, externAlert.getTopicUrn());
|
||||
appendField(message, FIELD_TYPE, externAlert.getType());
|
||||
return message.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain certificate
|
||||
*
|
||||
* @param signCertUrl sign cert url
|
||||
* @return X509 certificate
|
||||
* @throws Exception Thrown when certificate acquisition fails
|
||||
*/
|
||||
private X509Certificate getCertificate(String signCertUrl) throws Exception {
|
||||
URL url = new URL(signCertUrl);
|
||||
try (InputStream in = url.openStream()) {
|
||||
CertificateFactory cf = CertificateFactory.getInstance(CERTIFICATE_TYPE);
|
||||
return (X509Certificate) cf.generateCertificate(in);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify signature
|
||||
*
|
||||
* @param message sign message
|
||||
* @param cert cert
|
||||
* @param signature signature
|
||||
* @return verification result
|
||||
* @throws Exception thrown when an error occurs in the validation process
|
||||
*/
|
||||
private boolean verifySignature(String message, X509Certificate cert, String signature) throws Exception {
|
||||
Signature sig = Signature.getInstance(cert.getSigAlgName());
|
||||
sig.initVerify(cert.getPublicKey());
|
||||
sig.update(message.getBytes(CHARSET_UTF8));
|
||||
return sig.verify(Base64.getDecoder().decode(signature));
|
||||
}
|
||||
|
||||
private void putIfNotBlank(Map<String, String> map, String key, String value) {
|
||||
if (StringUtils.isNotBlank(value)){
|
||||
map.put(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
private void appendField(StringBuilder builder, String fieldName, String value) {
|
||||
builder.append(fieldName).append("\n").append(value).append("\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String supportSource() {
|
||||
return "huaweicloud-ces";
|
||||
}
|
||||
|
||||
}
|
||||
-244
@@ -1,244 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.alert.service.impl;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.hertzbeat.alert.dto.VolcEngineExternEventAlert;
|
||||
import org.apache.hertzbeat.alert.dto.VolcEngineExternMetricAlert;
|
||||
import org.apache.hertzbeat.alert.reduce.AlarmCommonReduce;
|
||||
import org.apache.hertzbeat.alert.service.ExternAlertService;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.entity.alerter.SingleAlert;
|
||||
import org.apache.hertzbeat.common.util.JsonUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Volcengine alarm entity class
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class VolcEngineExternAlertService implements ExternAlertService {
|
||||
|
||||
private final AlarmCommonReduce alarmCommonReduce;
|
||||
private static final Map<String, Integer> severityOrder = Map.of(
|
||||
CommonConstants.ALERT_SEVERITY_CRITICAL, 1,
|
||||
CommonConstants.ALERT_SEVERITY_WARNING, 2,
|
||||
CommonConstants.ALERT_SEVERITY_INFO, 3
|
||||
);
|
||||
|
||||
@Override
|
||||
@SneakyThrows
|
||||
public void addExternAlert(String content) {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode root = mapper.readTree(content);
|
||||
String type = root.get("Type").asText();
|
||||
if (VolcEngineExternMetricAlert.ALERT_TYPE_EVENT.equals(type)) {
|
||||
VolcEngineExternEventAlert eventAlert = JsonUtil.fromJson(content, VolcEngineExternEventAlert.class);
|
||||
if (eventAlert == null) {
|
||||
log.warn("parse extern event alert content failed! content: {}", content);
|
||||
return;
|
||||
}
|
||||
SingleAlert singleAlert = new VolcEngineAlertConverter().convertEventToSingleAlert(eventAlert);
|
||||
alarmCommonReduce.reduceAndSendAlarm(singleAlert);
|
||||
|
||||
} else {
|
||||
// deal with metric alert
|
||||
VolcEngineExternMetricAlert report = JsonUtil.fromJson(content, VolcEngineExternMetricAlert.class);
|
||||
if (report == null) {
|
||||
log.warn("parse extern metrics alert content failed! content: {}", content);
|
||||
return;
|
||||
}
|
||||
for (SingleAlert singleAlert : new VolcEngineAlertConverter().convertMetricAlertToSingeAlert(report)) {
|
||||
alarmCommonReduce.reduceAndSendAlarm(singleAlert);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String supportSource() {
|
||||
return "volcengine";
|
||||
}
|
||||
|
||||
/**
|
||||
* Converter: VolcEngine alert to SingleAlert
|
||||
*/
|
||||
public static class VolcEngineAlertConverter {
|
||||
|
||||
/**
|
||||
* Convert VolcEngine metric alert to SingleAlert List
|
||||
*/
|
||||
public List<SingleAlert> convertMetricAlertToSingeAlert(VolcEngineExternMetricAlert alert) {
|
||||
String status = convertStatus(alert);
|
||||
if (Objects.equals(alert.getType(), VolcEngineExternMetricAlert.ALERT_TYPE_METRIC)) {
|
||||
return convertMetricAlert(alert, status, alert.getResources());
|
||||
}
|
||||
if (Objects.equals(alert.getType(), VolcEngineExternMetricAlert.ALERT_TYPE_METRICS_NODATA)) {
|
||||
return convertMetricAlert(alert, status, alert.getNoDataResources());
|
||||
}
|
||||
if (Objects.equals(alert.getType(), VolcEngineExternMetricAlert.ALERT_TYPE_NO_DATA_RECOVERED)) {
|
||||
return convertMetricAlert(alert, status, alert.getNoDataRecoveredResources());
|
||||
}
|
||||
if (Objects.equals(alert.getType(), VolcEngineExternMetricAlert.ALERT_TYPE_METRIC_RECOVERED)) {
|
||||
return convertMetricAlert(alert, status, alert.getRecoveredResources());
|
||||
}
|
||||
return List.of();
|
||||
}
|
||||
|
||||
public SingleAlert convertEventToSingleAlert(VolcEngineExternEventAlert alert) {
|
||||
SingleAlert.SingleAlertBuilder builder = SingleAlert.builder()
|
||||
.status(CommonConstants.ALERT_STATUS_FIRING)
|
||||
.startAt(alert.getHappenedAt() * 1000)
|
||||
.activeAt(alert.getHappenedAt() * 1000)
|
||||
.labels(buildEventLabels(alert))
|
||||
.content(alert.getDescriptionCn())
|
||||
.annotations(new HashMap<>());
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* build labels for volcengine event alert
|
||||
*/
|
||||
private Map<String, String> buildEventLabels(VolcEngineExternEventAlert event) {
|
||||
Map<String, String> labels = new HashMap<>();
|
||||
labels.put("severity", convertEventSeverity(event));
|
||||
labels.put("__source__", "volcengine");
|
||||
labels.put("resource_name", event.getDetails().getVolcResourceName());
|
||||
labels.put("account_id", event.getAccountId());
|
||||
labels.put("region", event.getRegion());
|
||||
labels.put("event_type", event.getEventType());
|
||||
labels.put("source", event.getSource());
|
||||
return labels;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* convert volcengine event alert status to heartbeat alert status
|
||||
* use the most severe level in the rules
|
||||
*
|
||||
* @param alert volcengine event alert
|
||||
* @return status
|
||||
*/
|
||||
private String convertEventSeverity(VolcEngineExternEventAlert alert) {
|
||||
return alert.getRules().stream().map(VolcEngineExternEventAlert.EventRule::getLevel)
|
||||
.min((o1, o2) -> severityOrder.get(convertCommonSeverity(o1)).compareTo(severityOrder.get(convertCommonSeverity(o2))))
|
||||
.orElse(CommonConstants.ALERT_SEVERITY_INFO);
|
||||
}
|
||||
|
||||
private String convertCommonSeverity(String level) {
|
||||
return switch (level) {
|
||||
case "critical" -> CommonConstants.ALERT_SEVERITY_CRITICAL;
|
||||
case "warning" -> CommonConstants.ALERT_SEVERITY_WARNING;
|
||||
default -> CommonConstants.ALERT_SEVERITY_INFO;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* create SingleAlert for each resources in volcengine alert
|
||||
*
|
||||
* @param alert volcengine alert
|
||||
* @param status status
|
||||
* @param resources resources
|
||||
* @return List of SingleAlert
|
||||
*/
|
||||
private List<SingleAlert> convertMetricAlert(VolcEngineExternMetricAlert alert, String status,
|
||||
List<? extends VolcEngineExternMetricAlert.Resource> resources) {
|
||||
if (CollectionUtils.isEmpty(resources)) {
|
||||
return List.of();
|
||||
}
|
||||
List<SingleAlert> result = new ArrayList<>();
|
||||
for (VolcEngineExternMetricAlert.Resource resource : resources) {
|
||||
SingleAlert.SingleAlertBuilder builder = SingleAlert.builder()
|
||||
.status(status)
|
||||
.startAt(resource.getFirstAlertTime() * 1000)
|
||||
.endAt(resource.getLastAlertTime() * 1000)
|
||||
.labels(buildLabels(alert, resource))
|
||||
.activeAt(convertHappenAt(alert.getHappenedAt()))
|
||||
.content(resource.getName() + alert.getRuleCondition())
|
||||
.annotations(buildAnnotations(resource));
|
||||
result.add(builder.build());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private Long convertHappenAt(String happenAt) {
|
||||
String cleanedStr = happenAt.replace("UTC", "").replace("(", "").replace(")", "");
|
||||
DateTimeFormatter altFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ssXXX");
|
||||
OffsetDateTime odt = OffsetDateTime.parse(cleanedStr, altFormatter);
|
||||
return odt.toEpochSecond() * 1000;
|
||||
}
|
||||
|
||||
private Map<String, String> buildLabels(VolcEngineExternMetricAlert alert, VolcEngineExternMetricAlert.Resource resource) {
|
||||
Map<String, String> labels = new HashMap<>();
|
||||
labels.put("__source__", "volcengine");
|
||||
labels.put("resource_name", resource.getName());
|
||||
labels.put("resource_id", resource.getId());
|
||||
labels.put("rule_id", alert.getRuleId());
|
||||
return labels;
|
||||
}
|
||||
|
||||
private Map<String, String> buildAnnotations(VolcEngineExternMetricAlert.Resource resource) {
|
||||
Map<String, String> annotations = new HashMap<>();
|
||||
if (resource instanceof VolcEngineExternMetricAlert.NoDataResource noDataResource) {
|
||||
for (VolcEngineExternMetricAlert.Metric noDataMetric : noDataResource.getNoDataMetrics()) {
|
||||
annotations.put(noDataMetric.getName(), "N/A");
|
||||
}
|
||||
}
|
||||
for (VolcEngineExternMetricAlert.Metric metric : resource.getMetrics()) {
|
||||
annotations.put(metric.getName(), metric.getCurrentValue() + metric.getUnit());
|
||||
}
|
||||
annotations.put("region", resource.getRegion());
|
||||
List<VolcEngineExternMetricAlert.Dimension> dimensions = resource.getDimensions();
|
||||
if (CollectionUtils.isNotEmpty(dimensions)) {
|
||||
for (VolcEngineExternMetricAlert.Dimension dimension : dimensions) {
|
||||
annotations.put(dimension.getNameCn(), dimension.getValue());
|
||||
}
|
||||
}
|
||||
return annotations;
|
||||
}
|
||||
|
||||
/**
|
||||
* convert volcengine alert status to heartbeat alert status
|
||||
*
|
||||
* @param alert volcengine alert
|
||||
* @return status
|
||||
*/
|
||||
private String convertStatus(VolcEngineExternMetricAlert alert) {
|
||||
String type = alert.getType();
|
||||
if (Objects.equals(type, VolcEngineExternMetricAlert.ALERT_TYPE_METRIC)
|
||||
|| Objects.equals(type, VolcEngineExternMetricAlert.ALERT_TYPE_EVENT)
|
||||
|| Objects.equals(type, VolcEngineExternMetricAlert.ALERT_TYPE_METRICS_NODATA)) {
|
||||
return CommonConstants.ALERT_STATUS_FIRING;
|
||||
}
|
||||
return CommonConstants.ALERT_STATUS_RESOLVED;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,6 @@ package org.apache.hertzbeat.alert.util;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.DateTimeFormatterBuilder;
|
||||
import java.util.Optional;
|
||||
@@ -81,19 +80,4 @@ public final class DateUtil {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* convert format data to timestamp
|
||||
*/
|
||||
public static Long getZonedTimeStampFromFormat(String dateStr, String format) {
|
||||
try {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format);
|
||||
// the parsed zoned date-time, not null
|
||||
return ZonedDateTime.parse(dateStr, formatter).toInstant().toEpochMilli();
|
||||
} catch (Exception e) {
|
||||
log.error("Error parsing date '{}' with format '{}': {}",
|
||||
dateStr, format, e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,273 +22,36 @@ expression
|
||||
;
|
||||
|
||||
expr
|
||||
: LPAREN expr RPAREN # ParenExpr
|
||||
| left=expr op=(GE|LE|GT|LT|EQ|NE) right=expr # ComparisonExpr
|
||||
| left=expr AND right=expr # AndExpr
|
||||
| left=expr UNLESS right=expr # UnlessExpr
|
||||
| left=expr OR right=expr # OrExpr
|
||||
| promql # PromqlExpr
|
||||
| selectSql # SqlExpr
|
||||
| number # LiteralExpr
|
||||
| SQL_FUNCTION LPAREN string RPAREN # SqlCallExpr
|
||||
| PROMQL_FUNCTION LPAREN string RPAREN # PromqlCallExpr
|
||||
;
|
||||
|
||||
functionCall
|
||||
: functionName LPAREN parameterList RPAREN
|
||||
;
|
||||
|
||||
parameterList
|
||||
: parameter (COMMA parameter)*
|
||||
;
|
||||
|
||||
parameter
|
||||
: expr
|
||||
| STAR
|
||||
| string
|
||||
| duration
|
||||
;
|
||||
|
||||
number
|
||||
: NUMBER
|
||||
| FLOAT
|
||||
| SCIENTIFIC_NUMBER
|
||||
;
|
||||
|
||||
string
|
||||
: STRING
|
||||
;
|
||||
|
||||
duration
|
||||
: DURATION
|
||||
;
|
||||
|
||||
functionName
|
||||
: COUNT
|
||||
| AVG
|
||||
| SUM
|
||||
| MIN
|
||||
| MAX
|
||||
| RATE_FUNCTION
|
||||
| INCREASE_FUNCTION
|
||||
| HISTOGRAM_QUANTILE_FUNCTION
|
||||
| BY_FUNCTION
|
||||
| WITHOUT_FUNCTION
|
||||
| GROUP_LEFT_FUNCTION
|
||||
| GROUP_RIGHT_FUNCTION
|
||||
| IGNORING_FUNCTION
|
||||
| ON_FUNCTION
|
||||
| IDENTIFIER
|
||||
;
|
||||
|
||||
// SQL grammar for complex queries
|
||||
selectSql
|
||||
: SELECT selectFieldList FROM relList (WHERE conditionList)?
|
||||
(GROUP BY groupByList)? (HAVING conditionList)?
|
||||
(ORDER BY orderByList)? (LIMIT limitClause)?
|
||||
;
|
||||
|
||||
selectFieldList
|
||||
: selectField (COMMA selectField)*
|
||||
;
|
||||
|
||||
selectField
|
||||
: functionCall (AS? IDENTIFIER)?
|
||||
| IDENTIFIER (AS? IDENTIFIER)?
|
||||
| STAR (AS? IDENTIFIER)?
|
||||
| IDENTIFIER DOT IDENTIFIER (AS? IDENTIFIER)?
|
||||
;
|
||||
|
||||
groupByList
|
||||
: IDENTIFIER (COMMA IDENTIFIER)*
|
||||
;
|
||||
|
||||
orderByList
|
||||
: orderByField (COMMA orderByField)*
|
||||
;
|
||||
|
||||
orderByField
|
||||
: IDENTIFIER (ASC | DESC)?
|
||||
| functionCall (ASC | DESC)?
|
||||
;
|
||||
|
||||
limitClause
|
||||
: NUMBER
|
||||
;
|
||||
|
||||
relList
|
||||
: relation (COMMA relation)*
|
||||
;
|
||||
|
||||
relation
|
||||
: IDENTIFIER (AS? IDENTIFIER)?
|
||||
| LPAREN selectSql RPAREN AS IDENTIFIER
|
||||
;
|
||||
|
||||
conditionList
|
||||
: conditionList AND conditionList
|
||||
| conditionList OR conditionList
|
||||
| condition
|
||||
| LPAREN conditionList RPAREN
|
||||
;
|
||||
|
||||
compOp
|
||||
: EQ | LT | GT | LE | GE | NE | LIKE | NOT LIKE | IN | NOT IN | IS | IS NOT
|
||||
;
|
||||
|
||||
condition
|
||||
: conditionUnit compOp conditionUnit
|
||||
| LPAREN condition RPAREN
|
||||
| IDENTIFIER BETWEEN number AND number
|
||||
;
|
||||
|
||||
conditionUnit
|
||||
: number
|
||||
| string
|
||||
| IDENTIFIER
|
||||
| IDENTIFIER DOT IDENTIFIER
|
||||
| NULL
|
||||
| LPAREN selectSql RPAREN
|
||||
| functionCall
|
||||
;
|
||||
|
||||
// PromQL query expressions
|
||||
promql
|
||||
: metricSelector instantVectorOp?
|
||||
| aggregationOperator LPAREN promql (BY labelList)? RPAREN
|
||||
| promql binaryOperator promql
|
||||
| functionCall
|
||||
| promql LBRACKET duration RBRACKET
|
||||
| promql LBRACKET duration COLON duration RBRACKET
|
||||
| promql OFFSET duration
|
||||
| IDENTIFIER
|
||||
;
|
||||
|
||||
metricSelector
|
||||
: LBRACE labelMatcherList? RBRACE
|
||||
;
|
||||
|
||||
labelMatcherList
|
||||
: labelMatcherItem (COMMA labelMatcherItem)*
|
||||
;
|
||||
|
||||
labelMatcherItem
|
||||
: IDENTIFIER labelMatcherOp string
|
||||
;
|
||||
|
||||
labelMatcherOp
|
||||
: EQ | NE
|
||||
;
|
||||
|
||||
labelList
|
||||
: LPAREN IDENTIFIER (COMMA IDENTIFIER)* RPAREN
|
||||
;
|
||||
|
||||
instantVectorOp
|
||||
: LBRACKET duration RBRACKET
|
||||
;
|
||||
|
||||
aggregationOperator
|
||||
: SUM | AVG | COUNT | MIN | MAX | STDDEV | STDVAR | TOPK | BOTTOMK | QUANTILE
|
||||
;
|
||||
|
||||
binaryOperator
|
||||
: EQ | NE | GT | LT | GE | LE
|
||||
| AND | OR | UNLESS
|
||||
: '(' expr ')' # ParenExpr
|
||||
| left=expr op=('>='|'<='|'>'|'<'|'=='|'!=') right=expr # ComparisonExpr
|
||||
| left=expr 'and' right=expr # AndExpr
|
||||
| left=expr 'unless' right=expr # UnlessExpr
|
||||
| left=expr 'or' right=expr # OrExpr
|
||||
| identifier # QueryExpr
|
||||
| number # LiteralExpr
|
||||
;
|
||||
|
||||
// Lexer rules
|
||||
|
||||
// Boolean operators
|
||||
AND : [Aa][Nn][Dd] ;
|
||||
OR : [Oo][Rr] ;
|
||||
UNLESS : [Uu][Nn][Ll][Ee][Ss][Ss] ;
|
||||
NOT : [Nn][Oo][Tt] ;
|
||||
|
||||
// SQL keywords
|
||||
SELECT : [Ss][Ee][Ll][Ee][Cc][Tt] ;
|
||||
FROM : [Ff][Rr][Oo][Mm] ;
|
||||
WHERE : [Ww][Hh][Ee][Rr][Ee] ;
|
||||
GROUP : [Gg][Rr][Oo][Uu][Pp] ;
|
||||
BY : [Bb][Yy] ;
|
||||
HAVING : [Hh][Aa][Vv][Ii][Nn][Gg] ;
|
||||
ORDER : [Oo][Rr][Dd][Ee][Rr] ;
|
||||
LIMIT : [Ll][Ii][Mm][Ii][Tt] ;
|
||||
OFFSET : [Oo][Ff][Ff][Ss][Ee][Tt] ;
|
||||
AS : [Aa][Ss] ;
|
||||
ASC : [Aa][Ss][Cc] ;
|
||||
DESC : [Dd][Ee][Ss][Cc] ;
|
||||
IN : [Ii][Nn] ;
|
||||
IS : [Ii][Ss] ;
|
||||
NULL : [Nn][Uu][Ll][Ll] ;
|
||||
LIKE : [Ll][Ii][Kk][Ee] ;
|
||||
BETWEEN : [Bb][Ee][Tt][Ww][Ee][Ee][Nn] ;
|
||||
STAR : '*' ;
|
||||
|
||||
// Aggregate functions
|
||||
COUNT : [Cc][Oo][Uu][Nn][Tt] ;
|
||||
SUM : [Ss][Uu][Mm] ;
|
||||
AVG : [Aa][Vv][Gg] ;
|
||||
MIN : [Mm][Ii][Nn] ;
|
||||
MAX : [Mm][Aa][Xx] ;
|
||||
STDDEV : [Ss][Tt][Dd][Dd][Ee][Vv] ;
|
||||
STDVAR : [Ss][Tt][Dd][Vv][Aa][Rr] ;
|
||||
VARIANCE: [Vv][Aa][Rr][Ii][Aa][Nn][Cc][Ee] ;
|
||||
|
||||
// PromQL specific functions
|
||||
RATE_FUNCTION : [Rr][Aa][Tt][Ee] ;
|
||||
INCREASE_FUNCTION: [Ii][Nn][Cc][Rr][Ee][Aa][Ss][Ee] ;
|
||||
HISTOGRAM_QUANTILE_FUNCTION: [Hh][Ii][Ss][Tt][Oo][Gg][Rr][Aa][Mm] '_' [Qq][Uu][Aa][Nn][Tt][Ii][Ll][Ee] ;
|
||||
TOPK : [Tt][Oo][Pp][Kk] ;
|
||||
BOTTOMK : [Bb][Oo][Tt][Tt][Oo][Mm][Kk] ;
|
||||
QUANTILE: [Qq][Uu][Aa][Nn][Tt][Ii][Ll][Ee] ;
|
||||
BY_FUNCTION: [Bb][Yy] ;
|
||||
WITHOUT_FUNCTION: [Ww][Ii][Tt][Hh][Oo][Uu][Tt] ;
|
||||
GROUP_LEFT_FUNCTION: [Gg][Rr][Oo][Uu][Pp] '_' [Ll][Ee][Ff][Tt] ;
|
||||
GROUP_RIGHT_FUNCTION: [Gg][Rr][Oo][Uu][Pp] '_' [Rr][Ii][Gg][Hh][Tt] ;
|
||||
IGNORING_FUNCTION: [Ii][Gg][Nn][Oo][Rr][Ii][Nn][Gg] ;
|
||||
ON_FUNCTION: [Oo][Nn] ;
|
||||
|
||||
// Other functions
|
||||
SQL_FUNCTION: [Ss][Qq][Ll] ;
|
||||
PROMQL_FUNCTION: [Pp][Rr][Oo][Mm][Qq][Ll] ;
|
||||
|
||||
// Comparison operators
|
||||
AND : 'and' ;
|
||||
OR : 'or' ;
|
||||
UNLESS : 'unless' ;
|
||||
GT : '>' ;
|
||||
GE : '>=' ;
|
||||
LT : '<' ;
|
||||
LE : '<=' ;
|
||||
EQ : '==' | '=' ;
|
||||
EQ : '==' ;
|
||||
NE : '!=' ;
|
||||
|
||||
// Delimiters
|
||||
LPAREN : '(' ;
|
||||
RPAREN : ')' ;
|
||||
LBRACE : '{' ;
|
||||
RBRACE : '}' ;
|
||||
LBRACKET: '[' ;
|
||||
RBRACKET: ']' ;
|
||||
COMMA : ',' ;
|
||||
DOT : '.' ;
|
||||
COLON : ':' ;
|
||||
SEMICOLON: ';' ;
|
||||
|
||||
// number formats
|
||||
SCIENTIFIC_NUMBER: [0-9]+ ('.' [0-9]+)? [eE] [+-]? [0-9]+ ;
|
||||
FLOAT : [0-9]+ '.' [0-9]+ ;
|
||||
NUMBER : [0-9]+ ;
|
||||
identifier
|
||||
: IDENTIFIER
|
||||
;
|
||||
|
||||
// Duration literals for PromQL (e.g., 5m, 1h, 30s)
|
||||
DURATION : [0-9]+ [a-zA-Z]+ ;
|
||||
number
|
||||
: NUMBER
|
||||
;
|
||||
|
||||
// String literals
|
||||
STRING : '"' (~["\r\n\\] | '\\' .)* '"'
|
||||
| '\'' (~['\r\n\\] | '\\' .)* '\'' ;
|
||||
|
||||
// Identifiers and metric names
|
||||
IDENTIFIER : [a-zA-Z_] [a-zA-Z0-9_=~{}[\]".~-]* ;
|
||||
|
||||
// Whitespace and comments
|
||||
WS : [ \t\r\n]+ -> channel(HIDDEN) ;
|
||||
LINE_COMMENT : '//' ~[\r\n]* -> skip ;
|
||||
BLOCK_COMMENT : '/*' .*? '*/' -> skip ;
|
||||
IDENTIFIER : [a-zA-Z_] [a-zA-Z0-9_=~{}[\]".]*;
|
||||
NUMBER : [0-9]+ ('.' [0-9]+)? ;
|
||||
WS : [ \t\r\n]+ -> skip ;
|
||||
-251
@@ -1,251 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.alert.calculate;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.hertzbeat.alert.AlerterWorkerPool;
|
||||
import org.apache.hertzbeat.alert.dao.SingleAlertDao;
|
||||
import org.apache.hertzbeat.alert.reduce.AlarmCommonReduce;
|
||||
import org.apache.hertzbeat.alert.service.AlertDefineService;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.constants.MetricDataConstants;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.queue.CommonDataQueue;
|
||||
import org.apache.hertzbeat.common.queue.impl.InMemoryCommonDataQueue;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class RealTimeAlertCalculatorMatchTest {
|
||||
|
||||
private final AlerterWorkerPool workerPool = new AlerterWorkerPool();
|
||||
|
||||
@Mock
|
||||
private CommonDataQueue dataQueue = new InMemoryCommonDataQueue();
|
||||
|
||||
@Mock
|
||||
private AlertDefineService alertDefineService;
|
||||
|
||||
@Mock
|
||||
private SingleAlertDao singleAlertDao;
|
||||
|
||||
@Mock
|
||||
private AlarmCommonReduce alarmCommonReduce;
|
||||
|
||||
@Mock
|
||||
private AlarmCacheManager alarmCacheManager;
|
||||
|
||||
private RealTimeAlertCalculator realTimeAlertCalculator;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
MockitoAnnotations.openMocks(this);
|
||||
when(singleAlertDao.querySingleAlertsByStatus(any())).thenReturn(new ArrayList<>());
|
||||
realTimeAlertCalculator = new RealTimeAlertCalculator(
|
||||
workerPool,
|
||||
dataQueue,
|
||||
alertDefineService,
|
||||
singleAlertDao,
|
||||
alarmCommonReduce,
|
||||
alarmCacheManager,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFilterThresholdsByAppAndMetrics_withInstanceExpr_HasSpace() {
|
||||
|
||||
String app = "redis";
|
||||
String instanceId = "501045327364864";
|
||||
int priority = 0;
|
||||
|
||||
AlertDefine matchDefine = new AlertDefine();
|
||||
matchDefine.setExpr("equals(__app__,\"redis\") && equals(__instance__, \"501045327364864\")");
|
||||
|
||||
AlertDefine unmatchDefine = new AlertDefine();
|
||||
unmatchDefine.setExpr("equals(__app__,\"redis\") && equals(__instance__, \"999999999\")");
|
||||
|
||||
List<AlertDefine> allDefines = Collections.singletonList(matchDefine);
|
||||
|
||||
List<AlertDefine> filtered = realTimeAlertCalculator.filterThresholdsByAppAndMetrics(allDefines, app, "", Map.of(), instanceId, priority);
|
||||
|
||||
// It should filter out 999999999.
|
||||
assertEquals(1, filtered.size());
|
||||
assertEquals("equals(__app__,\"redis\") && equals(__instance__, \"501045327364864\")",
|
||||
filtered.get(0).getExpr());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testPrometheusReplaceMultipleJobsApp() throws InterruptedException {
|
||||
CollectRep.MetricsData.Builder builder = CollectRep.MetricsData.newBuilder();
|
||||
builder.setId(518789738974464L)
|
||||
.setApp("_prometheus_Cool_Stingray_34Nj_copy")
|
||||
.setMetrics("canal_instance")
|
||||
.setPriority(0)
|
||||
.setCode(CollectRep.Code.SUCCESS);
|
||||
|
||||
CollectRep.Field destination = CollectRep.Field.newBuilder().setName("destination").setType(CommonConstants.TYPE_STRING).setLabel(true).build();
|
||||
CollectRep.Field mode = CollectRep.Field.newBuilder().setName("mode").setType(CommonConstants.TYPE_STRING).setLabel(true).build();
|
||||
CollectRep.Field metricValue = CollectRep.Field.newBuilder().setName("metric_value").setType(CommonConstants.TYPE_NUMBER).setLabel(true).build();
|
||||
|
||||
Map<String, String> meta = new HashMap<>();
|
||||
meta.put(MetricDataConstants.INSTANCE_NAME, "Cool_Stingray_34Nj_copy");
|
||||
meta.put(MetricDataConstants.INSTANCE_HOST, "127.0.0.1");
|
||||
|
||||
builder.addMetadataAll(meta);
|
||||
builder.addAllFields(Lists.newArrayList(destination, mode, metricValue));
|
||||
builder.addValueRow(CollectRep.ValueRow.newBuilder().addColumn("example").addColumn("spring").addColumn("1.0").build());
|
||||
|
||||
CollectRep.MetricsData metricsData = builder.build();
|
||||
|
||||
|
||||
AlertDefine matchDefine = new AlertDefine();
|
||||
matchDefine.setName("test");
|
||||
matchDefine.setExpr(
|
||||
"equals(__app__,\"prometheus\") && "
|
||||
+ "equals(__metrics__,\"canal_instance\") && "
|
||||
+ "(equals(__instance__, \"515224274242816\") or equals(__instance__, \"518789738974464\")) && "
|
||||
+ "metric_value > 0"
|
||||
);
|
||||
matchDefine.setTemplate("Canal instance val: ${value}%");
|
||||
matchDefine.setTimes(1);
|
||||
|
||||
List<AlertDefine> allDefines = Collections.singletonList(matchDefine);
|
||||
|
||||
when(alertDefineService.getRealTimeAlertDefines()).thenReturn(allDefines);
|
||||
when(dataQueue.pollMetricsDataToAlerter()).thenReturn(metricsData).thenThrow(new InterruptedException());
|
||||
|
||||
realTimeAlertCalculator.startCalculate();
|
||||
|
||||
Thread.sleep(3000);
|
||||
|
||||
verify(alarmCacheManager, times(1)).getPending(any());
|
||||
verify(alarmCacheManager, times(1)).putFiring(any(), any());
|
||||
verify(alarmCommonReduce, times(1)).reduceAndSendAlarm(any());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testPrometheusReplaceApp() throws InterruptedException {
|
||||
CollectRep.MetricsData.Builder builder = CollectRep.MetricsData.newBuilder();
|
||||
builder.setId(1)
|
||||
.setApp("_prometheus_Cool_Stingray_34Nj")
|
||||
.setMetrics("canal_instance")
|
||||
.setPriority(0)
|
||||
.setCode(CollectRep.Code.SUCCESS);
|
||||
|
||||
CollectRep.Field destination = CollectRep.Field.newBuilder().setName("destination").setType(CommonConstants.TYPE_STRING).setLabel(true).build();
|
||||
CollectRep.Field mode = CollectRep.Field.newBuilder().setName("mode").setType(CommonConstants.TYPE_STRING).setLabel(true).build();
|
||||
CollectRep.Field metricValue = CollectRep.Field.newBuilder().setName("metric_value").setType(CommonConstants.TYPE_NUMBER).setLabel(true).build();
|
||||
|
||||
Map<String, String> meta = new HashMap<>();
|
||||
meta.put(MetricDataConstants.INSTANCE_NAME, "Cool_Stingray_34Nj");
|
||||
meta.put(MetricDataConstants.INSTANCE_HOST, "127.0.0.1");
|
||||
|
||||
builder.addMetadataAll(meta);
|
||||
builder.addAllFields(Lists.newArrayList(destination, mode, metricValue));
|
||||
builder.addValueRow(CollectRep.ValueRow.newBuilder().addColumn("example").addColumn("spring").addColumn("1.0").build());
|
||||
|
||||
CollectRep.MetricsData metricsData = builder.build();
|
||||
|
||||
AlertDefine matchDefine = new AlertDefine();
|
||||
matchDefine.setName("test");
|
||||
matchDefine.setExpr("equals(__app__,\"prometheus\") && equals(__metrics__,\"canal_instance\") && metric_value > 0");
|
||||
matchDefine.setTemplate("Canal instance val: ${value}%");
|
||||
matchDefine.setTimes(1);
|
||||
|
||||
List<AlertDefine> allDefines = Collections.singletonList(matchDefine);
|
||||
|
||||
when(alertDefineService.getRealTimeAlertDefines()).thenReturn(allDefines);
|
||||
when(dataQueue.pollMetricsDataToAlerter()).thenReturn(metricsData).thenThrow(new InterruptedException());
|
||||
|
||||
realTimeAlertCalculator.startCalculate();
|
||||
|
||||
Thread.sleep(3000);
|
||||
|
||||
verify(alarmCacheManager, times(1)).getPending(any());
|
||||
verify(alarmCacheManager, times(1)).putFiring(any(), any());
|
||||
verify(alarmCommonReduce, times(1)).reduceAndSendAlarm(any());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCalculateWithNormalApp() throws InterruptedException {
|
||||
CollectRep.MetricsData.Builder builder = CollectRep.MetricsData.newBuilder();
|
||||
builder.setId(1)
|
||||
.setApp("springboot3")
|
||||
.setMetrics("available")
|
||||
.setPriority(0)
|
||||
.setCode(CollectRep.Code.SUCCESS)
|
||||
.setTenantId(0).setId(518679137103104L)
|
||||
.setTime(1749110170834L)
|
||||
.setPriority(0);
|
||||
|
||||
CollectRep.Field responseTime = CollectRep.Field.newBuilder()
|
||||
.setName("responseTime")
|
||||
.setType(CommonConstants.TYPE_STRING)
|
||||
.setUnit("ms")
|
||||
.setLabel(false)
|
||||
.build();
|
||||
|
||||
Map<String, String> meta = new HashMap<>();
|
||||
meta.put(MetricDataConstants.INSTANCE_NAME, "Vibrant_Gazelle_83vJ");
|
||||
meta.put(MetricDataConstants.INSTANCE_HOST, "127.0.0.1");
|
||||
|
||||
builder.addMetadataAll(meta);
|
||||
builder.addAllFields(Lists.newArrayList(responseTime));
|
||||
builder.addValueRow(CollectRep.ValueRow.newBuilder().addColumn("18").build());
|
||||
|
||||
CollectRep.MetricsData metricsData = builder.build();
|
||||
|
||||
AlertDefine matchDefine = new AlertDefine();
|
||||
matchDefine.setName("test");
|
||||
matchDefine.setExpr("equals(__app__,\"springboot3\") && equals(__metrics__,\"available\") && equals(__instance__, \"518679137103104\") && responseTime > 0");
|
||||
matchDefine.setTemplate("Canal instance val: ${value}%");
|
||||
matchDefine.setTimes(1);
|
||||
|
||||
List<AlertDefine> allDefines = Collections.singletonList(matchDefine);
|
||||
|
||||
when(alertDefineService.getRealTimeAlertDefines()).thenReturn(allDefines);
|
||||
when(dataQueue.pollMetricsDataToAlerter()).thenReturn(metricsData).thenThrow(new InterruptedException());
|
||||
|
||||
realTimeAlertCalculator.startCalculate();
|
||||
|
||||
Thread.sleep(3000);
|
||||
|
||||
verify(alarmCacheManager, times(1)).getPending(any());
|
||||
verify(alarmCacheManager, times(1)).putFiring(any(), any());
|
||||
verify(alarmCommonReduce, times(1)).reduceAndSendAlarm(any());
|
||||
}
|
||||
|
||||
}
|
||||
+4
-414
@@ -38,130 +38,76 @@ import static org.mockito.Mockito.when;
|
||||
class AlertExpressionEvalVisitorTest {
|
||||
|
||||
private QueryExecutor mockExecutor;
|
||||
private AlertExpressionEvalVisitor visitor;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
mockExecutor = Mockito.mock(QueryExecutor.class);
|
||||
visitor = new AlertExpressionEvalVisitor(mockExecutor);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGreaterThan() {
|
||||
when(mockExecutor.execute("cpu")).thenReturn(List.of(new HashMap<>(Map.of("__value__", 80.0))));
|
||||
when(mockExecutor.execute("select cpu from cpu_table where id = 1")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 80.0))));
|
||||
// promql
|
||||
List<Map<String, Object>> result = evaluate("cpu > 70");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(80.0, result.get(0).get("__value__"));
|
||||
//sql
|
||||
result = evaluate("(select cpu from cpu_table where id = 1) > 70");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(80.0, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGreaterThanWithInteger() {
|
||||
when(mockExecutor.execute("cpu")).thenReturn(List.of(new HashMap<>(Map.of("__value__", 80))));
|
||||
when(mockExecutor.execute("select cpu_usage from system_metrics where host = 'server1'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 80))));
|
||||
// promql
|
||||
List<Map<String, Object>> result = evaluate("cpu > 70");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(80, result.get(0).get("__value__"));
|
||||
// sql
|
||||
result = evaluate("(select cpu_usage from system_metrics where host = 'server1') > 70");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(80, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testLessThan() {
|
||||
when(mockExecutor.execute("memory")).thenReturn(List.of(new HashMap<>(Map.of("__value__", 65.0))));
|
||||
when(mockExecutor.execute("select memory_usage from memory_table where instance = 'web1'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 65.0))));
|
||||
// promql
|
||||
List<Map<String, Object>> result = evaluate("memory < 70");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(65.0, result.get(0).get("__value__"));
|
||||
// sql
|
||||
result = evaluate("(select memory_usage from memory_table where instance = 'web1') < 70");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(65.0, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testEqualWithTolerance() {
|
||||
when(mockExecutor.execute("disk")).thenReturn(List.of(new HashMap<>(Map.of("__value__", 99.999))));
|
||||
when(mockExecutor.execute("select disk_usage from storage_metrics where partition = '/'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 99.999))));
|
||||
// promql
|
||||
List<Map<String, Object>> result = evaluate("disk == 100");
|
||||
assertEquals(1, result.size());
|
||||
assertNull(result.get(0).get("__value__"));
|
||||
// sql
|
||||
result = evaluate("(select disk_usage from storage_metrics where partition = '/') == 100");
|
||||
assertEquals(1, result.size());
|
||||
assertNull(result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testNotEqual() {
|
||||
when(mockExecutor.execute("network")).thenReturn(List.of(new HashMap<>(Map.of("__value__", 50.0))));
|
||||
when(mockExecutor.execute("select bandwidth from network_stats where interface = 'eth0'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 50.0))));
|
||||
// promql
|
||||
List<Map<String, Object>> result = evaluate("network != 60");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(50.0, result.get(0).get("__value__"));
|
||||
// sql
|
||||
result = evaluate("(select bandwidth from network_stats where interface = 'eth0') != 60");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(50.0, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testExactlyEqual() {
|
||||
when(mockExecutor.execute("threshold")).thenReturn(List.of(new HashMap<>(Map.of("__value__", 100.0))));
|
||||
when(mockExecutor.execute("select alert_threshold from alert_config where rule_id = 'cpu_high'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 100.0))));
|
||||
// promql
|
||||
List<Map<String, Object>> result = evaluate("threshold == 100");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(100.0, result.get(0).get("__value__"));
|
||||
// sql
|
||||
result = evaluate("(select alert_threshold from alert_config where rule_id = 'cpu_high') == 100");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(100.0, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testMaxValueBoundary() {
|
||||
when(mockExecutor.execute("max_val")).thenReturn(List.of(new HashMap<>(Map.of("__value__", Double.MAX_VALUE))));
|
||||
when(mockExecutor.execute("select max_value from boundary_test where test_case = 'extreme'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", Double.MAX_VALUE))));
|
||||
// promql
|
||||
List<Map<String, Object>> result = evaluate("max_val > 100");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(Double.MAX_VALUE, result.get(0).get("__value__"));
|
||||
// sql
|
||||
result = evaluate("(select max_value from boundary_test where test_case = 'extreme') > 100");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(Double.MAX_VALUE, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testMinValueBoundary() {
|
||||
when(mockExecutor.execute("min_val")).thenReturn(List.of(new HashMap<>(Map.of("__value__", Double.MIN_VALUE))));
|
||||
when(mockExecutor.execute("select min_value from boundary_test where test_case = 'minimal'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", Double.MIN_VALUE))));
|
||||
// promql
|
||||
List<Map<String, Object>> result = evaluate("min_val > 0");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(Double.MIN_VALUE, result.get(0).get("__value__"));
|
||||
// sql
|
||||
result = evaluate("(select min_value from boundary_test where test_case = 'minimal') > 0");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(Double.MIN_VALUE, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -175,46 +121,25 @@ class AlertExpressionEvalVisitorTest {
|
||||
@Test
|
||||
void testListValueWithMax() {
|
||||
when(mockExecutor.execute("multi_val")).thenReturn(List.of(new HashMap<>(Map.of("__value__", List.of(10.0, 20.0, 30.0)))));
|
||||
when(mockExecutor.execute("select values from multi_metrics where group_id = 'test_group'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", List.of(10.0, 20.0, 30.0)))));
|
||||
// promql
|
||||
List<Map<String, Object>> result = evaluate("multi_val > 25");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(30.0, result.get(0).get("__value__"));
|
||||
// sql
|
||||
result = evaluate("(select values from multi_metrics where group_id = 'test_group') > 25");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(30.0, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testListValueWithMin() {
|
||||
when(mockExecutor.execute("multi_val")).thenReturn(List.of(new HashMap<>(Map.of("__value__", List.of(10.0, 20.0, 30.0)))));
|
||||
when(mockExecutor.execute("select response_times from performance_data where service = 'api'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", List.of(10.0, 20.0, 30.0)))));
|
||||
// promql
|
||||
List<Map<String, Object>> result = evaluate("multi_val < 15");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(10.0, result.get(0).get("__value__"));
|
||||
// sql
|
||||
result = evaluate("(select response_times from performance_data where service = 'api') < 15");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(10.0, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testEmptyListValue() {
|
||||
when(mockExecutor.execute("empty_list")).thenReturn(List.of(new HashMap<>(Map.of("__value__", List.of()))));
|
||||
when(mockExecutor.execute("select error_codes from error_log where date = '2024-01-01'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", List.of()))));
|
||||
// promql
|
||||
List<Map<String, Object>> result = evaluate("empty_list > 50");
|
||||
assertEquals(1, result.size());
|
||||
assertNull(result.get(0).get("__value__"));
|
||||
// sql
|
||||
result = evaluate("(select error_codes from error_log where date = '2024-01-01') > 50");
|
||||
assertEquals(1, result.size());
|
||||
assertNull(result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -222,22 +147,9 @@ class AlertExpressionEvalVisitorTest {
|
||||
when(mockExecutor.execute("a")).thenReturn(List.of(new HashMap<>(Map.of("__value__", 10.0))));
|
||||
when(mockExecutor.execute("b")).thenReturn(List.of(new HashMap<>(Map.of("__value__", 20.0))));
|
||||
when(mockExecutor.execute("c")).thenReturn(List.of(new HashMap<>(Map.of("__value__", 30.0))));
|
||||
when(mockExecutor.execute("select cpu from server_a where region = 'us-east'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 10.0))));
|
||||
when(mockExecutor.execute("select memory from server_b where region = 'us-west'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 20.0))));
|
||||
when(mockExecutor.execute("select disk from server_c where region = 'eu-central'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 30.0))));
|
||||
// promql
|
||||
List<Map<String, Object>> result = evaluate("(a > 5) and (b > 15 or c < 25)");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(10.0, result.get(0).get("__value__"));
|
||||
// sql
|
||||
result = evaluate("((select cpu from server_a where region = 'us-east') > 5)"
|
||||
+ " and ((select memory from server_b where region = 'us-west') > 15"
|
||||
+ " or (select disk from server_c where region = 'eu-central') < 25)");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(10.0, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -245,22 +157,9 @@ class AlertExpressionEvalVisitorTest {
|
||||
when(mockExecutor.execute("metric1")).thenReturn(List.of(new HashMap<>(Map.of("__value__", 40.0))));
|
||||
when(mockExecutor.execute("metric2")).thenReturn(List.of(new HashMap<>(Map.of("__value__", 50.0))));
|
||||
when(mockExecutor.execute("metric3")).thenReturn(List.of(new HashMap<>(Map.of("__value__", 60.0))));
|
||||
when(mockExecutor.execute("select cpu_usage from metrics where service = 'web'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 40.0))));
|
||||
when(mockExecutor.execute("select memory_usage from metrics where service = 'db'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 50.0))));
|
||||
when(mockExecutor.execute("select disk_usage from metrics where service = 'cache'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 60.0))));
|
||||
// promql
|
||||
List<Map<String, Object>> result = evaluate("metric1 > 30 unless metric2 > 45 unless metric3 < 70");
|
||||
assertEquals(1, result.size());
|
||||
assertNull(result.get(0).get("__value__"));
|
||||
// sql
|
||||
result = evaluate("(select cpu_usage from metrics where service = 'web') > 30"
|
||||
+ " unless (select memory_usage from metrics where service = 'db') > 45"
|
||||
+ " unless (select disk_usage from metrics where service = 'cache') < 70");
|
||||
assertEquals(1, result.size());
|
||||
assertNull(result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -268,324 +167,15 @@ class AlertExpressionEvalVisitorTest {
|
||||
when(mockExecutor.execute("cpu_temp")).thenReturn(List.of(new HashMap<>(Map.of("__value__", 75.0))));
|
||||
when(mockExecutor.execute("gpu_temp")).thenReturn(List.of(new HashMap<>(Map.of("__value__", 85.0))));
|
||||
when(mockExecutor.execute("fan_speed")).thenReturn(List.of(new HashMap<>(Map.of("__value__", 2000.0))));
|
||||
when(mockExecutor.execute("select cpu_temperature from hardware_metrics where component = 'cpu'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 75.0))));
|
||||
when(mockExecutor.execute("select gpu_temperature from hardware_metrics where component = 'gpu'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 85.0))));
|
||||
when(mockExecutor.execute("select fan_rpm from hardware_metrics where component = 'fan'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 2000.0))));
|
||||
|
||||
// promql
|
||||
List<Map<String, Object>> result = evaluate("(cpu_temp > 70 and gpu_temp < 90) or fan_speed > 1500");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(75.0, result.get(0).get("__value__"));
|
||||
// sql
|
||||
result = evaluate("((select cpu_temperature from hardware_metrics where component = 'cpu') > 70"
|
||||
+ " and (select gpu_temperature from hardware_metrics where component = 'gpu') < 90)"
|
||||
+ " or (select fan_rpm from hardware_metrics where component = 'fan') > 1500");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(75.0, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlAggregateCount() {
|
||||
when(mockExecutor.execute("select count(*) from cpu_metrics where host = 'server1'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 150))));
|
||||
List<Map<String, Object>> result = evaluate("(select count(*) from cpu_metrics where host = 'server1') > 100");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(150, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlAggregateAvg() {
|
||||
when(mockExecutor.execute("select avg(cpu_usage) from system_metrics where region = 'us-east'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 75.5))));
|
||||
List<Map<String, Object>> result = evaluate("(select avg(cpu_usage) from system_metrics where region = 'us-east') > 70");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(75.5, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlAggregateSum() {
|
||||
when(mockExecutor.execute("select sum(memory_used) from memory_stats where service = 'web'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 2048.0))));
|
||||
List<Map<String, Object>> result = evaluate("(select sum(memory_used) from memory_stats where service = 'web') < 3000");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(2048.0, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlAggregateMaxMin() {
|
||||
when(mockExecutor.execute("select max(response_time) from api_metrics where endpoint = '/api/users'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 250.0))));
|
||||
when(mockExecutor.execute("select min(response_time) from api_metrics where endpoint = '/api/users'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 50.0))));
|
||||
|
||||
List<Map<String, Object>> result = evaluate("(select max(response_time) from api_metrics where endpoint = '/api/users') > 200");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(250.0, result.get(0).get("__value__"));
|
||||
|
||||
result = evaluate("(select min(response_time) from api_metrics where endpoint = '/api/users') < 100");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(50.0, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlGroupBy() {
|
||||
when(mockExecutor.execute("select avg(cpu_usage) from system_metrics where timestamp > '2024-01-01' group by host")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 80.5))));
|
||||
List<Map<String, Object>> result = evaluate("(select avg(cpu_usage) from system_metrics where timestamp > '2024-01-01' group by host) > 75");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(80.5, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlGroupByHaving() {
|
||||
when(mockExecutor.execute("select count(*) from error_logs where level = 'ERROR' group by service having count(*) > 10")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 25))));
|
||||
List<Map<String, Object>> result = evaluate("(select count(*) from error_logs where level = 'ERROR' group by service having count(*) > 10) > 20");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(25, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlOrderByLimit() {
|
||||
when(mockExecutor.execute("select cpu_usage from system_metrics where host like 'web%' order by cpu_usage desc limit 1")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 95.2))));
|
||||
List<Map<String, Object>> result = evaluate("(select cpu_usage from system_metrics where host like 'web%' order by cpu_usage desc limit 1) > 90");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(95.2, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlMultipleColumns() {
|
||||
when(mockExecutor.execute("select avg(cpu_usage), max(memory_usage) from system_metrics where region = 'us-west'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 65.8))));
|
||||
List<Map<String, Object>> result = evaluate("(select avg(cpu_usage), max(memory_usage) from system_metrics where region = 'us-west') < 70");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(65.8, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlSubquery() {
|
||||
when(mockExecutor.execute("select avg(cpu_usage) from system_metrics where host in (select host from active_servers where status = 'running')")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 72.3))));
|
||||
List<Map<String, Object>> result = evaluate("(select avg(cpu_usage) from system_metrics where host in (select host from active_servers where status = 'running')) > 70");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(72.3, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlComplexSubquery() {
|
||||
when(mockExecutor.execute("select count(*) from alerts where severity = 'HIGH' and service_id in (select id from services where category = 'critical')")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 8))));
|
||||
List<Map<String, Object>> result = evaluate("(select count(*) from alerts where severity = 'HIGH' and service_id in (select id from services where category = 'critical')) >= 5");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(8, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlWithJoins() {
|
||||
when(mockExecutor.execute("select avg(m.cpu_usage) from metrics m, servers s where m.server_id = s.id and s.environment = 'production'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 78.9))));
|
||||
List<Map<String, Object>> result = evaluate("(select avg(m.cpu_usage) from metrics m, servers s where m.server_id = s.id and s.environment = 'production') < 80");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(78.9, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlBetweenCondition() {
|
||||
when(mockExecutor.execute("select count(*) from performance_logs where response_time between 100 and 500")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 1200))));
|
||||
List<Map<String, Object>> result = evaluate("(select count(*) from performance_logs where response_time between 100 and 500) > 1000");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(1200, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlComplexGroupByOrderBy() {
|
||||
when(mockExecutor.execute("select service, avg(response_time) from api_metrics where timestamp > '2024-01-01'"
|
||||
+ " group by service order by avg(response_time) desc limit 5")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 180.5))));
|
||||
List<Map<String, Object>> result = evaluate("(select service, avg(response_time) from api_metrics where timestamp > '2024-01-01'"
|
||||
+ " group by service order by avg(response_time) desc limit 5) > 150");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(180.5, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlVarianceStddev() {
|
||||
when(mockExecutor.execute("select stddev(cpu_usage) from system_metrics where host = 'db-server' and timestamp > '2024-01-01'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 12.5))));
|
||||
List<Map<String, Object>> result = evaluate("(select stddev(cpu_usage) from system_metrics where host = 'db-server' and timestamp > '2024-01-01') < 15");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(12.5, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlNestedAggregation() {
|
||||
when(mockExecutor.execute("select max(daily_avg) from (select date, avg(cpu_usage) as daily_avg from system_metrics group by date) as daily_stats")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 88.7))));
|
||||
List<Map<String, Object>> result = evaluate("(select max(daily_avg) from (select date, avg(cpu_usage) as daily_avg from system_metrics group by date) as daily_stats) > 85");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(88.7, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlComplexWhereConditions() {
|
||||
when(mockExecutor.execute("select count(*) from alerts where (severity = 'HIGH' or severity = 'CRITICAL') and status = 'ACTIVE' and created_at > '2024-01-01'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 42))));
|
||||
List<Map<String, Object>> result = evaluate("(select count(*) from alerts where (severity = 'HIGH' or severity = 'CRITICAL') and status = 'ACTIVE' and created_at > '2024-01-01') != 50");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(42, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlWithNullChecks() {
|
||||
when(mockExecutor.execute("select count(*) from system_metrics where cpu_usage is not null and memory_usage is not null")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 9876))));
|
||||
List<Map<String, Object>> result = evaluate("(select count(*) from system_metrics where cpu_usage is not null and memory_usage is not null) > 9000");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(9876, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlMultipleAggregatesWithAlias() {
|
||||
when(mockExecutor.execute("select max(cpu_usage) as max_cpu, min(cpu_usage) as min_cpu, avg(cpu_usage) as avg_cpu from system_metrics where region = 'asia'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 92.1))));
|
||||
List<Map<String, Object>> result = evaluate("(select max(cpu_usage) as max_cpu, min(cpu_usage) as min_cpu, avg(cpu_usage) as avg_cpu from system_metrics where region = 'asia') > 90");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(92.1, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSqlAndPromqlCallExpr() {
|
||||
when(mockExecutor.execute("sum(rate(http_requests_total{job='your-service'}[1m]))")).thenReturn(List.of(new HashMap<>(Map.of("__value__", 80))));
|
||||
when(mockExecutor.execute("select cpu_usage from system_metrics where host = 'server1'")).thenReturn(
|
||||
List.of(new HashMap<>(Map.of("__value__", 80))));
|
||||
// promql
|
||||
List<Map<String, Object>> result = evaluate("promql(\"sum(rate(http_requests_total{job='your-service'}[1m]))\") > 70");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(80, result.get(0).get("__value__"));
|
||||
// sql
|
||||
result = evaluate("sql(\"select cpu_usage from system_metrics where host = 'server1'\") > 70");
|
||||
assertEquals(1, result.size());
|
||||
assertEquals(80, result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAndOpPromql() {
|
||||
String promql = "http_server_requests_seconds_count > 10 and http_server_requests_seconds_max > 5";
|
||||
|
||||
Map<String, Object> countValue1 = new HashMap<>() {
|
||||
{
|
||||
put("exception", "none");
|
||||
put("instance", "host.docker.internal:8989");
|
||||
put("__value__", 1307);
|
||||
put("method", "GET");
|
||||
put("__name__", "http_server_requests_seconds_count");
|
||||
put("__timestamp__", "1.750320922467E9");
|
||||
put("error", "none");
|
||||
put("job", "spring-boot-app");
|
||||
put("uri", "/actuator/prometheus");
|
||||
put("outcome", "SUCCESS");
|
||||
put("status", "200");
|
||||
}
|
||||
};
|
||||
|
||||
Map<String, Object> countValue2 = new HashMap<>() {
|
||||
{
|
||||
put("exception", "none");
|
||||
put("instance", "host.docker.internal:8989");
|
||||
put("__value__", 16);
|
||||
put("method", "GET");
|
||||
put("__name__", "http_server_requests_seconds_count");
|
||||
put("__timestamp__", "1.750320922467E9");
|
||||
put("error", "none");
|
||||
put("job", "spring-boot-app");
|
||||
put("uri", "/**");
|
||||
put("outcome", "SUCCESS");
|
||||
put("status", "200");
|
||||
}
|
||||
};
|
||||
|
||||
Map<String, Object> countValue3 = new HashMap<>() {
|
||||
{
|
||||
put("exception", "none");
|
||||
put("instance", "host.docker.internal:8989");
|
||||
put("__value__", 7);
|
||||
put("method", "GET");
|
||||
put("__name__", "http_server_requests_seconds_count");
|
||||
put("__timestamp__", "1.750320922467E9");
|
||||
put("error", "none");
|
||||
put("job", "spring-boot-app");
|
||||
put("uri", "/actuator/health");
|
||||
put("outcome", "SUCCESS");
|
||||
put("status", "200");
|
||||
}
|
||||
};
|
||||
|
||||
Map<String, Object> maxValue1 = new HashMap<>() {
|
||||
{
|
||||
put("exception", "none");
|
||||
put("instance", "host.docker.internal:8989");
|
||||
put("__value__", 10.007799125);
|
||||
put("method", "GET");
|
||||
put("__name__", "http_server_requests_seconds_max");
|
||||
put("__timestamp__", "1.750320922467E9");
|
||||
put("error", "none");
|
||||
put("job", "spring-boot-app");
|
||||
put("uri", "/actuator/prometheus");
|
||||
put("outcome", "SUCCESS");
|
||||
put("status", "200");
|
||||
}
|
||||
};
|
||||
|
||||
Map<String, Object> maxValue2 = new HashMap<>() {
|
||||
{
|
||||
put("exception", "none");
|
||||
put("instance", "host.docker.internal:8989");
|
||||
put("__value__", 10);
|
||||
put("method", "GET");
|
||||
put("__name__", "http_server_requests_seconds_count");
|
||||
put("__timestamp__", "1.750320922467E9");
|
||||
put("error", "none");
|
||||
put("job", "spring-boot-app");
|
||||
put("uri", "/**");
|
||||
put("outcome", "SUCCESS");
|
||||
put("status", "200");
|
||||
}
|
||||
};
|
||||
|
||||
Map<String, Object> maxValue3 = new HashMap<>() {
|
||||
{
|
||||
put("exception", "none");
|
||||
put("instance", "host.docker.internal:8989");
|
||||
put("__value__", 0);
|
||||
put("method", "GET");
|
||||
put("__name__", "http_server_requests_seconds_count");
|
||||
put("__timestamp__", "1.750320922467E9");
|
||||
put("error", "none");
|
||||
put("job", "spring-boot-app");
|
||||
put("uri", "/actuator/health");
|
||||
put("outcome", "SUCCESS");
|
||||
put("status", "200");
|
||||
}
|
||||
};
|
||||
|
||||
when(mockExecutor.execute("http_server_requests_seconds_count")).thenReturn(List.of(countValue1, countValue2, countValue3));
|
||||
when(mockExecutor.execute("http_server_requests_seconds_max")).thenReturn(List.of(maxValue1, maxValue2, maxValue3));
|
||||
List<Map<String, Object>> result = evaluate(promql);
|
||||
assertEquals(2, result.size());
|
||||
assertEquals(1307, result.get(0).get("__value__"));
|
||||
assertEquals(16, result.get(1).get("__value__"));
|
||||
}
|
||||
|
||||
|
||||
private List<Map<String, Object>> evaluate(String expression) {
|
||||
AlertExpressionLexer lexer = new AlertExpressionLexer(CharStreams.fromString(expression));
|
||||
CommonTokenStream tokens = new CommonTokenStream(lexer);
|
||||
AlertExpressionParser parser = new AlertExpressionParser(tokens);
|
||||
return new AlertExpressionEvalVisitor(mockExecutor, tokens).visit(parser.expression());
|
||||
AlertExpressionParser parser = new AlertExpressionParser(new CommonTokenStream(lexer));
|
||||
return visitor.visit(parser.expression());
|
||||
}
|
||||
}
|
||||
-150
@@ -1,150 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.alert.service;
|
||||
|
||||
|
||||
import org.apache.hertzbeat.alert.dto.AlibabaCloudSlsExternAlert;
|
||||
import org.apache.hertzbeat.alert.reduce.AlarmCommonReduce;
|
||||
import org.apache.hertzbeat.alert.service.impl.AlibabaCloudSlsExternAlertService;
|
||||
import org.apache.hertzbeat.common.entity.alerter.SingleAlert;
|
||||
import org.apache.hertzbeat.common.util.JsonUtil;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
/**
|
||||
* unit test for {@link AlibabaCloudSlsExternAlertServiceTest }
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class AlibabaCloudSlsExternAlertServiceTest {
|
||||
|
||||
@Mock
|
||||
private AlarmCommonReduce alarmCommonReduce;
|
||||
|
||||
@InjectMocks
|
||||
private AlibabaCloudSlsExternAlertService externAlertService;
|
||||
|
||||
@Test
|
||||
void testAddExternAlertWithInvalidContent() {
|
||||
String invalidContent = "invalid json";
|
||||
externAlertService.addExternAlert(invalidContent);
|
||||
verify(alarmCommonReduce, never()).reduceAndSendAlarm(any(SingleAlert.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAddExternAlert() {
|
||||
String source = externAlertService.supportSource();
|
||||
assertEquals("alibabacloud-sls", source);
|
||||
|
||||
AlibabaCloudSlsExternAlert externAlert = new AlibabaCloudSlsExternAlert();
|
||||
externAlert.setAlertName("Test SLS alert");
|
||||
externAlert.setFireTime((int) Instant.now().getEpochSecond());
|
||||
externAlert.setAlertTime((int) Instant.now().getEpochSecond());
|
||||
externAlert.setRegion("cn-hangzhou");
|
||||
externAlert.setProject("project");
|
||||
externAlert.setStatus("firing");
|
||||
externAlert.setSeverity(AlibabaCloudSlsExternAlert.Severity.HIGH.getStatus());
|
||||
|
||||
Map<String, String> labels = new HashMap<>();
|
||||
labels.put("labels-k", "labels-v");
|
||||
externAlert.setLabels(labels);
|
||||
|
||||
Map<String, String> annotations = new HashMap<>();
|
||||
annotations.put("annotations-k", "annotations-v");
|
||||
externAlert.setAnnotations(annotations);
|
||||
|
||||
externAlertService.addExternAlert(JsonUtil.toJson(externAlert));
|
||||
|
||||
verify(alarmCommonReduce, times(1)).reduceAndSendAlarm(any(SingleAlert.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAddExternAlertWithSigninUrl() {
|
||||
AlibabaCloudSlsExternAlert alert = new AlibabaCloudSlsExternAlert();
|
||||
alert.setAlertName("Test Alert");
|
||||
alert.setFireTime((int) Instant.now().getEpochSecond());
|
||||
alert.setAlertTime((int) Instant.now().getEpochSecond());
|
||||
alert.setRegion("cn-hangzhou");
|
||||
alert.setProject("test-project");
|
||||
alert.setStatus("firing");
|
||||
alert.setSeverity(AlibabaCloudSlsExternAlert.Severity.HIGH.getStatus());
|
||||
alert.setSigninUrl("https://example.com");
|
||||
externAlertService.addExternAlert(JsonUtil.toJson(alert));
|
||||
verify(alarmCommonReduce, times(1)).reduceAndSendAlarm(any(SingleAlert.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAddExternAlertWithDifferentSeverityLevels() {
|
||||
for (AlibabaCloudSlsExternAlert.Severity severity : AlibabaCloudSlsExternAlert.Severity.values()) {
|
||||
AlibabaCloudSlsExternAlert alert = new AlibabaCloudSlsExternAlert();
|
||||
alert.setAlertName("Test Alert");
|
||||
alert.setFireTime((int) Instant.now().getEpochSecond());
|
||||
alert.setAlertTime((int) Instant.now().getEpochSecond());
|
||||
alert.setRegion("cn-hangzhou");
|
||||
alert.setProject("test-project");
|
||||
alert.setStatus("firing");
|
||||
alert.setSeverity(severity.getStatus());
|
||||
externAlertService.addExternAlert(JsonUtil.toJson(alert));
|
||||
}
|
||||
verify(alarmCommonReduce, times(AlibabaCloudSlsExternAlert.Severity.values().length))
|
||||
.reduceAndSendAlarm(any(SingleAlert.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAddExternAlertWithEmptyLabelsAndAnnotations() {
|
||||
AlibabaCloudSlsExternAlert alert = new AlibabaCloudSlsExternAlert();
|
||||
alert.setAlertName("Test Alert");
|
||||
alert.setFireTime((int) Instant.now().getEpochSecond());
|
||||
alert.setAlertTime((int) Instant.now().getEpochSecond());
|
||||
alert.setRegion("cn-hangzhou");
|
||||
alert.setProject("test-project");
|
||||
alert.setStatus("firing");
|
||||
alert.setSeverity(AlibabaCloudSlsExternAlert.Severity.HIGH.getStatus());
|
||||
alert.setLabels(new HashMap<>());
|
||||
alert.setAnnotations(new HashMap<>());
|
||||
externAlertService.addExternAlert(JsonUtil.toJson(alert));
|
||||
verify(alarmCommonReduce, times(1)).reduceAndSendAlarm(any(SingleAlert.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAddExternAlertWithInvalidSeverity() {
|
||||
AlibabaCloudSlsExternAlert alert = new AlibabaCloudSlsExternAlert();
|
||||
alert.setAlertName("Test Alert");
|
||||
alert.setFireTime((int) Instant.now().getEpochSecond());
|
||||
alert.setAlertTime((int) Instant.now().getEpochSecond());
|
||||
alert.setRegion("cn-hangzhou");
|
||||
alert.setProject("test-project");
|
||||
alert.setStatus("firing");
|
||||
alert.setSeverity(-99);
|
||||
externAlertService.addExternAlert(JsonUtil.toJson(alert));
|
||||
verify(alarmCommonReduce, times(1)).reduceAndSendAlarm(any(SingleAlert.class));
|
||||
}
|
||||
|
||||
}
|
||||
+30
-23
@@ -17,6 +17,11 @@
|
||||
|
||||
package org.apache.hertzbeat.alert.service;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.github.benmanes.caffeine.cache.Cache;
|
||||
import org.antlr.v4.runtime.CommonTokenStream;
|
||||
import org.antlr.v4.runtime.tree.ParseTree;
|
||||
@@ -24,24 +29,17 @@ import org.apache.hertzbeat.alert.service.impl.DataSourceServiceImpl;
|
||||
import org.apache.hertzbeat.warehouse.db.QueryExecutor;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
/**
|
||||
* test case for {@link DataSourceService}
|
||||
*/
|
||||
class DataSourceServiceTest {
|
||||
|
||||
|
||||
private DataSourceServiceImpl dataSourceService;
|
||||
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
dataSourceService = new DataSourceServiceImpl();
|
||||
@@ -53,12 +51,12 @@ class DataSourceServiceTest {
|
||||
new HashMap<>(Map.of("__value__", 100.0, "timestamp", 1343554, "instance", "node1")),
|
||||
new HashMap<>(Map.of("__value__", 200.0, "timestamp", 1343555, "instance", "node2"))
|
||||
);
|
||||
|
||||
|
||||
QueryExecutor mockExecutor = Mockito.mock(QueryExecutor.class);
|
||||
Mockito.when(mockExecutor.support("promql")).thenReturn(true);
|
||||
Mockito.when(mockExecutor.execute(Mockito.anyString())).thenReturn(prometheusData);
|
||||
dataSourceService.setExecutors(List.of(mockExecutor));
|
||||
|
||||
|
||||
List<Map<String, Object>> result = dataSourceService.calculate("promql", "node_cpu_seconds_total > 150");
|
||||
assertEquals(2, result.size());
|
||||
assertNull(result.get(0).get("__value__"));
|
||||
@@ -298,36 +296,45 @@ class DataSourceServiceTest {
|
||||
@Test
|
||||
void calculate15() {
|
||||
List<Map<String, Object>> prometheusData1 = List.of(
|
||||
new HashMap<>(Map.of("__value__", 1))
|
||||
new HashMap<>(Map.of("__value__", 100.0, "timestamp", 1343554, "instance", "node1")),
|
||||
new HashMap<>(Map.of("__value__", 200.0, "timestamp", 1343555, "instance", "node2"))
|
||||
);
|
||||
List<Map<String, Object>> prometheusData2 = List.of(
|
||||
new HashMap<>(Map.of("__value__", 100.0, "timestamp", 1343554, "instance", "node1")),
|
||||
new HashMap<>(Map.of("__value__", 200.0, "timestamp", 1343555, "instance", "node2"))
|
||||
);
|
||||
|
||||
QueryExecutor mockExecutor = Mockito.mock(QueryExecutor.class);
|
||||
Mockito.when(mockExecutor.support("promql")).thenReturn(true);
|
||||
Mockito.when(mockExecutor.execute("count(node_cpu_seconds_total{mode=\"user\"} > 250)")).thenReturn(prometheusData1);
|
||||
Mockito.when(mockExecutor.execute("count(node_cpu_seconds_total{mode=\"idle\"} < 220 )")).thenReturn(new ArrayList<>());
|
||||
Mockito.when(mockExecutor.execute("node_cpu_seconds_total{mode=\"user\"}")).thenReturn(prometheusData1);
|
||||
Mockito.when(mockExecutor.execute("node_cpu_seconds_total{mode=\"idle\"}")).thenReturn(prometheusData2);
|
||||
dataSourceService.setExecutors(List.of(mockExecutor));
|
||||
|
||||
List<Map<String, Object>> result = dataSourceService.calculate("promql", "count(node_cpu_seconds_total{mode=\"user\"} > 250) > 0 and count(node_cpu_seconds_total{mode=\"idle\"} < 220 ) > 0");
|
||||
assertEquals(0, result.size());
|
||||
List<Map<String, Object>> result = dataSourceService.calculate("promql", "node_cpu_seconds_total{mode=\"user\"} > 250 and node_cpu_seconds_total{mode=\"idle\"} < 220");
|
||||
assertEquals(1, result.size());
|
||||
assertNull(result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void calculate16() {
|
||||
List<Map<String, Object>> prometheusData1 = List.of(
|
||||
new HashMap<>(Map.of("__value__", 1))
|
||||
new HashMap<>(Map.of("__value__", 100.0, "timestamp", 1343554, "instance", "node1")),
|
||||
new HashMap<>(Map.of("__value__", 200.0, "timestamp", 1343555, "instance", "node2"))
|
||||
);
|
||||
List<Map<String, Object>> prometheusData2 = List.of(
|
||||
new HashMap<>(Map.of("__value__", 1))
|
||||
new HashMap<>(Map.of("__value__", 100.0, "timestamp", 1343554, "instance", "node1")),
|
||||
new HashMap<>(Map.of("__value__", 200.0, "timestamp", 1343555, "instance", "node2"))
|
||||
);
|
||||
|
||||
QueryExecutor mockExecutor = Mockito.mock(QueryExecutor.class);
|
||||
Mockito.when(mockExecutor.support("promql")).thenReturn(true);
|
||||
Mockito.when(mockExecutor.execute("count(node_cpu_seconds_total{mode=\"user\"} > 250)")).thenReturn(prometheusData1);
|
||||
Mockito.when(mockExecutor.execute("count(node_cpu_seconds_total{mode=\"idle\"} < 220 )")).thenReturn(prometheusData2);
|
||||
Mockito.when(mockExecutor.execute("node_cpu_seconds_total{mode=\"user\"}")).thenReturn(prometheusData1);
|
||||
Mockito.when(mockExecutor.execute("node_cpu_seconds_total{mode=\"idle\"}")).thenReturn(prometheusData2);
|
||||
dataSourceService.setExecutors(List.of(mockExecutor));
|
||||
|
||||
List<Map<String, Object>> result = dataSourceService.calculate("promql", "count(node_cpu_seconds_total{mode=\"user\"} > 250) > 0 and count(node_cpu_seconds_total{mode=\"idle\"} < 220 ) > 0");
|
||||
List<Map<String, Object>> result = dataSourceService.calculate("promql", "node_cpu_seconds_total{mode=\"user\"} > 50 and node_cpu_seconds_total{mode=\"idle\"} < 20");
|
||||
assertEquals(1, result.size());
|
||||
assertNotNull(result.get(0).get("__value__"));
|
||||
assertNull(result.get(0).get("__value__"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
-152
@@ -1,152 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.alert.service;
|
||||
|
||||
import org.apache.hertzbeat.alert.dto.HuaweiCloudExternAlert;
|
||||
import org.apache.hertzbeat.alert.reduce.AlarmCommonReduce;
|
||||
import org.apache.hertzbeat.alert.service.impl.HuaweiCloudExternAlertService;
|
||||
import org.apache.hertzbeat.common.entity.alerter.SingleAlert;
|
||||
import org.apache.hertzbeat.common.util.JsonUtil;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
||||
/**
|
||||
* unit test for {@link AlibabaCloudSlsExternAlertServiceTest }
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class HuaweiCloudExternAlertServiceTest {
|
||||
|
||||
@Mock
|
||||
private AlarmCommonReduce alarmCommonReduce;
|
||||
|
||||
@InjectMocks
|
||||
private HuaweiCloudExternAlertService externAlertService;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
assertEquals("huaweicloud-ces", externAlertService.supportSource());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAddExternAlertWithInvalidContent() {
|
||||
String invalidContent = "invalid json";
|
||||
externAlertService.addExternAlert(invalidContent);
|
||||
verify(alarmCommonReduce, never()).reduceAndSendAlarm(any(SingleAlert.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testMessageValidFailed() {
|
||||
HuaweiCloudExternAlert externAlert = new HuaweiCloudExternAlert();
|
||||
externAlert.setMessageId("d3672d737bb742cf8c2aa3f0fd72d4d1");
|
||||
externAlert.setType("failedType");
|
||||
externAlert.setMessage("failedMessage");
|
||||
externAlert.setTimestamp("2025-06-07T15:12:09Z");
|
||||
externAlertService.addExternAlert(JsonUtil.toJson(externAlert));
|
||||
verify(alarmCommonReduce, never()).reduceAndSendAlarm(any(SingleAlert.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCertFailed() {
|
||||
HuaweiCloudExternAlert externAlert = new HuaweiCloudExternAlert();
|
||||
externAlert.setSignature("TImrLoeb0tV1JZJSPyA0rpC9mNqH3MmhwQ4tgpuHHa+JztfGVZFvkU//OthKKhzpDAoYiXOYG9DbzXCLb"
|
||||
+ "vaGePIRITakoynYyYr9zZIpdx9jXhQNlgF8np1+t0JxNeoIq0DYWgH52tsodwqOm+OnmkcHwCRo/1rFv85KrKAaX2gy3sNwX"
|
||||
+ "w1hKnAwAw0mJlxHHSf/N3+7j6GoxCNV7fN9K4CpJiLMGNvUa7zVmG0U9mPvt/7Lac155kPPQ9lYyeL7vVI0e4sfRbuQruz3E"
|
||||
+ "0ZP40TKx0afoeR0/Bx/IoZzRP1La7pKlbEISvkcM7TqW/IOGQTkhVsQ32RFRxZWO2snw==");
|
||||
externAlert.setSubject("[华为云][紧急告警恢复]云监控通知:分布式缓存服务-DCS Redis实例 “dcs-h4tv” 的每秒并发操作数已恢复正常。");
|
||||
externAlert.setTopicUrn("urn:smn:cn-north-4:477a784601d744e4ab9ab83986502d31:CES_notification_group_bngJ2aMpX");
|
||||
externAlert.setMessageId("d3672d737bb742cf8c2aa3f0fd72d4d1");
|
||||
externAlert.setType("Notification");
|
||||
externAlert.setMessage("{}");
|
||||
externAlert.setSigningCertUrl("https://smn.cn-north-4.myhuaweicloud.com/failedUrl");
|
||||
externAlert.setTimestamp("2025-06-07T15:12:09Z");
|
||||
externAlertService.addExternAlert(JsonUtil.toJson(externAlert));
|
||||
verify(alarmCommonReduce, never()).reduceAndSendAlarm(any(SingleAlert.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAddExternAlert() {
|
||||
HuaweiCloudExternAlert externAlert = new HuaweiCloudExternAlert();
|
||||
externAlert.setSignature("Igs0bBhzw0JGmlgBH+9ejw2xWfPTXjAatAEsKDkkWcC5bZ/jveckdRZdgp/S0JER9eiJfMF427YDABufIN0sv/vBRXaRQKfRBLTJYbSTl+AQpEbIW5yUfJSRLEG3HNEhUDjASolbrW7zdPCoGkkqjifE23FCvw"
|
||||
+ "+4tewMzqmHnfJHcFBq3W89CJzdPBjwO1UcY9C39moUZgqZk+qDVLpxb4bHSrEYAwPOSrOPR7TZpETJ30UOgFYajJydQk692edfs0NeVutHoQiOJ5/YC83ULHft0aXhichjtfZE4KF69nROAKez0ubk3l"
|
||||
+ "Ey/mBIM9Ylbxn5b84OIrzzZQrIWe8Syw==");
|
||||
externAlert.setSubject("[华为云][紧急告警]云监控通知:分布式缓存服务-DCS Redis实例 “dcs-h4tv” 的每秒并发操作数已触发告警。");
|
||||
externAlert.setTopicUrn("urn:smn:cn-north-4:477a784601d744e4ab9ab83986502d31:CES_notification_group_bngJ2aMpX");
|
||||
externAlert.setMessageId("1565df032a19494590d61e05f7b0dc0e");
|
||||
externAlert.setType("Notification");
|
||||
externAlert.setMessage("{\"version\":\"v1\",\"data\":{\"AccountName\":\"hid_hk6tij5o1v-95zn\",\"Namespace\":\"分布式缓存服务\",\"DimensionName\":\"DCS Redis实例\",\"ResourceName\""
|
||||
+ ":\"dcs-h4tv\",\"MetricName\":\"每秒并发操作数\",\"IsAlarm\":true,\"AlarmLevel\":\"紧急\",\"Region\":\"华东-上海一\",\"RegionId\":\"cn-east-3\",\"ResourceId\":\"3dc7b9ea"
|
||||
+ "-70b4-4c38-942d-e2636e6d844c\",\"PrivateIp\":\"192.168.0.54\",\"CurrentData\":\"6.00 count\",\"AlarmTime\":\"2025/06/02 22:56:15 GMT+08:00\","
|
||||
+ "\"AlarmRecordID\":\"ah1748876175242njvndyzMZ\","
|
||||
+ "\"AlarmRuleName\":\"alarm-c5jj\",\"IsOriginalValue\":true,\"Filter\":\"原始值\",\"ComparisonOperator\":\"\\u003e\",\"Value\":\"5 count\",\"Unit\":\"count\",\"Count\":2}}");
|
||||
externAlert.setSigningCertUrl("https://smn.cn-north-4.myhuaweicloud.com/smn/SMN_cn-north-4_b98100ca131b4116ab8ee7ccedbaae99.pem");
|
||||
externAlert.setTimestamp("2025-06-02T14:56:17Z");
|
||||
externAlertService.addExternAlert(JsonUtil.toJson(externAlert));
|
||||
verify(alarmCommonReduce, times(1)).reduceAndSendAlarm(any(SingleAlert.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSubscriptionUrl() {
|
||||
HuaweiCloudExternAlert externAlert = new HuaweiCloudExternAlert();
|
||||
externAlert.setSubscribeUrl("https://console.huaweicloud.com/smn/subscription/confirm?token=477a784601d744e4ab9ab83986502d31c4b938"
|
||||
+ "0ec0b64392b134e517c3aa17eb7b3a12dc9f3b4ab495e61c4dee654b435d7223ea934345bf8ae8901cef912b1d&topic_urn=urn:smn:cn-north-4"
|
||||
+ ":477a784601d744e4ab9ab83986502d31:CES_notification_group_bngJ2aMpX®ion=cn-north-4");
|
||||
externAlert.setSignature("ottf37C/2RdDgqimRQMIBU6i7XjUfPPMU760jJn71wwP3825YPoIT22uw2A9399rkm9Jrt1qUEFrDLuA5yHFLd5n/XoM4FghIgyFn7VIfgpuVM31a+co78s"
|
||||
+ "YBiZ1egOCE/AwFm2oygRhfIceUj9Kw9vmc06el9TXY6RtE5tAEF6qEmICtTh45KwtCO/WRs3DY72dQi5hm0w7/tktS4WFZ1iP4LHt5eCwFvnH0u29Y96cJNI0fLUQxI5MkhgjK"
|
||||
+ "77JkFK7UT6ZYJZhzgSp/B7OQGStOQx+3Duvx4T4CzccZQM3sca81Z0B0GFGWeVXuEHyCPLsayY/Iz+5Tco51elT8w==");
|
||||
externAlert.setTopicUrn("urn:smn:cn-north-4:477a784601d744e4ab9ab83986502d31:CES_notification_group_bngJ2aMpX");
|
||||
externAlert.setMessageId("242fac183d3a4936b5ead6c725a32ed0");
|
||||
externAlert.setType("SubscriptionConfirmation");
|
||||
externAlert.setMessage("You are invited to subscribe to topic: urn:smn:cn-north-4:477a784601d744e4ab9ab83986502d31:"
|
||||
+ "CES_notification_group_bngJ2aMpX. To confirm this subscription, please visit the subscribe_url included in this message. The subscribe_url is valid only within 48 hours.");
|
||||
externAlert.setSigningCertUrl("https://smn.cn-north-4.myhuaweicloud.com/smn/SMN_cn-north-4_b98100ca131b4116ab8ee7ccedbaae99.pem");
|
||||
externAlert.setTimestamp("2025-06-07T15:07:14Z");
|
||||
externAlertService.addExternAlert(JsonUtil.toJson(externAlert));
|
||||
verify(alarmCommonReduce, never()).reduceAndSendAlarm(any(SingleAlert.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testUnsubscribe() {
|
||||
HuaweiCloudExternAlert externAlert = new HuaweiCloudExternAlert();
|
||||
externAlert.setSignature("TImrLoeb0tV1JZJSPyA0rpC9mNqH3MmhwQ4tgpuHHa+JztfGVZFvkU//OthKKhzpDAoYiXOYG9DbzXCLbvaGePIRITakoynYyYr9zZIpdx9jXhQNlgF8np"
|
||||
+ "1+t0JxNeoIq0DYWgH52tsodwqOm+OnmkcHwCRo/1rFv85KrKAaX2gy3sNwXw1hKnAwAw0mJlxHHSf/N3+7j6GoxCNV7fN9K4CpJiLMGNvUa7zVmG0U9mPvt/7Lac155kPPQ9l"
|
||||
+ "YyeL7vVI0e4sfRbuQruz3E0+ZP40TKx0afoeR0/Bx/IoZzRP1La7pKlbEISvkcM7TqW/IOGQTkhVsQ32RFRxZWO2snw==");
|
||||
externAlert.setSubject("[华为云][紧急告警恢复]云监控通知:分布式缓存服务-DCS Redis实例 “dcs-h4tv” 的每秒并发操作数已恢复正常。");
|
||||
externAlert.setTopicUrn("urn:smn:cn-north-4:477a784601d744e4ab9ab83986502d31:CES_notification_group_bngJ2aMpX");
|
||||
externAlert.setMessageId("d3672d737bb742cf8c2aa3f0fd72d4d1");
|
||||
externAlert.setType("UnsubscribeConfirmation");
|
||||
externAlert.setMessage("{}");
|
||||
externAlert.setSigningCertUrl("https://smn.cn-north-4.myhuaweicloud.com/smn/SMN_cn-north-4_b98100ca131b4116ab8ee7ccedbaae99.pem");
|
||||
externAlert.setTimestamp("2025-06-07T15:12:09Z");
|
||||
externAlertService.addExternAlert(JsonUtil.toJson(externAlert));
|
||||
verify(alarmCommonReduce, never()).reduceAndSendAlarm(any(SingleAlert.class));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
-92
@@ -1,92 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.alert.service;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.apache.hertzbeat.alert.config.SmsConfig;
|
||||
import org.apache.hertzbeat.alert.config.SmslocalSmsProperties;
|
||||
import org.apache.hertzbeat.base.dao.GeneralConfigDao;
|
||||
import org.apache.hertzbeat.common.constants.GeneralConfigTypeEnum;
|
||||
import org.apache.hertzbeat.common.entity.manager.GeneralConfig;
|
||||
import org.apache.hertzbeat.common.util.JsonUtil;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
|
||||
/**
|
||||
* unit test for {@link SmsClientFactory }
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class SmsClientFactoryTest {
|
||||
|
||||
|
||||
@Mock
|
||||
private GeneralConfigDao generalConfigDao;
|
||||
|
||||
@Mock
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@Mock
|
||||
private SmsConfig yamlSmsConfig;
|
||||
|
||||
@InjectMocks
|
||||
private SmsClientFactory smsClientFactory;
|
||||
|
||||
|
||||
@Test
|
||||
void testloadDbConfig() throws JsonProcessingException {
|
||||
GeneralConfig generalConfig = new GeneralConfig();
|
||||
|
||||
SmsConfig smsConfig = new SmsConfig();
|
||||
smsConfig.setType("smslocal");
|
||||
smsConfig.setEnable(true);
|
||||
smsConfig.setSmslocal(new SmslocalSmsProperties("11"));
|
||||
|
||||
generalConfig.setContent(JsonUtil.toJson(smsConfig));
|
||||
when(objectMapper.readValue(generalConfig.getContent(), SmsConfig.class)).thenReturn(smsConfig);
|
||||
when(generalConfigDao.findByType(GeneralConfigTypeEnum.sms.name())).thenReturn(generalConfig);
|
||||
|
||||
assertNotNull(smsClientFactory.getSmsClient());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
void testloadYamlConfig() {
|
||||
when(generalConfigDao.findByType(GeneralConfigTypeEnum.sms.name())).thenReturn(null);
|
||||
when(yamlSmsConfig.getType()).thenReturn("smslocal");
|
||||
when(yamlSmsConfig.isEnable()).thenReturn(true);
|
||||
when(yamlSmsConfig.getSmslocal()).thenReturn(new SmslocalSmsProperties("11"));
|
||||
assertNotNull(smsClientFactory.getSmsClient());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testNull() {
|
||||
when(generalConfigDao.findByType(GeneralConfigTypeEnum.sms.name())).thenReturn(null);
|
||||
when(yamlSmsConfig.getType()).thenReturn("");
|
||||
assertNull(smsClientFactory.getSmsClient());
|
||||
}
|
||||
|
||||
}
|
||||
-73
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.alert.service.impl;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.hertzbeat.alert.config.SmslocalSmsProperties;
|
||||
import org.apache.hertzbeat.common.entity.alerter.GroupAlert;
|
||||
import org.apache.hertzbeat.common.entity.alerter.NoticeReceiver;
|
||||
import org.apache.hertzbeat.common.entity.alerter.SingleAlert;
|
||||
import org.apache.hertzbeat.common.support.exception.SendMessageException;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* Test case for {@link SmsLocalSmsClientImpl}
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class SmsLocalSmsClientImplTest {
|
||||
|
||||
@Mock
|
||||
private SmslocalSmsProperties smslocalSmsProperties;
|
||||
|
||||
private SmsLocalSmsClientImpl smsLocalSmsClient;
|
||||
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
smsLocalSmsClient = new SmsLocalSmsClientImpl(smslocalSmsProperties);
|
||||
when(smslocalSmsProperties.getApiKey()).thenReturn("2");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSendMessage() {
|
||||
assertEquals("smslocal", smsLocalSmsClient.getType());
|
||||
assertTrue(smsLocalSmsClient.checkConfig());
|
||||
//
|
||||
NoticeReceiver noticeReceiver = new NoticeReceiver();
|
||||
noticeReceiver.setPhone("13888888888");
|
||||
|
||||
SingleAlert singleAlert = new SingleAlert();
|
||||
singleAlert.setContent("test");
|
||||
|
||||
GroupAlert groupAlert = new GroupAlert();
|
||||
groupAlert.setAlerts(Lists.newArrayList(singleAlert));
|
||||
|
||||
assertThrows(SendMessageException.class,
|
||||
() -> smsLocalSmsClient.sendMessage(noticeReceiver, null, groupAlert));
|
||||
}
|
||||
|
||||
}
|
||||
-85
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.alert.service.impl;
|
||||
|
||||
import org.apache.hertzbeat.alert.config.UniSmsProperties;
|
||||
import org.apache.hertzbeat.common.entity.alerter.GroupAlert;
|
||||
import org.apache.hertzbeat.common.entity.alerter.NoticeReceiver;
|
||||
import org.apache.hertzbeat.common.support.exception.SendMessageException;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
|
||||
/**
|
||||
* Test case for {@link UniSmsClientImpl}
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class UniSmsClientImplTest {
|
||||
|
||||
@Mock
|
||||
private UniSmsProperties uniSmsProperties;
|
||||
|
||||
private UniSmsClientImpl uniSmsClient;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
uniSmsClient = new UniSmsClientImpl(uniSmsProperties);
|
||||
when(uniSmsProperties.getSignature()).thenReturn("2");
|
||||
when(uniSmsProperties.getTemplateId()).thenReturn("any(String.class)");
|
||||
when(uniSmsProperties.getAuthMode()).thenReturn("hmac");
|
||||
when(uniSmsProperties.getAccessKeyId()).thenReturn("hmac");
|
||||
when(uniSmsProperties.getAccessKeySecret()).thenReturn("hmac");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSendMessage() {
|
||||
assertEquals("unisms", uniSmsClient.getType());
|
||||
assertTrue(uniSmsClient.checkConfig());
|
||||
//
|
||||
NoticeReceiver noticeReceiver = new NoticeReceiver();
|
||||
noticeReceiver.setPhone("13888888888");
|
||||
|
||||
Map<String, String> commonLabels = new HashMap<>();
|
||||
commonLabels.put("instance", "");
|
||||
commonLabels.put("priority", "unknown");
|
||||
|
||||
Map<String, String> commonAnnotations = new HashMap<>();
|
||||
commonAnnotations.put("test", "test");
|
||||
|
||||
GroupAlert groupAlert = new GroupAlert();
|
||||
groupAlert.setCommonLabels(commonLabels);
|
||||
groupAlert.setCommonAnnotations(commonAnnotations);
|
||||
|
||||
assertThrows(SendMessageException.class,
|
||||
() -> uniSmsClient.sendMessage(noticeReceiver, null, groupAlert));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.alert.util;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
/**
|
||||
* Test case for {@link CryptoUtils}
|
||||
*/
|
||||
public class CryptoUtilsTest {
|
||||
|
||||
|
||||
@Test
|
||||
void testSha256Hex() {
|
||||
String sign = CryptoUtils.sha256Hex("Hello world.");
|
||||
assertEquals("aa3ec16e6acc809d8b2818662276256abfd2f1b441cb51574933f3d4bd115d11", sign);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testHmacSha256Base64Debug() {
|
||||
String signature = CryptoUtils.hmacSha256Base64("your-real-key", "your-real-data");
|
||||
assertEquals("8JrfX0v5Tt3s8PfI85o6jcf5XM3C+vLlMwvFp45LupU=", signature);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testHmacSha256Hex() {
|
||||
String signature = CryptoUtils.hmacSha256Hex("your-real-key", "your-real-data");;
|
||||
assertEquals("41878ccd7ecd795a2dd7ec39be7f33fed4be3ec75f5307689e39dd6f41fdbaac", signature);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,7 +19,6 @@ package org.apache.hertzbeat.alert.util;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import java.util.Optional;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -59,13 +58,4 @@ class DateUtilTest {
|
||||
actualTimestamp = DateUtil.getTimeStampFromFormat(date, format);
|
||||
assertFalse(actualTimestamp.isPresent());
|
||||
}
|
||||
|
||||
@Test
|
||||
void getZonedTimeStampFromFormat() {
|
||||
String dataStr = "2025/06/02 22:56:15 GMT+08:00";
|
||||
Long time = DateUtil.getZonedTimeStampFromFormat(dataStr, "yyyy/MM/dd HH:mm:ss 'GMT'XXX");
|
||||
assertNotNull(time);
|
||||
assertEquals(1748876175000L, time);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
# 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.
|
||||
wrapperVersion=3.3.2
|
||||
distributionType=only-script
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
|
||||
+3
-7
@@ -166,7 +166,7 @@ public class HttpCollectImpl extends AbstractCollect {
|
||||
case DispatchConstants.PARSE_XML_PATH ->
|
||||
parseResponseByXmlPath(resp, metrics, builder, responseTime);
|
||||
case DispatchConstants.PARSE_WEBSITE ->
|
||||
parseResponseByWebsite(resp, metrics, metrics.getHttp(), builder, responseTime, statusCode);
|
||||
parseResponseByWebsite(resp, metrics, metrics.getHttp(), builder, responseTime);
|
||||
case DispatchConstants.PARSE_SITE_MAP ->
|
||||
parseResponseBySiteMap(resp, metrics.getAliasFields(), builder);
|
||||
case DispatchConstants.PARSE_HEADER ->
|
||||
@@ -237,15 +237,11 @@ public class HttpCollectImpl extends AbstractCollect {
|
||||
}
|
||||
|
||||
private void parseResponseByWebsite(String resp, Metrics metrics, HttpProtocol http,
|
||||
CollectRep.MetricsData.Builder builder, Long responseTime, int statusCode) {
|
||||
CollectRep.MetricsData.Builder builder, Long responseTime) {
|
||||
CollectRep.ValueRow.Builder valueRowBuilder = CollectRep.ValueRow.newBuilder();
|
||||
int keywordNum = CollectUtil.countMatchKeyword(resp, http.getKeyword());
|
||||
for (String alias : metrics.getAliasFields()) {
|
||||
if (CollectorConstants.STATUS_CODE.equalsIgnoreCase(alias)) {
|
||||
valueRowBuilder.addColumn(Integer.toString(statusCode));
|
||||
} else {
|
||||
addColumnForSummary(responseTime, valueRowBuilder, keywordNum, alias);
|
||||
}
|
||||
addColumnForSummary(responseTime, valueRowBuilder, keywordNum, alias);
|
||||
}
|
||||
builder.addValueRow(valueRowBuilder.build());
|
||||
}
|
||||
|
||||
+1
-3
@@ -72,13 +72,12 @@ import org.springframework.util.StringUtils;
|
||||
* prometheus auto collect
|
||||
*/
|
||||
@Slf4j
|
||||
public class PrometheusAutoCollectImpl implements PrometheusCollect {
|
||||
public class PrometheusAutoCollectImpl {
|
||||
|
||||
private final Set<Integer> defaultSuccessStatusCodes = Stream.of(HttpStatus.SC_OK, HttpStatus.SC_CREATED,
|
||||
HttpStatus.SC_ACCEPTED, HttpStatus.SC_MULTIPLE_CHOICES, HttpStatus.SC_MOVED_PERMANENTLY,
|
||||
HttpStatus.SC_MOVED_TEMPORARILY).collect(Collectors.toSet());
|
||||
|
||||
@Override
|
||||
public List<CollectRep.MetricsData> collect(CollectRep.MetricsData.Builder builder,
|
||||
Metrics metrics) {
|
||||
try {
|
||||
@@ -140,7 +139,6 @@ public class PrometheusAutoCollectImpl implements PrometheusCollect {
|
||||
return Collections.singletonList(builder.build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String supportProtocol() {
|
||||
return DispatchConstants.PROTOCOL_PROMETHEUS;
|
||||
}
|
||||
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.collector.collect.prometheus;
|
||||
|
||||
import org.apache.hertzbeat.common.entity.job.Metrics;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Prometheus metrics collector interface
|
||||
*/
|
||||
public interface PrometheusCollect {
|
||||
|
||||
/**
|
||||
* Collect prometheus metrics data
|
||||
* @param builder metrics data builder
|
||||
* @param metrics metrics config
|
||||
* @return list of metrics data
|
||||
*/
|
||||
List<CollectRep.MetricsData> collect(CollectRep.MetricsData.Builder builder, Metrics metrics);
|
||||
|
||||
/**
|
||||
* Get the protocol name this collector supported
|
||||
* @return protocol name
|
||||
*/
|
||||
String supportProtocol();
|
||||
}
|
||||
-308
@@ -1,308 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.collector.collect.prometheus;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.hertzbeat.collector.collect.common.http.CommonHttpClient;
|
||||
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.apache.hertzbeat.collector.util.CollectUtil;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.constants.NetworkConstants;
|
||||
import org.apache.hertzbeat.common.constants.SignConstants;
|
||||
import org.apache.hertzbeat.common.entity.job.Metrics;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.PrometheusProtocol;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.util.Base64Util;
|
||||
import org.apache.hertzbeat.common.util.CommonUtil;
|
||||
import org.apache.hertzbeat.common.util.IpDomainUtil;
|
||||
import org.apache.http.HttpHeaders;
|
||||
import org.apache.http.HttpHost;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.apache.http.auth.AuthScope;
|
||||
import org.apache.http.auth.UsernamePasswordCredentials;
|
||||
import org.apache.http.client.AuthCache;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.CredentialsProvider;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpUriRequest;
|
||||
import org.apache.http.client.methods.RequestBuilder;
|
||||
import org.apache.http.client.protocol.HttpClientContext;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.auth.DigestScheme;
|
||||
import org.apache.http.impl.client.BasicAuthCache;
|
||||
import org.apache.http.impl.client.BasicCredentialsProvider;
|
||||
import org.apache.http.protocol.HttpContext;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InterruptedIOException;
|
||||
import java.net.ConnectException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import javax.net.ssl.SSLException;
|
||||
|
||||
import static org.apache.hertzbeat.common.constants.SignConstants.RIGHT_DASH;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class PrometheusProxyCollectImpl implements PrometheusCollect {
|
||||
|
||||
private final Set<Integer> defaultSuccessStatusCodes = Stream.of(HttpStatus.SC_OK, HttpStatus.SC_CREATED,
|
||||
HttpStatus.SC_ACCEPTED, HttpStatus.SC_MULTIPLE_CHOICES, HttpStatus.SC_MOVED_PERMANENTLY,
|
||||
HttpStatus.SC_MOVED_TEMPORARILY).collect(Collectors.toSet());
|
||||
|
||||
public static final String RAW_TEXT_CONTENT_FIELD_NAME = "raw_text_content";
|
||||
|
||||
@Override
|
||||
public List<CollectRep.MetricsData> collect(CollectRep.MetricsData.Builder builder, Metrics metrics) {
|
||||
PrometheusProtocol prometheusProtocol = metrics.getPrometheus();
|
||||
HttpUriRequest request;
|
||||
try {
|
||||
validateParams(metrics);
|
||||
} catch (Exception e) {
|
||||
builder.setCode(CollectRep.Code.FAIL);
|
||||
builder.setMsg(e.getMessage());
|
||||
return Collections.singletonList(builder.build());
|
||||
}
|
||||
|
||||
HttpContext httpContext = createHttpContext(prometheusProtocol);
|
||||
request = createHttpRequest(prometheusProtocol);
|
||||
|
||||
try (CloseableHttpResponse response = CommonHttpClient.getHttpClient().execute(request, httpContext)) {
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
log.debug("Prometheus proxy collect, response status: {}", statusCode);
|
||||
|
||||
if (!defaultSuccessStatusCodes.contains(statusCode)) {
|
||||
builder.setCode(CollectRep.Code.FAIL);
|
||||
builder.setMsg(NetworkConstants.STATUS_CODE + SignConstants.BLANK + statusCode);
|
||||
return Collections.singletonList(builder.build());
|
||||
}
|
||||
|
||||
String rawTextContent = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
|
||||
|
||||
builder.clearFields();
|
||||
builder.clearValues();
|
||||
|
||||
CollectRep.Field rawDataField = CollectRep.Field.newBuilder()
|
||||
.setName(RAW_TEXT_CONTENT_FIELD_NAME)
|
||||
.setType(CommonConstants.TYPE_STRING)
|
||||
.build();
|
||||
builder.addField(rawDataField);
|
||||
|
||||
CollectRep.ValueRow.Builder valueRowBuilder = CollectRep.ValueRow.newBuilder();
|
||||
valueRowBuilder.addColumn(rawTextContent);
|
||||
builder.addValueRow(valueRowBuilder.build());
|
||||
|
||||
builder.setCode(CollectRep.Code.SUCCESS);
|
||||
} catch (ClientProtocolException e1) {
|
||||
String errorMsg = CommonUtil.getMessageFromThrowable(e1);
|
||||
log.error("Prometheus proxy collect error: {}. Host: {}, Port: {}", errorMsg, prometheusProtocol.getHost(), prometheusProtocol.getPort(), e1);
|
||||
builder.setCode(CollectRep.Code.UN_CONNECTABLE);
|
||||
builder.setMsg(errorMsg);
|
||||
} catch (UnknownHostException e2) {
|
||||
String errorMsg = CommonUtil.getMessageFromThrowable(e2);
|
||||
log.info("Prometheus proxy collect unknown host: {}. Host: {}", errorMsg, prometheusProtocol.getHost(), e2);
|
||||
builder.setCode(CollectRep.Code.UN_REACHABLE);
|
||||
builder.setMsg("unknown host:" + errorMsg);
|
||||
} catch (InterruptedIOException | ConnectException | SSLException e3) {
|
||||
String errorMsg = CommonUtil.getMessageFromThrowable(e3);
|
||||
log.info("Prometheus proxy collect connect error: {}. Host: {}, Port: {}", errorMsg, prometheusProtocol.getHost(), prometheusProtocol.getPort(), e3);
|
||||
builder.setCode(CollectRep.Code.UN_CONNECTABLE);
|
||||
builder.setMsg(errorMsg);
|
||||
} catch (IOException e4) {
|
||||
String errorMsg = CommonUtil.getMessageFromThrowable(e4);
|
||||
log.info("Prometheus proxy collect IO error: {}. Host: {}, Port: {}", errorMsg, prometheusProtocol.getHost(), prometheusProtocol.getPort(), e4);
|
||||
builder.setCode(CollectRep.Code.FAIL);
|
||||
builder.setMsg(errorMsg);
|
||||
} catch (Exception e) {
|
||||
String errorMsg = CommonUtil.getMessageFromThrowable(e);
|
||||
log.error("Prometheus proxy collect unknown error: {}. Host: {}, Port: {}", errorMsg, prometheusProtocol.getHost(), prometheusProtocol.getPort(), e);
|
||||
builder.setCode(CollectRep.Code.FAIL);
|
||||
builder.setMsg(errorMsg);
|
||||
} finally {
|
||||
if (request != null) {
|
||||
request.abort();
|
||||
}
|
||||
}
|
||||
return Collections.singletonList(builder.build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String supportProtocol() {
|
||||
return DispatchConstants.PROTOCOL_PROMETHEUS;
|
||||
}
|
||||
|
||||
private void validateParams(Metrics metrics) throws Exception {
|
||||
if (metrics == null || metrics.getPrometheus() == null) {
|
||||
throw new Exception("Prometheus collect must has prometheus params");
|
||||
}
|
||||
PrometheusProtocol protocol = metrics.getPrometheus();
|
||||
if (!StringUtils.hasText(protocol.getHost())
|
||||
|| !StringUtils.hasText(protocol.getPort())) {
|
||||
throw new Exception("Prometheus collect must has host and port params");
|
||||
}
|
||||
if (protocol.getPath() == null
|
||||
|| !StringUtils.hasText(protocol.getPath())
|
||||
|| !protocol.getPath().startsWith(RIGHT_DASH)) {
|
||||
protocol.setPath(protocol.getPath() == null ? RIGHT_DASH : RIGHT_DASH + protocol.getPath().trim());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* create httpContext
|
||||
* This method is adapted from PrometheusAutoCollectImpl
|
||||
* @param protocol prometheus protocol
|
||||
* @return context
|
||||
*/
|
||||
public HttpContext createHttpContext(PrometheusProtocol protocol) {
|
||||
PrometheusProtocol.Authorization auth = protocol.getAuthorization();
|
||||
if (auth != null && DispatchConstants.DIGEST_AUTH.equals(auth.getType())) {
|
||||
HttpClientContext clientContext = new HttpClientContext();
|
||||
if (StringUtils.hasText(auth.getDigestAuthUsername())
|
||||
&& StringUtils.hasText(auth.getDigestAuthPassword())) {
|
||||
CredentialsProvider provider = new BasicCredentialsProvider();
|
||||
UsernamePasswordCredentials credentials =
|
||||
new UsernamePasswordCredentials(auth.getDigestAuthUsername(), auth.getDigestAuthPassword());
|
||||
provider.setCredentials(AuthScope.ANY, credentials);
|
||||
AuthCache authCache = new BasicAuthCache();
|
||||
HttpHost targetHost = new HttpHost(protocol.getHost(), Integer.parseInt(protocol.getPort()));
|
||||
authCache.put(targetHost, new DigestScheme());
|
||||
clientContext.setCredentialsProvider(provider);
|
||||
clientContext.setAuthCache(authCache);
|
||||
return clientContext;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* create http request
|
||||
* This method is adapted from PrometheusAutoCollectImpl
|
||||
* @param protocol http params
|
||||
* @return http uri request
|
||||
*/
|
||||
public HttpUriRequest createHttpRequest(PrometheusProtocol protocol) {
|
||||
RequestBuilder requestBuilder = RequestBuilder.get();
|
||||
// params
|
||||
Map<String, String> params = protocol.getParams();
|
||||
if (params != null && !params.isEmpty()) {
|
||||
for (Map.Entry<String, String> param : params.entrySet()) {
|
||||
if (StringUtils.hasText(param.getValue())) {
|
||||
requestBuilder.addParameter(param.getKey(), param.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
requestBuilder.addHeader(HttpHeaders.CONNECTION, NetworkConstants.KEEP_ALIVE);
|
||||
requestBuilder.addHeader(HttpHeaders.USER_AGENT, NetworkConstants.USER_AGENT);
|
||||
// headers The custom request header is overwritten here
|
||||
Map<String, String> headers = protocol.getHeaders();
|
||||
if (headers != null && !headers.isEmpty()) {
|
||||
for (Map.Entry<String, String> header : headers.entrySet()) {
|
||||
if (StringUtils.hasText(header.getValue())) {
|
||||
requestBuilder.addHeader(CollectUtil.replaceUriSpecialChar(header.getKey()),
|
||||
CollectUtil.replaceUriSpecialChar(header.getValue()));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (headers == null || headers.keySet().stream().noneMatch(HttpHeaders.ACCEPT::equalsIgnoreCase)) {
|
||||
requestBuilder.addHeader(HttpHeaders.ACCEPT, MediaType.TEXT_PLAIN_VALUE + ";version=0.0.4,*/*;q=0.1");
|
||||
}
|
||||
|
||||
if (protocol.getAuthorization() != null) {
|
||||
PrometheusProtocol.Authorization authorization = protocol.getAuthorization();
|
||||
if (DispatchConstants.BEARER_TOKEN.equalsIgnoreCase(authorization.getType())) {
|
||||
if (StringUtils.hasText(authorization.getBearerTokenToken())) {
|
||||
String value = DispatchConstants.BEARER + " " + authorization.getBearerTokenToken();
|
||||
requestBuilder.addHeader(HttpHeaders.AUTHORIZATION, value);
|
||||
}
|
||||
} else if (DispatchConstants.BASIC_AUTH.equals(authorization.getType())) {
|
||||
if (StringUtils.hasText(authorization.getBasicAuthUsername())
|
||||
&& StringUtils.hasText(authorization.getBasicAuthPassword())) {
|
||||
String authStr = authorization.getBasicAuthUsername() + ":" + authorization.getBasicAuthPassword();
|
||||
String encodedAuth = Base64Util.encode(authStr);
|
||||
requestBuilder.addHeader(HttpHeaders.AUTHORIZATION, DispatchConstants.BASIC + " " + encodedAuth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.hasLength(protocol.getPayload())) {
|
||||
requestBuilder.setEntity(new StringEntity(protocol.getPayload(), StandardCharsets.UTF_8));
|
||||
if (headers == null || headers.keySet().stream().noneMatch(HttpHeaders.CONTENT_TYPE::equalsIgnoreCase)) {
|
||||
requestBuilder.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_PLAIN_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
String uriPath = CollectUtil.replaceUriSpecialChar(protocol.getPath());
|
||||
if (IpDomainUtil.isHasSchema(protocol.getHost())) {
|
||||
requestBuilder.setUri(protocol.getHost() + SignConstants.DOUBLE_MARK + protocol.getPort() + uriPath);
|
||||
} else {
|
||||
String ipAddressType = IpDomainUtil.checkIpAddressType(protocol.getHost());
|
||||
String baseUri = NetworkConstants.IPV6.equals(ipAddressType)
|
||||
? String.format("[%s]:%s%s", protocol.getHost(), protocol.getPort(), uriPath)
|
||||
: String.format("%s:%s%s", protocol.getHost(), protocol.getPort(), uriPath);
|
||||
boolean ssl = Boolean.parseBoolean(protocol.getSsl());
|
||||
if (ssl) {
|
||||
requestBuilder.setUri(NetworkConstants.HTTPS_HEADER + baseUri);
|
||||
} else {
|
||||
requestBuilder.setUri(NetworkConstants.HTTP_HEADER + baseUri);
|
||||
}
|
||||
}
|
||||
|
||||
// custom timeout
|
||||
int timeout = CollectUtil.getTimeout(protocol.getTimeout());
|
||||
if (timeout > 0) {
|
||||
RequestConfig requestConfig = RequestConfig.custom()
|
||||
.setConnectTimeout(timeout)
|
||||
.setSocketTimeout(timeout)
|
||||
.setConnectionRequestTimeout(timeout)
|
||||
.setRedirectsEnabled(true)
|
||||
.build();
|
||||
requestBuilder.setConfig(requestConfig);
|
||||
} else {
|
||||
RequestConfig requestConfig = RequestConfig.custom()
|
||||
.setRedirectsEnabled(true)
|
||||
.build();
|
||||
requestBuilder.setConfig(requestConfig);
|
||||
}
|
||||
return requestBuilder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* get collect instance
|
||||
* @return instance
|
||||
*/
|
||||
public static PrometheusProxyCollectImpl getInstance() {
|
||||
return PrometheusProxyCollectImpl.SingleInstance.INSTANCE;
|
||||
}
|
||||
|
||||
/**
|
||||
* static instance
|
||||
*/
|
||||
private static class SingleInstance {
|
||||
private static final PrometheusProxyCollectImpl INSTANCE = new PrometheusProxyCollectImpl();
|
||||
}
|
||||
}
|
||||
+2
-128
@@ -20,42 +20,24 @@ package org.apache.hertzbeat.collector.collect.sd;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.google.common.collect.Lists;
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.apache.hertzbeat.collector.collect.common.http.CommonHttpClient;
|
||||
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.apache.hertzbeat.collector.util.CollectUtil;
|
||||
import org.apache.hertzbeat.common.constants.NetworkConstants;
|
||||
import org.apache.hertzbeat.common.constants.SignConstants;
|
||||
import org.apache.hertzbeat.common.entity.job.Metrics;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.HttpProtocol;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.entity.sd.ConnectionConfig;
|
||||
import org.apache.hertzbeat.common.entity.sd.ServiceDiscoveryResponseEntity;
|
||||
import org.apache.hertzbeat.common.util.Base64Util;
|
||||
import org.apache.hertzbeat.common.util.CommonUtil;
|
||||
import org.apache.hertzbeat.common.util.JsonUtil;
|
||||
import org.apache.http.HttpHeaders;
|
||||
import org.apache.http.auth.AuthScope;
|
||||
import org.apache.http.auth.UsernamePasswordCredentials;
|
||||
import org.apache.http.client.CredentialsProvider;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpUriRequest;
|
||||
import org.apache.http.client.methods.RequestBuilder;
|
||||
import org.apache.http.client.protocol.HttpClientContext;
|
||||
import org.apache.http.impl.client.BasicCredentialsProvider;
|
||||
import org.apache.http.protocol.HttpContext;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.util.UriUtils;
|
||||
|
||||
|
||||
/**
|
||||
@@ -70,10 +52,9 @@ public class HttpSdCollectImpl extends AbstractCollect {
|
||||
@Override
|
||||
public void collect(CollectRep.MetricsData.Builder builder, Metrics metrics) {
|
||||
List<ConnectionConfig> configList = Lists.newArrayList();
|
||||
HttpUriRequest request = RequestBuilder.get().setUri(metrics.getHttp_sd().getUrl()).build();
|
||||
|
||||
HttpUriRequest request = createHttpRequest(metrics.getHttp_sd());
|
||||
HttpContext httpContext = createHttpContext(metrics.getHttp_sd());
|
||||
try (CloseableHttpResponse response = CommonHttpClient.getHttpClient().execute(request, httpContext)) {
|
||||
try (CloseableHttpResponse response = CommonHttpClient.getHttpClient().execute(request)) {
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
if (statusCode != 200) {
|
||||
log.warn("Failed to fetch sd...");
|
||||
@@ -132,111 +113,4 @@ public class HttpSdCollectImpl extends AbstractCollect {
|
||||
public String supportProtocol() {
|
||||
return DispatchConstants.PROTOCOL_HTTP_SD;
|
||||
}
|
||||
|
||||
/**
|
||||
* create httpContext
|
||||
*
|
||||
* @param httpSdProtocol http sd protocol
|
||||
* @return context
|
||||
*/
|
||||
public HttpContext createHttpContext(HttpProtocol httpSdProtocol) {
|
||||
HttpProtocol.Authorization auth = httpSdProtocol.getAuthorization();
|
||||
if (auth != null && DispatchConstants.DIGEST_AUTH.equals(auth.getType())) {
|
||||
HttpClientContext clientContext = new HttpClientContext();
|
||||
if (org.springframework.util.StringUtils.hasText(auth.getDigestAuthUsername())
|
||||
&& org.springframework.util.StringUtils.hasText(auth.getDigestAuthPassword())) {
|
||||
CredentialsProvider provider = new BasicCredentialsProvider();
|
||||
UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(auth.getDigestAuthUsername(),
|
||||
auth.getDigestAuthPassword());
|
||||
URL url;
|
||||
try {
|
||||
url = new URL(httpSdProtocol.getUrl());
|
||||
} catch (MalformedURLException e) {
|
||||
throw new IllegalArgumentException("Invalid URI format.", e);
|
||||
}
|
||||
int port = url.getPort() != -1 ? url.getPort() : ("https".equals(url.getProtocol()) ? 443 : 80);
|
||||
AuthScope authScope = new AuthScope(url.getHost(), port);
|
||||
provider.setCredentials(authScope, credentials);
|
||||
|
||||
clientContext.setCredentialsProvider(provider);
|
||||
return clientContext;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* create http request
|
||||
*
|
||||
* @param httpSdProtocol http request set
|
||||
* @return http uri request
|
||||
*/
|
||||
public HttpUriRequest createHttpRequest(HttpProtocol httpSdProtocol) {
|
||||
RequestBuilder requestBuilder = RequestBuilder.get();
|
||||
|
||||
// The default request header can be overridden if customized
|
||||
// keep-alive
|
||||
requestBuilder.addHeader(HttpHeaders.CONNECTION, NetworkConstants.KEEP_ALIVE);
|
||||
requestBuilder.addHeader(HttpHeaders.USER_AGENT, NetworkConstants.USER_AGENT);
|
||||
// headers The custom request header is overwritten here
|
||||
Map<String, String> headers = httpSdProtocol.getHeaders();
|
||||
if (headers != null && !headers.isEmpty()) {
|
||||
for (Map.Entry<String, String> header : headers.entrySet()) {
|
||||
if (org.springframework.util.StringUtils.hasText(header.getValue())) {
|
||||
requestBuilder.addHeader(header.getKey(), header.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
// add accept
|
||||
requestBuilder.addHeader(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE);
|
||||
|
||||
// add authorization
|
||||
if (httpSdProtocol.getAuthorization() != null) {
|
||||
HttpProtocol.Authorization authorization = httpSdProtocol.getAuthorization();
|
||||
if (DispatchConstants.BEARER_TOKEN.equalsIgnoreCase(authorization.getType())) {
|
||||
String value = DispatchConstants.BEARER + SignConstants.BLANK + authorization.getBearerTokenToken();
|
||||
requestBuilder.addHeader(HttpHeaders.AUTHORIZATION, value);
|
||||
} else if (DispatchConstants.BASIC_AUTH.equals(authorization.getType())) {
|
||||
if (org.springframework.util.StringUtils.hasText(authorization.getBasicAuthUsername())
|
||||
&& org.springframework.util.StringUtils.hasText(authorization.getBasicAuthPassword())) {
|
||||
String authStr = authorization.getBasicAuthUsername() + SignConstants.DOUBLE_MARK + authorization.getBasicAuthPassword();
|
||||
String encodedAuth = Base64Util.encode(authStr);
|
||||
requestBuilder.addHeader(HttpHeaders.AUTHORIZATION, DispatchConstants.BASIC + SignConstants.BLANK + encodedAuth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// uri encode, default true
|
||||
boolean enableUrlEncoding = Boolean.parseBoolean(httpSdProtocol.getEnableUrlEncoding());
|
||||
if (enableUrlEncoding) {
|
||||
// if the url contains parameters directly
|
||||
if (httpSdProtocol.getUrl().contains("?")) {
|
||||
String path = httpSdProtocol.getUrl().substring(0, httpSdProtocol.getUrl().indexOf("?"));
|
||||
String query = httpSdProtocol.getUrl().substring(httpSdProtocol.getUrl().indexOf("?") + 1);
|
||||
httpSdProtocol.setUrl(UriUtils.encodePath(path, "UTF-8") + "?" + UriUtils.encodeQuery(query, "UTF-8"));
|
||||
} else {
|
||||
httpSdProtocol.setUrl(UriUtils.encodePath(httpSdProtocol.getUrl(), "UTF-8"));
|
||||
}
|
||||
}
|
||||
|
||||
// set uri
|
||||
try {
|
||||
requestBuilder.setUri(httpSdProtocol.getUrl());
|
||||
} catch (IllegalArgumentException e) {
|
||||
log.warn("Invalid URI with illegal characters: {}. User has disabled URL encoding, not applying any encoding.", httpSdProtocol.getUrl());
|
||||
throw e;
|
||||
}
|
||||
|
||||
// custom timeout
|
||||
int timeout = CollectUtil.getTimeout(httpSdProtocol.getTimeout(), 0);
|
||||
if (timeout > 0) {
|
||||
RequestConfig requestConfig = RequestConfig.custom()
|
||||
.setConnectTimeout(timeout)
|
||||
.setSocketTimeout(timeout)
|
||||
.setRedirectsEnabled(true)
|
||||
.build();
|
||||
requestBuilder.setConfig(requestConfig);
|
||||
}
|
||||
return requestBuilder.build();
|
||||
}
|
||||
}
|
||||
|
||||
-26
@@ -17,7 +17,6 @@
|
||||
|
||||
package org.apache.hertzbeat.collector.collect.http;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
@@ -26,7 +25,6 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.apache.hertzbeat.common.entity.job.Metrics;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.HttpProtocol;
|
||||
@@ -75,30 +73,6 @@ class HttpCollectImplTest {
|
||||
assert "http".equals(protocol);
|
||||
}
|
||||
|
||||
@Test
|
||||
void parseResponseByWebsite() {
|
||||
HttpProtocol http = HttpProtocol.builder().build();
|
||||
http.setMethod("GET");
|
||||
http.setHost("http://127.0.0.1");
|
||||
http.setUrl("/");
|
||||
http.setPort("8428");
|
||||
http.setParseType("website");
|
||||
http.setEnableUrlEncoding("true");
|
||||
Metrics metrics = Metrics.builder()
|
||||
.http(http)
|
||||
.aliasFields(Lists.newArrayList("responseTime", "keyword", "statusCode"))
|
||||
.build();
|
||||
CollectRep.MetricsData.Builder builder = CollectRep.MetricsData.newBuilder();
|
||||
httpCollectImpl.collect(builder, metrics);
|
||||
|
||||
assertNotNull(builder.getValuesList());
|
||||
for (CollectRep.ValueRow row : builder.getValuesList()) {
|
||||
assertNotNull(row.getColumns(0));
|
||||
assertEquals(row.getColumns(1), "0");
|
||||
assertEquals(row.getColumns(2), "200");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void parseResponseByXmlPath() throws Exception {
|
||||
// Create a sample XML response
|
||||
|
||||
+4
-6
@@ -19,7 +19,6 @@ package org.apache.hertzbeat.collector.collect.sd;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.nullable;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -46,7 +45,6 @@ import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.message.BasicStatusLine;
|
||||
import org.apache.http.protocol.HttpContext;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
@@ -106,7 +104,7 @@ class HttpSdCollectImplTest {
|
||||
try (MockedStatic<CommonHttpClient> mockedHttpClient = Mockito.mockStatic(CommonHttpClient.class)) {
|
||||
mockedHttpClient.when(CommonHttpClient::getHttpClient).thenReturn(httpClient);
|
||||
|
||||
when(httpClient.execute(any(HttpUriRequest.class), nullable(HttpContext.class))).thenReturn(httpResponse);
|
||||
when(httpClient.execute(any(HttpUriRequest.class))).thenReturn(httpResponse);
|
||||
|
||||
StatusLine statusLine = new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK");
|
||||
when(httpResponse.getStatusLine()).thenReturn(statusLine);
|
||||
@@ -137,7 +135,7 @@ class HttpSdCollectImplTest {
|
||||
try (MockedStatic<CommonHttpClient> mockedHttpClient = Mockito.mockStatic(CommonHttpClient.class)) {
|
||||
mockedHttpClient.when(CommonHttpClient::getHttpClient).thenReturn(httpClient);
|
||||
|
||||
when(httpClient.execute(any(HttpUriRequest.class), nullable(HttpContext.class))).thenReturn(httpResponse);
|
||||
when(httpClient.execute(any(HttpUriRequest.class))).thenReturn(httpResponse);
|
||||
|
||||
StatusLine statusLine = new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 404, "Not Found");
|
||||
when(httpResponse.getStatusLine()).thenReturn(statusLine);
|
||||
@@ -160,7 +158,7 @@ class HttpSdCollectImplTest {
|
||||
|
||||
mockedHttpClient.when(CommonHttpClient::getHttpClient).thenReturn(httpClient);
|
||||
|
||||
when(httpClient.execute(any(HttpUriRequest.class), nullable(HttpContext.class))).thenThrow(testException);
|
||||
when(httpClient.execute(any(HttpUriRequest.class))).thenThrow(testException);
|
||||
mockedCommonUtil.when(() -> CommonUtil.getMessageFromThrowable(any(Throwable.class)))
|
||||
.thenReturn(exceptionMessage);
|
||||
|
||||
@@ -179,7 +177,7 @@ class HttpSdCollectImplTest {
|
||||
try (MockedStatic<CommonHttpClient> mockedHttpClient = Mockito.mockStatic(CommonHttpClient.class)) {
|
||||
mockedHttpClient.when(CommonHttpClient::getHttpClient).thenReturn(httpClient);
|
||||
|
||||
when(httpClient.execute(any(HttpUriRequest.class), nullable(HttpContext.class))).thenReturn(httpResponse);
|
||||
when(httpClient.execute(any(HttpUriRequest.class))).thenReturn(httpResponse);
|
||||
|
||||
StatusLine statusLine = new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 200, "OK");
|
||||
when(httpResponse.getStatusLine()).thenReturn(statusLine);
|
||||
|
||||
+4
-29
@@ -115,10 +115,6 @@ public class MetricsCollect implements Runnable, Comparable<MetricsCollect> {
|
||||
* Whether it is a service discovery job, true is yes, false is no
|
||||
*/
|
||||
protected boolean isSd;
|
||||
/**
|
||||
* Whether to use the Prometheus proxy
|
||||
*/
|
||||
protected boolean prometheusProxyMode;
|
||||
|
||||
protected List<UnitConvert> unitConvertList;
|
||||
|
||||
@@ -141,7 +137,6 @@ public class MetricsCollect implements Runnable, Comparable<MetricsCollect> {
|
||||
this.collectDataDispatch = collectDataDispatch;
|
||||
this.isCyclic = job.isCyclic();
|
||||
this.isSd = job.isSd();
|
||||
this.prometheusProxyMode = job.isPrometheusProxyMode();
|
||||
this.unitConvertList = unitConvertList;
|
||||
// Temporary one-time tasks are executed with high priority
|
||||
if (isCyclic) {
|
||||
@@ -158,31 +153,11 @@ public class MetricsCollect implements Runnable, Comparable<MetricsCollect> {
|
||||
CollectRep.MetricsData.Builder response = CollectRep.MetricsData.newBuilder();
|
||||
response.setApp(app).setId(id).setTenantId(tenantId)
|
||||
.setLabels(labels).setAnnotations(annotations).addMetadataAll(metadata);
|
||||
// for prometheus auto or proxy mode
|
||||
// for prometheus auto
|
||||
if (DispatchConstants.PROTOCOL_PROMETHEUS.equalsIgnoreCase(metrics.getProtocol())) {
|
||||
List<CollectRep.MetricsData> metricsData;
|
||||
|
||||
// TODO: Refactor Prometheus metrics collection logic.
|
||||
// The current implementation for proxy mode and auto mode needs review and potential simplification.
|
||||
// Consider a more unified approach or clarify the conditions for each mode.
|
||||
/*
|
||||
// TODO USE PROXY MODE
|
||||
if (prometheusProxyMode) {
|
||||
List<CollectRep.MetricsData> proxyData = PrometheusProxyCollectImpl.getInstance().collect(response, metrics);
|
||||
List<CollectRep.MetricsData> autoData = PrometheusAutoCollectImpl.getInstance().collect(response, metrics);
|
||||
metricsData = new LinkedList<>();
|
||||
if (proxyData != null) {
|
||||
metricsData.addAll(proxyData);
|
||||
}
|
||||
if (autoData != null) {
|
||||
metricsData.addAll(autoData);
|
||||
}
|
||||
} else {
|
||||
metricsData = PrometheusAutoCollectImpl.getInstance().collect(response, metrics);
|
||||
}
|
||||
*/
|
||||
metricsData = PrometheusAutoCollectImpl.getInstance().collect(response, metrics);
|
||||
validateResponse(metricsData == null ? null : metricsData.stream().findFirst().orElse(null));
|
||||
List<CollectRep.MetricsData> metricsData = PrometheusAutoCollectImpl
|
||||
.getInstance().collect(response, metrics);
|
||||
validateResponse(metricsData.stream().findFirst().orElse(null));
|
||||
collectDataDispatch.dispatchCollectData(timeout, metrics, metricsData);
|
||||
return;
|
||||
}
|
||||
|
||||
+1
-1
@@ -47,6 +47,6 @@ public interface CollectorConstants extends NetworkConstants {
|
||||
|
||||
String RESPONSE_TIME = "responseTime";
|
||||
|
||||
String STATUS_CODE = "statusCode";
|
||||
String STATUS_CODE = "StatusCode";
|
||||
|
||||
}
|
||||
Vendored
-259
@@ -1,259 +0,0 @@
|
||||
#!/bin/sh
|
||||
# ----------------------------------------------------------------------------
|
||||
# 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.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Apache Maven Wrapper startup batch script, version 3.3.2
|
||||
#
|
||||
# Optional ENV vars
|
||||
# -----------------
|
||||
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
|
||||
# MVNW_REPOURL - repo url base for downloading maven distribution
|
||||
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
|
||||
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
set -euf
|
||||
[ "${MVNW_VERBOSE-}" != debug ] || set -x
|
||||
|
||||
# OS specific support.
|
||||
native_path() { printf %s\\n "$1"; }
|
||||
case "$(uname)" in
|
||||
CYGWIN* | MINGW*)
|
||||
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
|
||||
native_path() { cygpath --path --windows "$1"; }
|
||||
;;
|
||||
esac
|
||||
|
||||
# set JAVACMD and JAVACCMD
|
||||
set_java_home() {
|
||||
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
|
||||
if [ -n "${JAVA_HOME-}" ]; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
JAVACCMD="$JAVA_HOME/jre/sh/javac"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
JAVACCMD="$JAVA_HOME/bin/javac"
|
||||
|
||||
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
|
||||
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
|
||||
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
else
|
||||
JAVACMD="$(
|
||||
'set' +e
|
||||
'unset' -f command 2>/dev/null
|
||||
'command' -v java
|
||||
)" || :
|
||||
JAVACCMD="$(
|
||||
'set' +e
|
||||
'unset' -f command 2>/dev/null
|
||||
'command' -v javac
|
||||
)" || :
|
||||
|
||||
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
|
||||
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# hash string like Java String::hashCode
|
||||
hash_string() {
|
||||
str="${1:-}" h=0
|
||||
while [ -n "$str" ]; do
|
||||
char="${str%"${str#?}"}"
|
||||
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
|
||||
str="${str#?}"
|
||||
done
|
||||
printf %x\\n $h
|
||||
}
|
||||
|
||||
verbose() { :; }
|
||||
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
|
||||
|
||||
die() {
|
||||
printf %s\\n "$1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
trim() {
|
||||
# MWRAPPER-139:
|
||||
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
|
||||
# Needed for removing poorly interpreted newline sequences when running in more
|
||||
# exotic environments such as mingw bash on Windows.
|
||||
printf "%s" "${1}" | tr -d '[:space:]'
|
||||
}
|
||||
|
||||
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
|
||||
while IFS="=" read -r key value; do
|
||||
case "${key-}" in
|
||||
distributionUrl) distributionUrl=$(trim "${value-}") ;;
|
||||
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
|
||||
esac
|
||||
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
|
||||
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
|
||||
|
||||
case "${distributionUrl##*/}" in
|
||||
maven-mvnd-*bin.*)
|
||||
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
|
||||
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
|
||||
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
|
||||
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
|
||||
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
|
||||
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
|
||||
*)
|
||||
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
|
||||
distributionPlatform=linux-amd64
|
||||
;;
|
||||
esac
|
||||
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
|
||||
;;
|
||||
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
|
||||
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
|
||||
esac
|
||||
|
||||
# apply MVNW_REPOURL and calculate MAVEN_HOME
|
||||
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
||||
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
|
||||
distributionUrlName="${distributionUrl##*/}"
|
||||
distributionUrlNameMain="${distributionUrlName%.*}"
|
||||
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
|
||||
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
|
||||
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
|
||||
|
||||
exec_maven() {
|
||||
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
|
||||
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
|
||||
}
|
||||
|
||||
if [ -d "$MAVEN_HOME" ]; then
|
||||
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
|
||||
exec_maven "$@"
|
||||
fi
|
||||
|
||||
case "${distributionUrl-}" in
|
||||
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
|
||||
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
|
||||
esac
|
||||
|
||||
# prepare tmp dir
|
||||
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
|
||||
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
|
||||
trap clean HUP INT TERM EXIT
|
||||
else
|
||||
die "cannot create temp dir"
|
||||
fi
|
||||
|
||||
mkdir -p -- "${MAVEN_HOME%/*}"
|
||||
|
||||
# Download and Install Apache Maven
|
||||
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
|
||||
verbose "Downloading from: $distributionUrl"
|
||||
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
|
||||
|
||||
# select .zip or .tar.gz
|
||||
if ! command -v unzip >/dev/null; then
|
||||
distributionUrl="${distributionUrl%.zip}.tar.gz"
|
||||
distributionUrlName="${distributionUrl##*/}"
|
||||
fi
|
||||
|
||||
# verbose opt
|
||||
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
|
||||
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
|
||||
|
||||
# normalize http auth
|
||||
case "${MVNW_PASSWORD:+has-password}" in
|
||||
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
|
||||
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
|
||||
esac
|
||||
|
||||
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
|
||||
verbose "Found wget ... using wget"
|
||||
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
|
||||
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
|
||||
verbose "Found curl ... using curl"
|
||||
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
|
||||
elif set_java_home; then
|
||||
verbose "Falling back to use Java to download"
|
||||
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
|
||||
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
|
||||
cat >"$javaSource" <<-END
|
||||
public class Downloader extends java.net.Authenticator
|
||||
{
|
||||
protected java.net.PasswordAuthentication getPasswordAuthentication()
|
||||
{
|
||||
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
|
||||
}
|
||||
public static void main( String[] args ) throws Exception
|
||||
{
|
||||
setDefault( new Downloader() );
|
||||
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
|
||||
}
|
||||
}
|
||||
END
|
||||
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
|
||||
verbose " - Compiling Downloader.java ..."
|
||||
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
|
||||
verbose " - Running Downloader.java ..."
|
||||
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
|
||||
fi
|
||||
|
||||
# If specified, validate the SHA-256 sum of the Maven distribution zip file
|
||||
if [ -n "${distributionSha256Sum-}" ]; then
|
||||
distributionSha256Result=false
|
||||
if [ "$MVN_CMD" = mvnd.sh ]; then
|
||||
echo "Checksum validation is not supported for maven-mvnd." >&2
|
||||
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
|
||||
exit 1
|
||||
elif command -v sha256sum >/dev/null; then
|
||||
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
|
||||
distributionSha256Result=true
|
||||
fi
|
||||
elif command -v shasum >/dev/null; then
|
||||
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
|
||||
distributionSha256Result=true
|
||||
fi
|
||||
else
|
||||
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
|
||||
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ $distributionSha256Result = false ]; then
|
||||
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
|
||||
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# unzip and move
|
||||
if command -v unzip >/dev/null; then
|
||||
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
|
||||
else
|
||||
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
|
||||
fi
|
||||
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
|
||||
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
|
||||
|
||||
clean || :
|
||||
exec_maven "$@"
|
||||
Vendored
-149
@@ -1,149 +0,0 @@
|
||||
<# : batch portion
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||
@REM or more contributor license agreements. See the NOTICE file
|
||||
@REM distributed with this work for additional information
|
||||
@REM regarding copyright ownership. The ASF licenses this file
|
||||
@REM to you under the Apache License, Version 2.0 (the
|
||||
@REM "License"); you may not use this file except in compliance
|
||||
@REM with the License. You may obtain a copy of the License at
|
||||
@REM
|
||||
@REM http://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing,
|
||||
@REM software distributed under the License is distributed on an
|
||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@REM KIND, either express or implied. See the License for the
|
||||
@REM specific language governing permissions and limitations
|
||||
@REM under the License.
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Apache Maven Wrapper startup batch script, version 3.3.2
|
||||
@REM
|
||||
@REM Optional ENV vars
|
||||
@REM MVNW_REPOURL - repo url base for downloading maven distribution
|
||||
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
|
||||
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
|
||||
@SET __MVNW_CMD__=
|
||||
@SET __MVNW_ERROR__=
|
||||
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
|
||||
@SET PSModulePath=
|
||||
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
|
||||
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
|
||||
)
|
||||
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
|
||||
@SET __MVNW_PSMODULEP_SAVE=
|
||||
@SET __MVNW_ARG0_NAME__=
|
||||
@SET MVNW_USERNAME=
|
||||
@SET MVNW_PASSWORD=
|
||||
@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
|
||||
@echo Cannot start maven from wrapper >&2 && exit /b 1
|
||||
@GOTO :EOF
|
||||
: end batch / begin powershell #>
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
if ($env:MVNW_VERBOSE -eq "true") {
|
||||
$VerbosePreference = "Continue"
|
||||
}
|
||||
|
||||
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
|
||||
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
|
||||
if (!$distributionUrl) {
|
||||
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
|
||||
}
|
||||
|
||||
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
|
||||
"maven-mvnd-*" {
|
||||
$USE_MVND = $true
|
||||
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
|
||||
$MVN_CMD = "mvnd.cmd"
|
||||
break
|
||||
}
|
||||
default {
|
||||
$USE_MVND = $false
|
||||
$MVN_CMD = $script -replace '^mvnw','mvn'
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
# apply MVNW_REPOURL and calculate MAVEN_HOME
|
||||
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
|
||||
if ($env:MVNW_REPOURL) {
|
||||
$MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
|
||||
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
|
||||
}
|
||||
$distributionUrlName = $distributionUrl -replace '^.*/',''
|
||||
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
|
||||
$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
|
||||
if ($env:MAVEN_USER_HOME) {
|
||||
$MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
|
||||
}
|
||||
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
|
||||
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
|
||||
|
||||
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
|
||||
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
|
||||
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
|
||||
exit $?
|
||||
}
|
||||
|
||||
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
|
||||
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
|
||||
}
|
||||
|
||||
# prepare tmp dir
|
||||
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
|
||||
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
|
||||
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
|
||||
trap {
|
||||
if ($TMP_DOWNLOAD_DIR.Exists) {
|
||||
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
|
||||
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
|
||||
}
|
||||
}
|
||||
|
||||
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
|
||||
|
||||
# Download and Install Apache Maven
|
||||
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
|
||||
Write-Verbose "Downloading from: $distributionUrl"
|
||||
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
|
||||
|
||||
$webclient = New-Object System.Net.WebClient
|
||||
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
|
||||
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
|
||||
}
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
|
||||
|
||||
# If specified, validate the SHA-256 sum of the Maven distribution zip file
|
||||
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
|
||||
if ($distributionSha256Sum) {
|
||||
if ($USE_MVND) {
|
||||
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
|
||||
}
|
||||
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
|
||||
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
|
||||
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
|
||||
}
|
||||
}
|
||||
|
||||
# unzip and move
|
||||
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
|
||||
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null
|
||||
try {
|
||||
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
|
||||
} catch {
|
||||
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
|
||||
Write-Error "fail to move MAVEN_HOME"
|
||||
}
|
||||
} finally {
|
||||
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
|
||||
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
|
||||
}
|
||||
|
||||
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
|
||||
@@ -142,58 +142,5 @@ public interface AiConstants {
|
||||
float TEMPERATURE = 0.7f;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Ollama constants
|
||||
*/
|
||||
interface OllamaConstants {
|
||||
/**
|
||||
* request role param
|
||||
*/
|
||||
String REQUEST_ROLE = "user";
|
||||
|
||||
/**
|
||||
* The model outputs the maximum tokens, with a maximum output of 8192 and a default value of 3072
|
||||
*/
|
||||
Integer MAX_TOKENS = 3072;
|
||||
|
||||
/**
|
||||
* The sampling temperature, which controls the randomness of the output, must be positive
|
||||
* The value ranges from 0.0 to 1.0, and cannot be equal to 0. The default value is 0.95. The larger the value,
|
||||
* the more random and creative the output will be. The smaller the value, the more stable or certain the output will be
|
||||
* You are advised to adjust top_p or temperature parameters based on application scenarios, but do not adjust the two parameters at the same time
|
||||
*/
|
||||
float TEMPERATURE = 0.7f;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* OpenRouter constants
|
||||
*/
|
||||
interface OpenRouterConstants {
|
||||
/**
|
||||
* OpenRouter Ai URL
|
||||
*/
|
||||
String URL = "https://openrouter.ai/api/v1/chat/completions";
|
||||
|
||||
/**
|
||||
* request role param
|
||||
*/
|
||||
String REQUEST_ROLE = "user";
|
||||
|
||||
/**
|
||||
* The model outputs the maximum tokens, with a maximum output of 8192 and a default value of 3072
|
||||
*/
|
||||
Integer MAX_TOKENS = 3072;
|
||||
|
||||
/**
|
||||
* The sampling temperature, which controls the randomness of the output, must be positive
|
||||
* The value ranges from 0.0 to 1.0, and cannot be equal to 0. The default value is 0.95. The larger the value,
|
||||
* the more random and creative the output will be. The smaller the value, the more stable or certain the output will be
|
||||
* You are advised to adjust top_p or temperature parameters based on application scenarios, but do not adjust the two parameters at the same time
|
||||
*/
|
||||
float TEMPERATURE = 0.7f;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-10
@@ -42,17 +42,8 @@ public enum AiTypeEnum {
|
||||
/**
|
||||
* Moonshot AI
|
||||
*/
|
||||
kimiAi,
|
||||
kimiAi;
|
||||
|
||||
/**
|
||||
* Ollama AI
|
||||
*/
|
||||
ollama,
|
||||
|
||||
/**
|
||||
* OpenRouter
|
||||
*/
|
||||
openRouter;
|
||||
|
||||
/**
|
||||
* get type
|
||||
|
||||
+2
-2
@@ -81,12 +81,12 @@ public class GroupAlert {
|
||||
|
||||
@Schema(title = "Common Annotations", example = "{\"summary\": \"High CPU usage detected\", \"description\": \"CPU usage is back to normal for server1\"}")
|
||||
@Convert(converter = JsonMapAttributeConverter.class)
|
||||
@Column(columnDefinition = "TEXT")
|
||||
@Column(length = 4096)
|
||||
private Map<String, String> commonAnnotations;
|
||||
|
||||
@Schema(title = "Alert Fingerprints", example = "[\"dxsdfdsf\"]")
|
||||
@Convert(converter = JsonStringListAttributeConverter.class)
|
||||
@Column(columnDefinition = "TEXT")
|
||||
@Column(length = 8192)
|
||||
private List<String> alertFingerprints;
|
||||
|
||||
@Schema(title = "The creator of this record", example = "tom")
|
||||
|
||||
@@ -138,11 +138,6 @@ public class Job {
|
||||
*/
|
||||
private boolean isSd = false;
|
||||
|
||||
/**
|
||||
* Whether to use the Prometheus proxy
|
||||
*/
|
||||
private boolean prometheusProxyMode = false;
|
||||
|
||||
/**
|
||||
* the collect data response metrics as env configmap for other collect use. ^o^xxx^o^
|
||||
*/
|
||||
|
||||
+16
-49
@@ -18,7 +18,6 @@
|
||||
package org.apache.hertzbeat.grafana.common;
|
||||
|
||||
import org.apache.hertzbeat.common.constants.ConfigConstants;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* Grafana Common Constants
|
||||
@@ -32,64 +31,32 @@ public interface GrafanaConstants {
|
||||
String REFRESH = "&refresh=15s";
|
||||
|
||||
String INSTANCE = "&var-instance=";
|
||||
|
||||
|
||||
String CREATE_DASHBOARD_API = "/api/dashboards/db";
|
||||
|
||||
|
||||
String DELETE_DASHBOARD_API = "/api/dashboards/uid/%s";
|
||||
|
||||
String DATASOURCE_BASE_NAME = "hertzbeat";
|
||||
|
||||
|
||||
String DATASOURCE_NAME = "hertzbeat-victoria-metrics";
|
||||
|
||||
String USE_DATASOURCE = "&var-ds=" + DATASOURCE_NAME;
|
||||
|
||||
String DATASOURCE_TYPE = "prometheus";
|
||||
|
||||
|
||||
String DATASOURCE_ACCESS = "proxy";
|
||||
|
||||
|
||||
String CREATE_DATASOURCE_API = "/api/datasources";
|
||||
|
||||
String QUERY_DATASOURCE_API = "/api/datasources/name/";
|
||||
|
||||
|
||||
String QUERY_DATASOURCE_API = "/api/datasources/name/" + DATASOURCE_NAME;
|
||||
|
||||
String GET_SERVICE_ACCOUNTS_API = "%s/api/serviceaccounts/search";
|
||||
|
||||
String ACCOUNT_NAME = ConfigConstants.SystemConstant.PROJECT_NAME;
|
||||
|
||||
|
||||
String ACCOUNT_ROLE = "Admin";
|
||||
|
||||
|
||||
String CREATE_SERVICE_ACCOUNT_API = "%s/api/serviceaccounts";
|
||||
|
||||
|
||||
String CREATE_SERVICE_TOKEN_API = "%s/api/serviceaccounts/%d/tokens";
|
||||
|
||||
String GRAFANA_CONFIG = "grafanaConfig";
|
||||
|
||||
/**
|
||||
* Generate data source name based on type and URL
|
||||
* @param type Data source type (vm or greptime)
|
||||
* @param url Data source URL
|
||||
* @return Generated unique data source name
|
||||
*/
|
||||
static String generateDatasourceName(String type, String url) {
|
||||
try {
|
||||
URL parsedUrl = new URL(url);
|
||||
String host = parsedUrl.getHost();
|
||||
int port = parsedUrl.getPort();
|
||||
|
||||
// Extract host without subdomain for cleaner names
|
||||
String hostPart = host != null ? host.replaceAll("^www\\.", "") : "localhost";
|
||||
|
||||
// Include port if it's not default
|
||||
String portPart = (port > 0 && port != 80 && port != 443) ? "-" + port : "";
|
||||
|
||||
return String.format("%s-%s-%s%s", DATASOURCE_BASE_NAME, type, hostPart, portPart);
|
||||
} catch (Exception e) {
|
||||
// Fallback to simple naming if URL parsing fails
|
||||
return String.format("%s-%s-%s", DATASOURCE_BASE_NAME, type, url.hashCode());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate USE_DATASOURCE parameter with dynamic datasource name
|
||||
* @param datasourceName The datasource name
|
||||
* @return USE_DATASOURCE parameter string
|
||||
*/
|
||||
static String generateUseDatasource(String datasourceName) {
|
||||
return "&var-ds=" + datasourceName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -45,7 +45,10 @@ public class GrafanaInit implements CommandLineRunner {
|
||||
if (grafanaProperties.enabled()) {
|
||||
log.info("grafana init start");
|
||||
try {
|
||||
String token = serviceAccountService.applyForToken();
|
||||
String token = serviceAccountService.getToken();
|
||||
if (token == null) {
|
||||
token = serviceAccountService.applyForToken();
|
||||
}
|
||||
datasourceService.existOrCreateDatasource(token);
|
||||
} catch (Exception e) {
|
||||
log.error("grafana init error", e);
|
||||
|
||||
+33
-104
@@ -22,6 +22,7 @@ import static org.apache.hertzbeat.grafana.common.GrafanaConstants.DELETE_DASHBO
|
||||
import static org.apache.hertzbeat.grafana.common.GrafanaConstants.INSTANCE;
|
||||
import static org.apache.hertzbeat.grafana.common.GrafanaConstants.KIOSK;
|
||||
import static org.apache.hertzbeat.grafana.common.GrafanaConstants.REFRESH;
|
||||
import static org.apache.hertzbeat.grafana.common.GrafanaConstants.USE_DATASOURCE;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -29,7 +30,6 @@ import java.util.Objects;
|
||||
|
||||
import org.apache.hertzbeat.common.entity.grafana.GrafanaDashboard;
|
||||
import org.apache.hertzbeat.common.util.JsonUtil;
|
||||
import org.apache.hertzbeat.grafana.common.GrafanaConstants;
|
||||
import org.apache.hertzbeat.grafana.config.GrafanaProperties;
|
||||
import org.apache.hertzbeat.grafana.dao.DashboardDao;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -63,15 +63,10 @@ public class DashboardService {
|
||||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
@Autowired
|
||||
private DatasourceService datasourceService;
|
||||
|
||||
/**
|
||||
* Creates or updates a dashboard in Grafana.
|
||||
* The "id" field will be removed from the dashboard JSON before sending
|
||||
* to Grafana to ensure new dashboards are created correctly.
|
||||
* Creates a new dashboard in Grafana.
|
||||
*
|
||||
* @param dashboardJson the JSON representation of the dashboard definition
|
||||
* @param dashboardJson the JSON representation of the dashboard
|
||||
* @param monitorId the ID of the monitor associated with the dashboard
|
||||
* @return ResponseEntity containing the response from Grafana
|
||||
*/
|
||||
@@ -89,31 +84,11 @@ public class DashboardService {
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
headers.setBearerAuth(token);
|
||||
|
||||
Map<String, Object> dashboardObjectMap;
|
||||
try {
|
||||
dashboardObjectMap = JsonUtil.fromJson(dashboardJson, Map.class);
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to parse dashboardJson. Monitor ID: {}. JSON: {}", monitorId, dashboardJson, e);
|
||||
throw new RuntimeException("Invalid dashboard JSON structure", e);
|
||||
}
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
body.put("dashboard", JsonUtil.fromJson(dashboardJson, Object.class));
|
||||
body.put("overwrite", true);
|
||||
|
||||
if (dashboardObjectMap == null) {
|
||||
log.error("Parsed dashboardJson is null. Monitor ID: {}. Original JSON: {}", monitorId, dashboardJson);
|
||||
throw new RuntimeException("Parsed dashboard JSON is null");
|
||||
}
|
||||
|
||||
if (dashboardObjectMap.containsKey("id")) {
|
||||
dashboardObjectMap.remove("id");
|
||||
log.debug("Removed 'id' field from dashboard JSON for monitorId: {}", monitorId);
|
||||
}
|
||||
|
||||
// Construct the full request payload for Grafana API
|
||||
Map<String, Object> requestPayload = new HashMap<>();
|
||||
requestPayload.put("dashboard", dashboardObjectMap);
|
||||
requestPayload.put("overwrite", true); // Overwrite if a dashboard with the same UID exists
|
||||
|
||||
String finalJsonPayload = JsonUtil.toJson(requestPayload);
|
||||
HttpEntity<String> requestEntity = new HttpEntity<>(finalJsonPayload, headers);
|
||||
HttpEntity<Map<String, Object>> requestEntity = new HttpEntity<>(body, headers);
|
||||
|
||||
try {
|
||||
ResponseEntity<String> response = restTemplate.postForEntity(url, requestEntity, String.class);
|
||||
@@ -122,49 +97,30 @@ public class DashboardService {
|
||||
GrafanaDashboard grafanaDashboard = JsonUtil.fromJson(response.getBody(), GrafanaDashboard.class);
|
||||
if (grafanaDashboard != null) {
|
||||
grafanaDashboard.setEnabled(true);
|
||||
|
||||
String currentDatasourceName = datasourceService.getCurrentDatasourceName();
|
||||
String useDatasource = currentDatasourceName != null
|
||||
? GrafanaConstants.generateUseDatasource(currentDatasourceName) : "";
|
||||
|
||||
String relativeDashboardUrl = grafanaDashboard.getUrl();
|
||||
if (relativeDashboardUrl != null && grafanaProperties.getUrl() != null && relativeDashboardUrl.startsWith(grafanaProperties.getUrl())) {
|
||||
relativeDashboardUrl = relativeDashboardUrl.substring(grafanaProperties.getUrl().length());
|
||||
}
|
||||
String fullDashboardUrl = grafanaProperties.exposeUrl().replaceAll("/$", "")
|
||||
+ (relativeDashboardUrl != null ? relativeDashboardUrl.replaceAll("^/", "") : "");
|
||||
|
||||
grafanaDashboard.setUrl(fullDashboardUrl + KIOSK + REFRESH + INSTANCE + monitorId + useDatasource);
|
||||
|
||||
grafanaDashboard.setUrl(grafanaProperties.exposeUrl()
|
||||
+ grafanaDashboard.getUrl().replace(grafanaProperties.getUrl(), "")
|
||||
+ KIOSK + REFRESH + INSTANCE + monitorId + USE_DATASOURCE);
|
||||
grafanaDashboard.setMonitorId(monitorId);
|
||||
dashboardDao.save(grafanaDashboard);
|
||||
log.info("Successfully created/updated Grafana dashboard for monitorId: {}. Response: {}", monitorId, response.getBody());
|
||||
} else {
|
||||
log.error("Failed to parse Grafana response into GrafanaDashboard object. MonitorId: {}. Response body: {}", monitorId, response.getBody());
|
||||
log.info("create dashboard success, token: {}", response.getBody());
|
||||
}
|
||||
return response;
|
||||
} else {
|
||||
log.error("Failed to create/update Grafana dashboard for monitorId: {}. Status: {}, Response: {}",
|
||||
monitorId, response.getStatusCode(), response.getBody());
|
||||
throw new RuntimeException("Failed to create/update Grafana dashboard: " + response.getStatusCode() + " - " + response.getBody());
|
||||
log.error("create dashboard error: {}", response.getStatusCode());
|
||||
throw new RuntimeException("create dashboard error");
|
||||
}
|
||||
} catch (HttpClientErrorException ex) {
|
||||
String responseBody = ex.getResponseBodyAsString();
|
||||
log.error("Grafana API request failed for monitorId: {}. Status: {}. URL: {}. Request: {}. Response: {}",
|
||||
monitorId, ex.getStatusCode(), url, finalJsonPayload, responseBody, ex);
|
||||
if (ex instanceof HttpClientErrorException.Forbidden) {
|
||||
throw new RuntimeException("Grafana Access Denied: " + responseBody, ex);
|
||||
} else if (ex instanceof HttpClientErrorException.NotFound) {
|
||||
throw new RuntimeException("Grafana API endpoint or resource not found: " + responseBody, ex);
|
||||
}
|
||||
throw new RuntimeException("Grafana API client error (" + ex.getStatusCode() + "): " + responseBody, ex);
|
||||
} catch (HttpClientErrorException.Forbidden ex) {
|
||||
log.error("Grafana Access denied to save dashboard", ex);
|
||||
throw new RuntimeException("Grafana Access denied to save dashboard", ex);
|
||||
} catch (HttpClientErrorException.NotFound ex){
|
||||
log.error("Grafana Dashboard not found", ex);
|
||||
throw new RuntimeException("Grafana Dashboard not found", ex);
|
||||
} catch (Exception ex) {
|
||||
log.error("An unexpected error occurred while creating/updating Grafana dashboard for monitorId: {}. URL: {}. Request: {}",
|
||||
monitorId, url, finalJsonPayload, ex);
|
||||
throw new RuntimeException("Error during Grafana dashboard operation: " + ex.getMessage(), ex);
|
||||
log.error("create dashboard error", ex);
|
||||
throw new RuntimeException("create dashboard error", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Deletes a dashboard in Grafana by monitor ID.
|
||||
*
|
||||
@@ -174,7 +130,6 @@ public class DashboardService {
|
||||
public void deleteDashboard(Long monitorId) {
|
||||
GrafanaDashboard grafanaDashboard = dashboardDao.findByMonitorId(monitorId);
|
||||
if (Objects.isNull(grafanaDashboard)) {
|
||||
log.info("No Grafana dashboard found for monitorId {} to delete.", monitorId);
|
||||
return;
|
||||
}
|
||||
String uid = grafanaDashboard.getUid();
|
||||
@@ -182,7 +137,6 @@ public class DashboardService {
|
||||
|
||||
if (grafanaDashboards.size() > 1) {
|
||||
dashboardDao.deleteByMonitorId(monitorId);
|
||||
log.info("Deleted hertzbeat dashboard record for monitorId: {}, Grafana dashboard with UID: {} still used by other monitors.", monitorId, uid);
|
||||
} else {
|
||||
String token = serviceAccountService.getToken();
|
||||
String url = grafanaProperties.getPrefix() + grafanaProperties.getUrl() + String.format(DELETE_DASHBOARD_API, uid);
|
||||
@@ -192,36 +146,19 @@ public class DashboardService {
|
||||
headers.setBearerAuth(token);
|
||||
|
||||
HttpEntity<Void> requestEntity = new HttpEntity<>(headers);
|
||||
dashboardDao.deleteByMonitorId(monitorId);
|
||||
|
||||
try {
|
||||
ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.DELETE, requestEntity, String.class);
|
||||
ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.DELETE, requestEntity, String.class);
|
||||
|
||||
if (response.getStatusCode().is2xxSuccessful()) {
|
||||
// Delete from local DB only after successful Grafana deletion
|
||||
dashboardDao.deleteByMonitorId(monitorId);
|
||||
log.info("Successfully deleted Grafana dashboard with UID: {} and corresponding hertzbeat record for monitorId: {}", uid, monitorId);
|
||||
} else {
|
||||
log.error("Failed to delete Grafana dashboard with UID: {}. Status: {}, Response: {}",
|
||||
uid, response.getStatusCode(), response.getBody());
|
||||
throw new RuntimeException("Failed to delete Grafana dashboard: " + response.getStatusCode() + " - " + response.getBody());
|
||||
}
|
||||
} catch (HttpClientErrorException ex) {
|
||||
String responseBody = ex.getResponseBodyAsString();
|
||||
log.error("Grafana API request failed during dashboard deletion for UID: {}. Status: {}. URL: {}. Response: {}",
|
||||
uid, ex.getStatusCode(), url, responseBody, ex);
|
||||
if (ex.getStatusCode() == org.springframework.http.HttpStatus.NOT_FOUND) {
|
||||
log.warn("Grafana dashboard with UID: {} not found during deletion attempt. Assuming already deleted. Deleting local record for monitorId: {}", uid, monitorId);
|
||||
dashboardDao.deleteByMonitorId(monitorId);
|
||||
} else {
|
||||
throw new RuntimeException("Grafana API client error during deletion (" + ex.getStatusCode() + "): " + responseBody, ex);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
log.error("An unexpected error occurred while deleting Grafana dashboard with UID: {}. URL: {}", uid, url, ex);
|
||||
throw new RuntimeException("Error during Grafana dashboard deletion: " + ex.getMessage(), ex);
|
||||
if (response.getStatusCode().is2xxSuccessful()) {
|
||||
log.info("delete dashboard success");
|
||||
} else {
|
||||
log.error("delete dashboard error: {}", response.getStatusCode());
|
||||
throw new RuntimeException("delete dashboard error");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves a dashboard by monitor ID.
|
||||
*
|
||||
@@ -234,22 +171,14 @@ public class DashboardService {
|
||||
|
||||
/**
|
||||
* Disables a Grafana dashboard by monitor ID.
|
||||
* (This only updates the local HertzBeat database flag, does not interact with Grafana API)
|
||||
*
|
||||
* @param monitorId the ID of the monitor associated with the dashboard
|
||||
*/
|
||||
public void closeGrafanaDashboard(Long monitorId) {
|
||||
GrafanaDashboard grafanaDashboard = dashboardDao.findByMonitorId(monitorId);
|
||||
if (grafanaDashboard != null) {
|
||||
if (grafanaDashboard.isEnabled()) { // Only save if there's a change
|
||||
grafanaDashboard.setEnabled(false);
|
||||
dashboardDao.save(grafanaDashboard);
|
||||
log.info("Disabled Grafana dashboard link in HertzBeat for monitorId: {}", monitorId);
|
||||
} else {
|
||||
log.info("Grafana dashboard link for monitorId: {} was already disabled.", monitorId);
|
||||
}
|
||||
} else {
|
||||
log.warn("No Grafana dashboard record found for monitorId {} to disable.", monitorId);
|
||||
grafanaDashboard.setEnabled(false);
|
||||
dashboardDao.save(grafanaDashboard);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+27
-140
@@ -19,18 +19,12 @@ package org.apache.hertzbeat.grafana.service;
|
||||
|
||||
import static org.apache.hertzbeat.grafana.common.GrafanaConstants.CREATE_DATASOURCE_API;
|
||||
import static org.apache.hertzbeat.grafana.common.GrafanaConstants.DATASOURCE_ACCESS;
|
||||
import static org.apache.hertzbeat.grafana.common.GrafanaConstants.DATASOURCE_NAME;
|
||||
import static org.apache.hertzbeat.grafana.common.GrafanaConstants.DATASOURCE_TYPE;
|
||||
import static org.apache.hertzbeat.grafana.common.GrafanaConstants.QUERY_DATASOURCE_API;
|
||||
import static org.apache.hertzbeat.grafana.common.GrafanaConstants.generateDatasourceName;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.hertzbeat.common.util.JsonUtil;
|
||||
import org.apache.hertzbeat.grafana.config.GrafanaProperties;
|
||||
import org.apache.hertzbeat.warehouse.store.history.tsdb.vm.VictoriaMetricsProperties;
|
||||
import org.apache.hertzbeat.warehouse.store.history.tsdb.greptime.GreptimeProperties;
|
||||
import org.apache.hertzbeat.warehouse.store.history.vm.VictoriaMetricsProperties;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
@@ -42,8 +36,7 @@ import org.springframework.web.client.HttpClientErrorException;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
/**
|
||||
* Service for managing Grafana datasources.
|
||||
* This service checks if a datasource exists and creates it if not.
|
||||
* Service for managing Grafana datasource.
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@@ -51,163 +44,57 @@ public class DatasourceService {
|
||||
|
||||
private final GrafanaProperties grafanaProperties;
|
||||
private final VictoriaMetricsProperties warehouseProperties;
|
||||
private final GreptimeProperties greptimeProperties;
|
||||
private final RestTemplate restTemplate;
|
||||
|
||||
@Autowired
|
||||
public DatasourceService(
|
||||
GrafanaProperties grafanaProperties,
|
||||
VictoriaMetricsProperties warehouseProperties,
|
||||
GreptimeProperties greptimeProperties,
|
||||
RestTemplate restTemplate
|
||||
) {
|
||||
this.grafanaProperties = grafanaProperties;
|
||||
this.warehouseProperties = warehouseProperties;
|
||||
this.greptimeProperties = greptimeProperties;
|
||||
this.restTemplate = restTemplate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new datasource in Grafana.
|
||||
*/
|
||||
public void existOrCreateDatasource(String token) {
|
||||
boolean vmEnabled = warehouseProperties.enabled();
|
||||
boolean greptimeEnabled = greptimeProperties.enabled();
|
||||
|
||||
if (vmEnabled && greptimeEnabled) {
|
||||
throw new IllegalStateException("Conflict: Both VictoriaMetrics and Greptime are enabled, only one can be used for Grafana datasource");
|
||||
}
|
||||
|
||||
if (!vmEnabled && !greptimeEnabled) {
|
||||
log.info("HertzBeat warehouse config not enabled");
|
||||
if (!warehouseProperties.enabled()) {
|
||||
log.info("HertzBeat VictoriaMetrics config not enabled");
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine datasource type and URL
|
||||
String datasourceType;
|
||||
String datasourceUrl;
|
||||
|
||||
if (vmEnabled) {
|
||||
datasourceType = "vm";
|
||||
datasourceUrl = warehouseProperties.url();
|
||||
} else {
|
||||
datasourceType = "greptime";
|
||||
datasourceUrl = greptimeProperties.httpEndpoint();
|
||||
}
|
||||
|
||||
// Generate unique datasource name
|
||||
String datasourceName = generateDatasourceName(datasourceType, datasourceUrl);
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
headers.setBearerAuth(token);
|
||||
|
||||
String queryUrl = grafanaProperties.getPrefix() + grafanaProperties.getUrl() + QUERY_DATASOURCE_API + datasourceName;
|
||||
// query if exist this datasource
|
||||
String queryUrl = grafanaProperties.getPrefix() + grafanaProperties.getUrl() + QUERY_DATASOURCE_API;
|
||||
HttpEntity<Void> entity = new HttpEntity<>(headers);
|
||||
|
||||
try {
|
||||
ResponseEntity<String> response = restTemplate.exchange(queryUrl, HttpMethod.GET, entity, String.class);
|
||||
if (response.getStatusCode().is2xxSuccessful()) {
|
||||
log.info("{} datasource already exists", datasourceName);
|
||||
return;
|
||||
log.info("{} datasource exist", DATASOURCE_NAME);
|
||||
}
|
||||
} catch (HttpClientErrorException.NotFound notFound) {
|
||||
log.info("Datasource {} not found, creating new one", datasourceName);
|
||||
String createUrl = grafanaProperties.getPrefix() + grafanaProperties.getUrl() + CREATE_DATASOURCE_API;
|
||||
String body = String.format(
|
||||
"{\"name\":\"%s\",\"type\":\"%s\",\"access\":\"%s\",\"url\":\"%s\",\"basicAuth\":%s}",
|
||||
DATASOURCE_NAME, DATASOURCE_TYPE, DATASOURCE_ACCESS, warehouseProperties.url(), false
|
||||
);
|
||||
HttpEntity<String> createEntity = new HttpEntity<>(body, headers);
|
||||
try {
|
||||
ResponseEntity<String> createResponse = restTemplate.postForEntity(createUrl, createEntity, String.class);
|
||||
if (createResponse.getStatusCode().is2xxSuccessful()) {
|
||||
log.info("Create datasource success");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Create datasource error", e);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Query datasource error", e);
|
||||
return;
|
||||
}
|
||||
|
||||
// Create new datasource
|
||||
createDatasource(token, datasourceName, datasourceUrl, datasourceType);
|
||||
|
||||
}
|
||||
|
||||
public void createDatasource(String token, String datasourceName, String datasourceUrl, String datasourceType) {
|
||||
String createUrl = grafanaProperties.getPrefix() + grafanaProperties.getUrl() + CREATE_DATASOURCE_API;
|
||||
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
headers.setBearerAuth(token);
|
||||
|
||||
DatasourceRequest datasourceRequest;
|
||||
if ("greptime".equals(datasourceType)) {
|
||||
datasourceUrl += "/v1/prometheus";
|
||||
Map<String, Object> jsonData = new HashMap<>();
|
||||
Map<String, Object> secureJsonData = new HashMap<>();
|
||||
jsonData.put("httpHeaderName1", "x-greptime-db-name");
|
||||
secureJsonData.put("httpHeaderValue1", greptimeProperties.database());
|
||||
datasourceRequest = new DatasourceRequest(
|
||||
datasourceName,
|
||||
DATASOURCE_TYPE,
|
||||
DATASOURCE_ACCESS,
|
||||
datasourceUrl,
|
||||
false,
|
||||
jsonData,
|
||||
secureJsonData
|
||||
);
|
||||
} else {
|
||||
datasourceRequest = new DatasourceRequest(
|
||||
datasourceName,
|
||||
DATASOURCE_TYPE,
|
||||
DATASOURCE_ACCESS,
|
||||
datasourceUrl,
|
||||
false,
|
||||
null,
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
String body = JsonUtil.toJson(datasourceRequest);
|
||||
HttpEntity<String> createEntity = new HttpEntity<>(body, headers);
|
||||
|
||||
ResponseEntity<String> createResponse = restTemplate.postForEntity(createUrl, createEntity, String.class);
|
||||
if (createResponse.getStatusCode().is2xxSuccessful()) {
|
||||
log.info("Create datasource success");
|
||||
}
|
||||
} catch (HttpClientErrorException.Conflict conflict) {
|
||||
log.info("Datasource already exists");
|
||||
} catch (Exception e) {
|
||||
log.error("Create datasource error", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Request object for creating a Grafana datasource.
|
||||
* Fields are annotated with @JsonInclude to exclude null values from serialization.
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public static class DatasourceRequest {
|
||||
public String name;
|
||||
public String type;
|
||||
public String access;
|
||||
public String url;
|
||||
public boolean basicAuth;
|
||||
public Map<String, Object> jsonData;
|
||||
public Map<String, Object> secureJsonData;
|
||||
|
||||
public DatasourceRequest(String name, String type, String access, String url, boolean basicAuth, Map<String, Object> jsonData, Map<String, Object> secureJsonData) {
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.access = access;
|
||||
this.url = url;
|
||||
this.basicAuth = basicAuth;
|
||||
this.jsonData = jsonData;
|
||||
this.secureJsonData = secureJsonData;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current active datasource name
|
||||
* @return Current datasource name or null if none active
|
||||
*/
|
||||
public String getCurrentDatasourceName() {
|
||||
boolean vmEnabled = warehouseProperties.enabled();
|
||||
boolean greptimeEnabled = greptimeProperties.enabled();
|
||||
|
||||
if (vmEnabled) {
|
||||
return generateDatasourceName("vm", warehouseProperties.url());
|
||||
} else if (greptimeEnabled) {
|
||||
return generateDatasourceName("greptime", greptimeProperties.httpEndpoint());
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,9 +52,4 @@ public class AiProperties {
|
||||
*/
|
||||
private String apiSecret;
|
||||
|
||||
/**
|
||||
* API URL for the Ollama AI service.
|
||||
*/
|
||||
private String apiUrl;
|
||||
|
||||
}
|
||||
|
||||
-81
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.manager.config;
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import org.apache.hertzbeat.warehouse.store.history.tsdb.greptime.GreptimeProperties;
|
||||
import org.apache.hertzbeat.warehouse.store.history.tsdb.vm.VictoriaMetricsProperties;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Configuration class for Prometheus Proxy.
|
||||
* This class determines whether to use PrometheusProxyCollectImpl or PrometheusAutoCollectImpl
|
||||
* based on the presence of GreptimeDB or VictoriaMetrics properties.
|
||||
*/
|
||||
@Component
|
||||
public class PrometheusProxyConfig {
|
||||
private static GreptimeProperties staticGreptimeProperties;
|
||||
private static VictoriaMetricsProperties staticVictoriaMetricsProperties;
|
||||
|
||||
private final GreptimeProperties greptimeProperties;
|
||||
private final VictoriaMetricsProperties victoriaMetricsProperties;
|
||||
|
||||
/**
|
||||
* Constructs the factory and injects warehouse properties.
|
||||
* Uses @Autowired(required = false) to allow these properties to be optional,
|
||||
* in case they are not configured or enabled in the warehouse module.
|
||||
*
|
||||
* @param greptimeProperties GreptimeDB configuration properties.
|
||||
* @param victoriaMetricsProperties VictoriaMetrics configuration properties.
|
||||
*/
|
||||
@Autowired
|
||||
public PrometheusProxyConfig(
|
||||
@Autowired(required = false) GreptimeProperties greptimeProperties,
|
||||
@Autowired(required = false) VictoriaMetricsProperties victoriaMetricsProperties) {
|
||||
this.greptimeProperties = greptimeProperties;
|
||||
this.victoriaMetricsProperties = victoriaMetricsProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes static fields with the injected properties after construction.
|
||||
* This allows the static getCollector method to access these configurations.
|
||||
*/
|
||||
@PostConstruct
|
||||
private void initStatic() {
|
||||
staticGreptimeProperties = this.greptimeProperties;
|
||||
staticVictoriaMetricsProperties = this.victoriaMetricsProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Judges whether to use PrometheusProxyCollectImpl or PrometheusAutoCollectImpl
|
||||
*/
|
||||
public boolean isPrometheusProxy() {
|
||||
if (staticGreptimeProperties != null && staticGreptimeProperties.enabled()) {
|
||||
return true;
|
||||
}
|
||||
if (staticVictoriaMetricsProperties != null && staticVictoriaMetricsProperties.enabled()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
-6
@@ -30,7 +30,6 @@ import org.apache.hertzbeat.common.entity.manager.CollectorMonitorBind;
|
||||
import org.apache.hertzbeat.common.entity.manager.Monitor;
|
||||
import org.apache.hertzbeat.common.entity.manager.Param;
|
||||
import org.apache.hertzbeat.common.entity.manager.ParamDefine;
|
||||
import org.apache.hertzbeat.manager.config.PrometheusProxyConfig;
|
||||
import org.apache.hertzbeat.manager.dao.CollectorDao;
|
||||
import org.apache.hertzbeat.manager.dao.CollectorMonitorBindDao;
|
||||
import org.apache.hertzbeat.manager.dao.MonitorDao;
|
||||
@@ -74,9 +73,6 @@ public class SchedulerInit implements CommandLineRunner {
|
||||
|
||||
@Autowired
|
||||
private CollectorMonitorBindDao collectorMonitorBindDao;
|
||||
|
||||
@Autowired
|
||||
private PrometheusProxyConfig prometheusProxyConfig;
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
@@ -103,8 +99,6 @@ public class SchedulerInit implements CommandLineRunner {
|
||||
boolean isStatic = CommonConstants.SCRAPE_STATIC.equals(monitor.getScrape()) || !StringUtils.hasText(monitor.getScrape());
|
||||
String app = isStatic ? monitor.getApp() : monitor.getScrape();
|
||||
Job appDefine = appService.getAppDefine(app);
|
||||
// set Prometheus proxy mode
|
||||
appDefine.setPrometheusProxyMode(prometheusProxyConfig.isPrometheusProxy());
|
||||
if (!isStatic) {
|
||||
appDefine.setSd(true);
|
||||
}
|
||||
|
||||
-95
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.manager.service.ai;
|
||||
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.hertzbeat.common.constants.AiConstants;
|
||||
import org.apache.hertzbeat.common.constants.AiTypeEnum;
|
||||
import org.apache.hertzbeat.manager.config.AiProperties;
|
||||
import org.apache.hertzbeat.manager.pojo.dto.AiMessage;
|
||||
import org.apache.hertzbeat.manager.pojo.dto.OpenAiRequestParamDTO;
|
||||
import org.apache.hertzbeat.manager.pojo.dto.OpenAiResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.codec.ServerSentEvent;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.reactive.function.BodyInserters;
|
||||
import org.springframework.web.reactive.function.client.ExchangeStrategies;
|
||||
import org.springframework.web.reactive.function.client.WebClient;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Ollama service
|
||||
*/
|
||||
@Service("OllamaServiceImpl")
|
||||
@ConditionalOnProperty(prefix = "ai", name = "type", havingValue = "ollama")
|
||||
@Slf4j
|
||||
public class OllamaAiService implements AiService{
|
||||
@Autowired
|
||||
private AiProperties aiProperties;
|
||||
|
||||
private WebClient webClient;
|
||||
|
||||
@PostConstruct
|
||||
private void init() {
|
||||
Assert.notNull(aiProperties.getApiUrl(), "Ollama API URL is null");
|
||||
this.webClient = WebClient.builder()
|
||||
.baseUrl(aiProperties.getApiUrl())
|
||||
.defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
|
||||
.exchangeStrategies(ExchangeStrategies.builder()
|
||||
.codecs(item -> item.defaultCodecs().maxInMemorySize(16 * 1024 * 1024))
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AiTypeEnum getType() {
|
||||
return AiTypeEnum.ollama;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flux<ServerSentEvent<String>> requestAi(String text) {
|
||||
checkParam(text, aiProperties.getModel());
|
||||
OpenAiRequestParamDTO ollamaParam = OpenAiRequestParamDTO.builder()
|
||||
.model(aiProperties.getModel())
|
||||
.stream(Boolean.TRUE)
|
||||
.maxTokens(AiConstants.OllamaConstants.MAX_TOKENS)
|
||||
.temperature(AiConstants.OllamaConstants.TEMPERATURE)
|
||||
.messages(List.of(new AiMessage(AiConstants.OllamaConstants.REQUEST_ROLE, text)))
|
||||
.build();
|
||||
|
||||
return webClient.post()
|
||||
.body(BodyInserters.fromValue(ollamaParam))
|
||||
.retrieve()
|
||||
.bodyToFlux(String.class)
|
||||
.filter(aiResponse -> !"[DONE]".equals(aiResponse))
|
||||
.map(OpenAiResponse::convertToResponse)
|
||||
.doOnError(error -> log.info("OllamaAiService.requestAi exception:{}", error.getMessage()));
|
||||
}
|
||||
|
||||
private void checkParam(String param, String model) {
|
||||
Assert.notNull(param, "text is null");
|
||||
Assert.notNull(model, "model is null");
|
||||
}
|
||||
}
|
||||
-97
@@ -1,97 +0,0 @@
|
||||
/*
|
||||
* 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.apache.hertzbeat.manager.service.ai;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.hertzbeat.common.constants.AiConstants;
|
||||
import org.apache.hertzbeat.common.constants.AiTypeEnum;
|
||||
import org.apache.hertzbeat.manager.config.AiProperties;
|
||||
import org.apache.hertzbeat.manager.pojo.dto.AiMessage;
|
||||
import org.apache.hertzbeat.manager.pojo.dto.OpenAiRequestParamDTO;
|
||||
import org.apache.hertzbeat.manager.pojo.dto.OpenAiResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.codec.ServerSentEvent;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.reactive.function.BodyInserters;
|
||||
import org.springframework.web.reactive.function.client.ExchangeStrategies;
|
||||
import org.springframework.web.reactive.function.client.WebClient;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* OpenRouter service
|
||||
*/
|
||||
@Service("OpenRouterServiceImpl")
|
||||
@ConditionalOnProperty(prefix = "ai", name = "type", havingValue = "openRouter")
|
||||
@Slf4j
|
||||
public class OpenRouterServiceImpl implements AiService {
|
||||
|
||||
@Autowired
|
||||
private AiProperties aiProperties;
|
||||
|
||||
private WebClient webClient;
|
||||
|
||||
@PostConstruct
|
||||
private void init() {
|
||||
this.webClient = WebClient.builder()
|
||||
.baseUrl(AiConstants.OpenRouterConstants.URL)
|
||||
.defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
|
||||
.defaultHeader(HttpHeaders.AUTHORIZATION, "Bearer " + aiProperties.getApiKey())
|
||||
.exchangeStrategies(ExchangeStrategies.builder()
|
||||
.codecs(item -> item.defaultCodecs().maxInMemorySize(16 * 1024 * 1024))
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AiTypeEnum getType() {
|
||||
return AiTypeEnum.openRouter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flux<ServerSentEvent<String>> requestAi(String text) {
|
||||
checkParam(text, aiProperties.getModel(), aiProperties.getApiKey());
|
||||
OpenAiRequestParamDTO openRouterParam = OpenAiRequestParamDTO.builder()
|
||||
.model(aiProperties.getModel())
|
||||
.stream(Boolean.TRUE)
|
||||
.maxTokens(AiConstants.OpenRouterConstants.MAX_TOKENS)
|
||||
.temperature(AiConstants.OpenRouterConstants.TEMPERATURE)
|
||||
.messages(List.of(new AiMessage(AiConstants.OpenRouterConstants.REQUEST_ROLE, text)))
|
||||
.build();
|
||||
|
||||
return webClient.post()
|
||||
.body(BodyInserters.fromValue(openRouterParam))
|
||||
.retrieve()
|
||||
.bodyToFlux(String.class)
|
||||
.filter(aiResponse -> !"[DONE]".equals(aiResponse))
|
||||
.map(OpenAiResponse::convertToResponse)
|
||||
.doOnError(error -> log.info("OpenRouterAiServiceImpl.requestAi exception:{}", error.getMessage()));
|
||||
}
|
||||
|
||||
private void checkParam(String param, String model, String apiKey) {
|
||||
Assert.notNull(param, "text is null");
|
||||
Assert.notNull(model, "model is null");
|
||||
Assert.notNull(apiKey, "ai.api-key is null");
|
||||
}
|
||||
}
|
||||
-3
@@ -120,9 +120,6 @@ public class BulletinServiceImpl implements BulletinService {
|
||||
List<BulletinMetricsData.Data> dataList = new ArrayList<>();
|
||||
for (Long monitorId : bulletin.getMonitorIds()) {
|
||||
Monitor monitor = monitorService.getMonitor(monitorId);
|
||||
if (null == monitor) {
|
||||
continue;
|
||||
}
|
||||
BulletinMetricsData.Data.DataBuilder dataBuilder = BulletinMetricsData.Data.builder()
|
||||
.monitorId(monitorId)
|
||||
.monitorName(monitor.getName())
|
||||
|
||||
@@ -265,7 +265,7 @@ grafana:
|
||||
|
||||
# See the documentation for details : https://hertzbeat.apache.org/zh-cn/docs/help/aiConfig
|
||||
ai:
|
||||
# AI Type:zhiPu、alibabaAi、kimiAi、sparkDesk、ollama、openRouter
|
||||
# AI Type:zhiPu、alibabaAi、kimiAi、sparkDesk
|
||||
type:
|
||||
# Model name:glm-4、qwen-turboo、moonshot-v1-8k、generalv3.5
|
||||
model:
|
||||
@@ -273,5 +273,3 @@ ai:
|
||||
api-key:
|
||||
#At present, only IFLYTEK large model needs to be filled in
|
||||
api-secret:
|
||||
# The URL of the ollama AI service
|
||||
api-url:
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
-- 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.
|
||||
|
||||
-- ensure every sql can rerun without error
|
||||
|
||||
-- Modify common_annotations column to TEXT (H2 TEXT is equivalent to CLOB)
|
||||
ALTER TABLE HZB_ALERT_GROUP ALTER COLUMN common_annotations CLOB;
|
||||
|
||||
-- Modify alert_fingerprints column to TEXT (H2 TEXT is equivalent to CLOB)
|
||||
ALTER TABLE HZB_ALERT_GROUP ALTER COLUMN alert_fingerprints CLOB;
|
||||
@@ -1,64 +0,0 @@
|
||||
-- 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.
|
||||
|
||||
-- ensure every sql can rerun without error
|
||||
|
||||
-- Modify hzb_alert_group table columns to TEXT type to resolve MySQL row size limit issue
|
||||
|
||||
DELIMITER //
|
||||
CREATE PROCEDURE ModifyGroupAlertColumns()
|
||||
BEGIN
|
||||
DECLARE table_exists INT;
|
||||
DECLARE col_exists INT;
|
||||
|
||||
-- Check if the table exists
|
||||
SELECT COUNT(*) INTO table_exists
|
||||
FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'HZB_ALERT_GROUP';
|
||||
|
||||
IF table_exists = 1 THEN
|
||||
-- Check and modify common_annotations column to TEXT
|
||||
SELECT COUNT(*) INTO col_exists
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'HZB_ALERT_GROUP'
|
||||
AND COLUMN_NAME = 'common_annotations'
|
||||
AND DATA_TYPE != 'text';
|
||||
|
||||
IF col_exists = 1 THEN
|
||||
ALTER TABLE HZB_ALERT_GROUP MODIFY COLUMN common_annotations TEXT;
|
||||
END IF;
|
||||
|
||||
-- Check and modify alert_fingerprints column to TEXT
|
||||
SELECT COUNT(*) INTO col_exists
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'HZB_ALERT_GROUP'
|
||||
AND COLUMN_NAME = 'alert_fingerprints'
|
||||
AND DATA_TYPE != 'text';
|
||||
|
||||
IF col_exists = 1 THEN
|
||||
ALTER TABLE HZB_ALERT_GROUP MODIFY COLUMN alert_fingerprints TEXT;
|
||||
END IF;
|
||||
END IF;
|
||||
END //
|
||||
|
||||
DELIMITER ;
|
||||
|
||||
CALL ModifyGroupAlertColumns();
|
||||
DROP PROCEDURE IF EXISTS ModifyGroupAlertColumns;
|
||||
COMMIT;
|
||||
@@ -1,25 +0,0 @@
|
||||
-- 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.
|
||||
|
||||
-- ensure every sql can rerun without error
|
||||
|
||||
-- Modify hzb_alert_group table columns to TEXT type to resolve row size limit issue
|
||||
|
||||
ALTER TABLE HZB_ALERT_GROUP ALTER COLUMN common_annotations TYPE TEXT;
|
||||
ALTER TABLE HZB_ALERT_GROUP ALTER COLUMN alert_fingerprints TYPE TEXT;
|
||||
|
||||
commit;
|
||||
@@ -453,7 +453,7 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 已分配内存
|
||||
en-US: Committed
|
||||
ja-JP: コミットメモリ
|
||||
ja-JP: コミットメモリー
|
||||
- field: init
|
||||
type: 0
|
||||
unit: MB
|
||||
|
||||
@@ -92,7 +92,7 @@ params:
|
||||
name:
|
||||
zh-CN: 使用代理
|
||||
en-US: Use Proxy Connection
|
||||
ja-JP: プロキシコネクション利用
|
||||
ja-JP: プロキシ利用
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
|
||||
@@ -304,12 +304,6 @@ metrics:
|
||||
zh-CN: 关键词数量
|
||||
en-US: Keyword
|
||||
ja-JP: キーワード
|
||||
- field: statusCode
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 状态码
|
||||
en-US: Status Code
|
||||
ja-JP: 状態コード
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: http
|
||||
# the config content when protocol is http
|
||||
|
||||
@@ -93,7 +93,7 @@ params:
|
||||
name:
|
||||
zh-CN: 使用代理
|
||||
en-US: Use Proxy Connection
|
||||
ja-JP: プロキシコネクション利用
|
||||
ja-JP: プロキシ利用
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
|
||||
@@ -21,7 +21,6 @@ app: consul_sd
|
||||
name:
|
||||
zh-CN: Consul Service Discovery
|
||||
en-US: Consul Service Discovery
|
||||
ja-JP: Consulサービスディスカバリー
|
||||
# Input params define for app api(render web ui by the definition)
|
||||
params:
|
||||
# field-param field key
|
||||
@@ -30,7 +29,6 @@ params:
|
||||
name:
|
||||
zh-CN: Consul Host
|
||||
en-US: Consul Host
|
||||
ja-JP: Consulホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# required-true or false
|
||||
@@ -39,7 +37,6 @@ params:
|
||||
name:
|
||||
zh-CN: Consul 端口
|
||||
en-US: Consul Port
|
||||
ja-JP: Consulポート
|
||||
type: number
|
||||
range: '[0,65535]'
|
||||
required: true
|
||||
@@ -49,7 +46,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 监控目标
|
||||
en-US: Monitor Target
|
||||
ja-JP: 監視対象
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -61,13 +57,11 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Host
|
||||
en-US: Host
|
||||
ja-JP: ホスト
|
||||
- field: port
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Port
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: consul_sd
|
||||
# the config content when protocol is http_sd
|
||||
|
||||
@@ -21,13 +21,11 @@ app: coreos
|
||||
name:
|
||||
zh-CN: Fedora CoreOS
|
||||
en-US: Fedora CoreOS
|
||||
ja-JP: Fedora CoreOS
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: Hertzbeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH 协议</a> 对 Fedora CoreOS 操作系统的通用性能指标 (系统信息、CPU、内存、磁盘、网卡、文件系统、TOP资源进程等) 进行采集监控。<br>您可以点击“<i>新建 Fedora CoreOS</i>”并配置HOST端口账户等相关参数进行添加,支持SSH账户密码或密钥认证。或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: HertzBeat uses <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH protocol</a> to monitors Fedora CoreOS operating system's general performance metrics such as cpu, memory, disk, basic, interface, disk_free, top_process etc. <br>You can click the "<i>New Fedora CoreOS</i>" and config host port and other related params to add, auth support password or secretKey. Or import an existing setup through the "<i>More Actions</i>" menu.
|
||||
zh-TW: Hertzbeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH 协议</a> 對 Fedora CoreOS 操作系统的通用性能指標 (系統信息、CPU、內存、磁盤、網卡、文件系統、TOP資源進程等) 進行採集監控。<br>您可以點擊“<i>新建 Fedora CoreOS</i>”並配置HOST端口賬戶等相關參數進行添加,支持SSH賬戶密碼或密鑰認證。或者選擇“<i>更多操作</i>”,導入已有配寘。
|
||||
ja-JP: Hertzbeat は <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH プロトコルを介して</a> Fedora CoreOSの一般的なパフォーマンスのメトリック監視します。<br>「<i>新規 Fedora CoreOS</i>」をクリックしてホストなどのパラメタを設定した後、新規することができます。SSHまたはキー認証をサポートします。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/coreos
|
||||
en-US: https://hertzbeat.apache.org/docs/help/coreos
|
||||
@@ -39,7 +37,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -50,7 +47,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -65,7 +61,6 @@ params:
|
||||
name:
|
||||
zh-CN: 超时时间(ms)
|
||||
en-US: Timeout(ms)
|
||||
ja-JP: タイムアウト(ms)
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -80,7 +75,6 @@ params:
|
||||
name:
|
||||
zh-CN: 复用连接
|
||||
en-US: Reuse Connection
|
||||
ja-JP: コネクション再利用
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
@@ -92,7 +86,6 @@ params:
|
||||
name:
|
||||
zh-CN: 使用代理
|
||||
en-US: Use Proxy Connection
|
||||
ja-JP: プロキシコネクション利用
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
@@ -104,7 +97,6 @@ params:
|
||||
name:
|
||||
zh-CN: 用户名
|
||||
en-US: Username
|
||||
ja-JP: ユーザー名
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
@@ -117,7 +109,6 @@ params:
|
||||
name:
|
||||
zh-CN: 密码
|
||||
en-US: Password
|
||||
ja-JP: パスワード
|
||||
# type-param field type(most mapping the html input tag)
|
||||
type: password
|
||||
# required-true or false
|
||||
@@ -128,7 +119,6 @@ params:
|
||||
name:
|
||||
zh-CN: 私钥
|
||||
en-US: PrivateKey
|
||||
ja-JP: 秘密鍵
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: textarea
|
||||
placeholder: -----BEGIN RSA PRIVATE KEY-----
|
||||
@@ -142,7 +132,6 @@ params:
|
||||
name:
|
||||
zh-CN: 密钥短语
|
||||
en-US: PrivateKey PassPhrase
|
||||
ja-JP: 秘密鍵フレーズ
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: password
|
||||
# required-true or false
|
||||
@@ -155,7 +144,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理主机
|
||||
en-US: Proxy Host
|
||||
ja-JP: プロキシホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# required-true or false
|
||||
@@ -167,7 +155,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理端口
|
||||
en-US: Proxy Port
|
||||
ja-JP: プロキシポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -184,7 +171,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理用户名
|
||||
en-US: Proxy Username
|
||||
ja-JP: プロキシユーザー名
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
@@ -199,7 +185,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理密码
|
||||
en-US: Proxy Password
|
||||
ja-JP: プロキシパスワード
|
||||
# type-param field type(most mapping the html input tag)
|
||||
type: password
|
||||
# required-true or false
|
||||
@@ -212,7 +197,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理主机私钥
|
||||
en-US: proxyPrivateKey
|
||||
ja-JP: プロキシ秘密鍵
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: textarea
|
||||
placeholder: -----BEGIN RSA PRIVATE KEY-----
|
||||
@@ -227,7 +211,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 系统基本信息
|
||||
en-US: Basic Info
|
||||
ja-JP: システム基礎情報
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -240,19 +223,16 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 主机名称
|
||||
en-US: Host Name
|
||||
ja-JP: ホスト名
|
||||
- field: version
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 操作系统版本
|
||||
en-US: System Version
|
||||
ja-JP: システムバージョン
|
||||
- field: uptime
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 启动时间
|
||||
en-US: Uptime
|
||||
ja-JP: アップタイム
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: ssh
|
||||
# the config content when protocol is ssh
|
||||
@@ -292,7 +272,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: CPU 信息
|
||||
en-US: CPU Info
|
||||
ja-JP: CPU情報
|
||||
priority: 1
|
||||
fields:
|
||||
- field: info
|
||||
@@ -300,38 +279,32 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 型号
|
||||
en-US: Info
|
||||
ja-JP: バージョン
|
||||
- field: cores
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 核数
|
||||
en-US: Cores
|
||||
ja-JP: コア数
|
||||
- field: interrupt
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 中断数
|
||||
en-US: Interrupt
|
||||
ja-JP: 割り込み数
|
||||
- field: load
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 负载
|
||||
en-US: Load
|
||||
ja-JP: ロード
|
||||
- field: context_switch
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 上下文切换
|
||||
en-US: Context Switch
|
||||
ja-JP: コンテキストスイッチ
|
||||
- field: usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 使用率
|
||||
en-US: Usage
|
||||
ja-JP: 使用率
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- info
|
||||
@@ -378,7 +351,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 内存信息
|
||||
en-US: Memory Info
|
||||
ja-JP: メモリ情報
|
||||
priority: 2
|
||||
fields:
|
||||
- field: total
|
||||
@@ -387,42 +359,36 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 总内存容量
|
||||
en-US: Total Memory
|
||||
ja-JP: メモリ容量
|
||||
- field: used
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 用户程序内存量
|
||||
en-US: User Program Memory
|
||||
ja-JP: ユーザープログラムメモリ
|
||||
- field: free
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 空闲内存容量
|
||||
en-US: Free Memory
|
||||
ja-JP: 空きメモリ
|
||||
- field: buff_cache
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 缓存占用内存
|
||||
en-US: Buff Cache Memory
|
||||
ja-JP: バッファメモリ
|
||||
- field: available
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 剩余可用内存
|
||||
en-US: Available Memory
|
||||
ja-JP: 使用可能なメモリ
|
||||
- field: usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存使用率
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
aliasFields:
|
||||
- total
|
||||
- used
|
||||
@@ -465,7 +431,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 磁盘信息
|
||||
en-US: Disk Info
|
||||
ja-JP: ディスク情報
|
||||
priority: 3
|
||||
fields:
|
||||
- field: disk_num
|
||||
@@ -473,32 +438,27 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 磁盘总数
|
||||
en-US: Disk Num
|
||||
ja-JP: ディスク番号
|
||||
- field: partition_num
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 分区总数
|
||||
en-US: Partition Num
|
||||
ja-JP: パーティション
|
||||
- field: block_write
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 写磁盘块数
|
||||
en-US: Block Write
|
||||
ja-JP: 書き込みディスクブロック数
|
||||
- field: block_read
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 读磁盘块数
|
||||
en-US: Block Read
|
||||
ja-JP: 読み取りブロック数
|
||||
- field: write_rate
|
||||
type: 0
|
||||
unit: iops
|
||||
i18n:
|
||||
zh-CN: 磁盘写速率
|
||||
en-US: Write Rate
|
||||
ja-JP: ディスク書き込み速度
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
@@ -528,7 +488,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 网卡信息
|
||||
en-US: Interface Info
|
||||
ja-JP: ネットワークカード情報
|
||||
priority: 4
|
||||
fields:
|
||||
- field: interface_name
|
||||
@@ -537,21 +496,18 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 网卡名称
|
||||
en-US: Interface Name
|
||||
ja-JP: ネットワークカード名
|
||||
- field: receive_bytes
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 入站数据流量
|
||||
en-US: Receive Bytes
|
||||
ja-JP: 受信バイト数
|
||||
- field: transmit_bytes
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 出站数据流量
|
||||
en-US: Transmit Bytes
|
||||
ja-JP: 送信バイト数
|
||||
units:
|
||||
- receive_bytes=B->MB
|
||||
- transmit_bytes=B->MB
|
||||
@@ -584,7 +540,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 文件系统
|
||||
en-US: Disk Free
|
||||
ja-JP: ファイルシステム
|
||||
priority: 5
|
||||
fields:
|
||||
- field: filesystem
|
||||
@@ -592,35 +547,30 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 文件系统
|
||||
en-US: Filesystem
|
||||
ja-JP: ファイルシステム
|
||||
- field: used
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 已使用量
|
||||
en-US: Used
|
||||
ja-JP: 使用済み
|
||||
- field: available
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 可用量
|
||||
en-US: Available
|
||||
ja-JP: 使用可能
|
||||
- field: usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 使用率
|
||||
en-US: Usage
|
||||
ja-JP: 使用率
|
||||
- field: mounted
|
||||
type: 1
|
||||
label: true
|
||||
i18n:
|
||||
zh-CN: 挂载点
|
||||
en-US: Mounted
|
||||
ja-JP: マウント
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
@@ -650,7 +600,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Top10 CPU 进程
|
||||
en-US: Top10 CPU Process
|
||||
ja-JP: トップ10 CPUプロセス
|
||||
priority: 6
|
||||
fields:
|
||||
- field: pid
|
||||
@@ -659,27 +608,23 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 进程ID
|
||||
en-US: PID
|
||||
ja-JP: プロセスID
|
||||
- field: cpu_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: CPU占用率
|
||||
en-US: CPU Usage
|
||||
ja-JP: CPU使用率
|
||||
- field: mem_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存占用率
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
- field: command
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 执行命令
|
||||
en-US: Command
|
||||
ja-JP: 指令
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
@@ -709,7 +654,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Top10 内存进程
|
||||
en-US: Top10 Memory Process
|
||||
ja-JP: トップ10 メモリプロセス
|
||||
priority: 7
|
||||
fields:
|
||||
- field: pid
|
||||
@@ -718,27 +662,23 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 进程ID
|
||||
en-US: PID
|
||||
ja-JP: プロセスID
|
||||
- field: mem_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存占用率
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
- field: cpu_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: CPU占用率
|
||||
en-US: CPU Usage
|
||||
ja-JP: CPU使用率
|
||||
- field: command
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 执行命令
|
||||
en-US: Command
|
||||
ja-JP: 指令
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
|
||||
@@ -21,12 +21,10 @@ app: dahua
|
||||
name:
|
||||
zh-CN: 大华
|
||||
en-US: Dahua
|
||||
ja-JP: Dahua
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: 通过http接口监控大华设备状态,获取设备健康数据。
|
||||
en-US: Monitor Dahua devices through http interface to collect health data.
|
||||
ja-JP: Hertzbeat は HTTPインターフェースを呼び出してDahuaデバイスの健全データを収集します。
|
||||
|
||||
# Input params define for monitoring(render web ui by the definition)
|
||||
params:
|
||||
@@ -34,14 +32,12 @@ params:
|
||||
name:
|
||||
zh-CN: 主机Host
|
||||
en-US: Host
|
||||
ja-JP: 目標ホスト
|
||||
type: host
|
||||
required: true
|
||||
- field: port
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
type: number
|
||||
range: '[0,65535]'
|
||||
required: true
|
||||
@@ -50,7 +46,6 @@ params:
|
||||
name:
|
||||
zh-CN: 超时时间(ms)
|
||||
en-US: Timeout(ms)
|
||||
ja-JP: タイムアウト(ms)
|
||||
type: number
|
||||
range: '[1000,60000]'
|
||||
required: true
|
||||
@@ -59,21 +54,18 @@ params:
|
||||
name:
|
||||
zh-CN: 用户名
|
||||
en-US: Username
|
||||
ja-JP: ユーザー名
|
||||
type: text
|
||||
required: true
|
||||
- field: password
|
||||
name:
|
||||
zh-CN: 密码
|
||||
en-US: Password
|
||||
ja-JP: パスワード
|
||||
type: password
|
||||
required: true
|
||||
- field: ssl
|
||||
name:
|
||||
zh-CN: 启用HTTPS
|
||||
en-US: SSL
|
||||
ja-JP: SSL利用
|
||||
type: boolean
|
||||
required: false
|
||||
defaultValue: false
|
||||
@@ -84,7 +76,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 网络信息
|
||||
en-US: Network Info
|
||||
ja-JP: ネットワーク情報
|
||||
priority: 0
|
||||
protocol: http
|
||||
http:
|
||||
@@ -105,61 +96,51 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 默认网卡
|
||||
en-US: Default Interface
|
||||
ja-JP: デフォルトのネットワークカード
|
||||
- field: domain_name
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 域名
|
||||
en-US: Domain Name
|
||||
ja-JP: ドメイン名
|
||||
- field: hostname
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 主机名
|
||||
en-US: Hostname
|
||||
ja-JP: ホスト名
|
||||
- field: eth0_ip_address
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 网卡 eth0 IP地址
|
||||
en-US: Interface eth0 IP Address
|
||||
ja-JP: eth0ネットワークカードのIPアドレス
|
||||
- field: eth0_gateway
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 网卡 eth0 默认网关
|
||||
en-US: Interface eth0 Default Gateway
|
||||
ja-JP: eth0ネットワークカードのデフォルトゲートウェイ
|
||||
- field: eth0_mac_address
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 网卡 eth0 物理地址
|
||||
en-US: Interface eth0 Physical Address
|
||||
ja-JP: eth0ネットワークカードの物理アドレス
|
||||
- field: eth0_subnet_mask
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 网卡 eth0 子网掩码
|
||||
en-US: Interface eth0 Subnet Mask
|
||||
ja-JP: eth0ネットワークカードのサブネットマスク
|
||||
- field: eth0_mtu
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 网卡 eth0 MTU
|
||||
en-US: Interface eth0 MTU
|
||||
ja-JP: eth0ネットワークカードのMTU
|
||||
- field: eth0_dns1
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 网卡 eth0 DNS服务器1
|
||||
en-US: Interface eth0 DNS Server 1
|
||||
ja-JP: eth0ネットワークカードのDNSサーバー 1
|
||||
- field: eth0_dns2
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 网卡 eth0 DNS服务器2
|
||||
en-US: Interface eth0 DNS Server 2
|
||||
ja-JP: eth0ネットワークカードのDNSサーバー 2
|
||||
aliasFields:
|
||||
- table.Network.DefaultInterface
|
||||
- table.Network.Domain
|
||||
@@ -186,7 +167,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 用户信息
|
||||
en-US: User Info
|
||||
ja-JP: ユーザー情報
|
||||
priority: 0
|
||||
protocol: http
|
||||
http:
|
||||
@@ -208,30 +188,25 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 客户端地址
|
||||
en-US: ClientAddress
|
||||
ja-JP: クライアントのアドレス
|
||||
- field: Name
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 客户端用户
|
||||
en-US: Name
|
||||
ja-JP: ユーザー名
|
||||
- field: ClientType
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 客户端登录类型
|
||||
en-US: ClientType
|
||||
ja-JP: クライアントタイプ
|
||||
- field: LoginTime
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 客户端登录时间
|
||||
en-US: LoginTime
|
||||
ja-JP: クライアントのログイン時間
|
||||
- name: ntp_info
|
||||
i18n:
|
||||
zh-CN: 校时信息
|
||||
en-US: Ntp Info
|
||||
ja-JP: NTP情報
|
||||
priority: 0
|
||||
protocol: http
|
||||
http:
|
||||
@@ -252,19 +227,16 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 校时服务器
|
||||
en-US: Ntp Address
|
||||
ja-JP: NTPアドレス
|
||||
- field: ntp_port
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 校时端口
|
||||
en-US: Ntp Port
|
||||
ja-JP: NTPポート
|
||||
- field: ntp_update_period
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 校时间隔
|
||||
en-US: Ntp Update Period
|
||||
ja-JP: NTP更新期間
|
||||
aliasFields:
|
||||
- table.NTP.Address
|
||||
- table.NTP.Port
|
||||
|
||||
@@ -1,857 +0,0 @@
|
||||
# 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.
|
||||
|
||||
# The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring
|
||||
category: os
|
||||
# The monitoring type eg: linux windows tomcat mysql aws...
|
||||
app: darwin
|
||||
# The monitoring i18n name
|
||||
name:
|
||||
zh-CN: Darwin操作系统
|
||||
en-US: Darwin Linux
|
||||
ja-JP: Darwin Linux
|
||||
zh-TW: Darwin操作系統
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: HertzBeat 使用 <a class='help_module_content' href='https://HertzBeat.apache.org/docs/advanced/extend-ssh'> SSH 协议</a> 对 Darwin 操作系统的通用性能指标 (系统信息、CPU、内存、磁盘、网卡、文件系统、TOP资源进程等) 进行采集监控。<br>您可以点击“<i>新建 Darwin</i>”并配置HOST端口账户等相关参数进行添加,支持SSH账户密码或密钥认证。或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: HertzBeat uses <a class='help_module_content' href='https://HertzBeat.apache.org/docs/advanced/extend-ssh'> SSH protocol</a> to monitors Darwin operating system's general performance metrics such as cpu, memory, disk, basic, interface, disk_free, top_process etc. <br>You can click the "<i>New Darwin</i>" and config host port and other related params to add, auth support password or secretKey. Or import an existing setup through the "<i>More Actions</i>" menu.
|
||||
# zh-TW: HertzBeat 使用 <a class='help_module_content' href='https://HertzBeat.apache.org/docs/advanced/extend-ssh'> SSH 协议</a> 對 Darwin 操作系统的通用性能指標 (系統信息、CPU、內存、磁盤、網卡、文件系統、TOP資源進程等) 進行採集監控。<br>您可以點擊“<i>新建 Darwin</i>”並配置HOST端口賬戶等相關參數進行添加,支持SSH賬戶密碼或密鑰認證。或者選擇“<i>更多操作</i>”,導入已有配寘。
|
||||
# ja-JP: HertzBeat は <a class='help_module_content' href='https://HertzBeat.apache.org/docs/advanced/extend-ssh'> SSHプロトコルを介して</a> Darwinシステムの一般的なパフォーマンスのメトリック監視します。<br>「<i>新規 Darwin Linux</i>」をクリックしてホストなどのパラメタを設定した後、新規することができます。SSHまたはキー認証をサポートします。
|
||||
helpLink:
|
||||
zh-CN: https://HertzBeat.apache.org/zh-cn/docs/help/Darwin/
|
||||
en-US: https://HertzBeat.apache.org/docs/help/Darwin/
|
||||
# Input params define for monitoring(render web ui by the definition)
|
||||
params:
|
||||
# field-param field key
|
||||
- field: host
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
zh-TW: 目標Host
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
required: true
|
||||
# field-param field key
|
||||
- field: port
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
zh-TW: 端口
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
range: '[0,65535]'
|
||||
# required-true or false
|
||||
required: true
|
||||
# default value
|
||||
defaultValue: 22
|
||||
# field-param field key
|
||||
- field: timeout
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 超时时间(ms)
|
||||
en-US: Timeout(ms)
|
||||
ja-JP: タイムアウト(ms)
|
||||
zh-TW: 超時時間(ms)
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
range: '[400,200000]'
|
||||
# required-true or false
|
||||
required: false
|
||||
# default value
|
||||
# 默认值
|
||||
defaultValue: 6000
|
||||
# field-param field key
|
||||
- field: reuseConnection
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 复用连接
|
||||
en-US: Reuse Connection
|
||||
ja-JP: コネクション再利用
|
||||
zh-TW: 復用連接
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
required: true
|
||||
defaultValue: true
|
||||
# field-param field key
|
||||
- field: useProxy
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 使用代理
|
||||
en-US: Use Proxy Connection
|
||||
ja-JP: プロキシコネクション利用
|
||||
zh-TW: 使用代理
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
required: true
|
||||
defaultValue: false
|
||||
# field-param field key
|
||||
- field: username
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 用户名
|
||||
en-US: Username
|
||||
ja-JP: ユーザー名
|
||||
zh-TW: 用戶名
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
limit: 50
|
||||
# required-true or false
|
||||
required: true
|
||||
# field-param field key
|
||||
- field: password
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 密码
|
||||
en-US: Password
|
||||
ja-JP: パスワード
|
||||
zh-TW: 密碼
|
||||
# type-param field type(most mapping the html input tag)
|
||||
type: password
|
||||
# required-true or false
|
||||
required: false
|
||||
# field-param field key
|
||||
- field: privateKey
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 私钥
|
||||
en-US: PrivateKey
|
||||
ja-JP: 秘密鍵
|
||||
zh-TW: 私鑰
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: textarea
|
||||
placeholder: -----BEGIN RSA PRIVATE KEY-----
|
||||
# required-true or false
|
||||
required: false
|
||||
# hide param-true or false
|
||||
hide: true
|
||||
# field-param field key
|
||||
- field: privateKeyPassphrase
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 密钥短语
|
||||
en-US: PrivateKey PassPhrase
|
||||
ja-JP: 秘密鍵フレーズ
|
||||
zh-TW: 私鑰短語
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: password
|
||||
# required-true or false
|
||||
required: false
|
||||
# hide param-true or false
|
||||
hide: true
|
||||
# field-param field key
|
||||
- field: proxyHost
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 代理主机
|
||||
en-US: Proxy Host
|
||||
ja-JP: プロキシホスト
|
||||
zh-TW: 代理主機
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# required-true or false
|
||||
required: false
|
||||
# hide param-true or false
|
||||
hide: true
|
||||
- field: proxyPort
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 代理端口
|
||||
en-US: Proxy Port
|
||||
ja-JP: プロキシポート
|
||||
zh-TW: 代理端口
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
range: '[0,65535]'
|
||||
# required-true or false
|
||||
required: false
|
||||
# hide param-true or false
|
||||
hide: true
|
||||
# default value
|
||||
defaultValue: 22
|
||||
# field-param field key
|
||||
- field: proxyUsername
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 代理用户名
|
||||
en-US: Proxy Username
|
||||
ja-JP: プロキシユーザー名
|
||||
zh-TW: 代理用戶名
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
limit: 50
|
||||
# required-true or false
|
||||
required: false
|
||||
# hide param-true or false
|
||||
hide: true
|
||||
# field-param field key
|
||||
- field: proxyPassword
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 代理密码
|
||||
en-US: Proxy Password
|
||||
ja-JP: プロキシパスワード
|
||||
zh-TW: 代理密碼
|
||||
# type-param field type(most mapping the html input tag)
|
||||
type: password
|
||||
# required-true or false
|
||||
required: false
|
||||
# hide param-true or false
|
||||
hide: true
|
||||
# field-param field key
|
||||
- field: proxyPrivateKey
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 代理主机私钥
|
||||
en-US: proxyPrivateKey
|
||||
ja-JP: プロキシ秘密鍵
|
||||
zh-TW: 代理主機私鑰
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: textarea
|
||||
placeholder: -----BEGIN RSA PRIVATE KEY-----
|
||||
# required-true or false
|
||||
required: false
|
||||
# hide param-true or false
|
||||
hide: true
|
||||
# collect metrics config list
|
||||
metrics:
|
||||
# metrics - basic, inner monitoring metrics (responseTime - response time)
|
||||
- name: basic
|
||||
i18n:
|
||||
zh-CN: 系统基本信息
|
||||
en-US: Basic Info
|
||||
ja-JP: システム基礎情報
|
||||
zh-TW: 系統基本信息
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
# collect metrics content
|
||||
fields:
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: hostname
|
||||
type: 1
|
||||
label: true
|
||||
i18n:
|
||||
zh-CN: 主机名称
|
||||
en-US: Host Name
|
||||
ja-JP: ホスト名
|
||||
zh-TW: 主機名稱
|
||||
- field: version
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 操作系统版本
|
||||
en-US: System Version
|
||||
ja-JP: システムバージョン
|
||||
zh-TW: 操作系統版本
|
||||
- field: uptime
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 启动时间
|
||||
en-US: Uptime
|
||||
ja-JP: アップタイム
|
||||
zh-TW: 啟動時間
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: ssh
|
||||
# the config content when protocol is ssh
|
||||
ssh:
|
||||
# ssh host: ipv4 ipv6 domain
|
||||
host: ^_^host^_^
|
||||
# ssh port
|
||||
port: ^_^port^_^
|
||||
# ssh username
|
||||
username: ^_^username^_^
|
||||
# ssh password
|
||||
password: ^_^password^_^
|
||||
# ssh private key
|
||||
privateKey: ^_^privateKey^_^
|
||||
# ssh private key passphrase
|
||||
privateKeyPassphrase: ^_^privateKeyPassphrase^_^
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
# whether to use proxy server for ssh connection
|
||||
useProxy: ^_^useProxy^_^
|
||||
# ssh proxy host: ipv4 domain
|
||||
proxyHost: ^_^proxyHost^_^
|
||||
# ssh proxy port
|
||||
proxyPort: ^_^proxyPort^_^
|
||||
# ssh proxy username
|
||||
proxyUsername: ^_^proxyUsername^_^
|
||||
# ssh proxy password
|
||||
proxyPassword: ^_^proxyPassword^_^
|
||||
# ssh proxy private key
|
||||
proxyPrivateKey: ^_^proxyPrivateKey^_^
|
||||
# ssh run collect script
|
||||
script: |
|
||||
(
|
||||
hostname | awk -F "," '{printf "%s\n", $1}'
|
||||
sw_vers | awk '/:/ {printf "%s ", $2} END {print ""}'
|
||||
sysctl -n kern.boottime | awk '{for(i=9;i<=NF;i++) printf "%s ", $i; print ""}'
|
||||
)
|
||||
# ssh response data parse type: oneRow, multiRow
|
||||
parseType: oneRow
|
||||
|
||||
- name: cpu
|
||||
i18n:
|
||||
zh-CN: CPU 信息
|
||||
en-US: CPU Info
|
||||
ja-JP: CPU情報
|
||||
zh-TW: CPU 信息
|
||||
priority: 1
|
||||
fields:
|
||||
- field: info
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 型号
|
||||
en-US: Info
|
||||
ja-JP: バージョン
|
||||
zh-TW: 型號
|
||||
- field: cores
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 核数
|
||||
en-US: Cores
|
||||
ja-JP: コア数
|
||||
zh-TW: 核數
|
||||
- field: interrupt
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 中断数
|
||||
en-US: Interrupt
|
||||
ja-JP: 割り込み数
|
||||
zh-TW: 中斷數
|
||||
- field: load
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 负载
|
||||
en-US: Load
|
||||
ja-JP: ロード
|
||||
zh-TW: 負載
|
||||
- field: context_switch
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 上下文切换
|
||||
en-US: Context Switch
|
||||
ja-JP: コンテキストスイッチ
|
||||
zh-TW: 上下文切換
|
||||
- field: usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 使用率
|
||||
en-US: Usage
|
||||
ja-JP: 使用率
|
||||
zh-TW: 使用率
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- info
|
||||
- cores
|
||||
- load
|
||||
- interrupt
|
||||
- context_switch
|
||||
- idle
|
||||
# mapping and conversion expressions, use these and aliasField above to calculate metrics value
|
||||
# eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime
|
||||
calculates:
|
||||
- info=info
|
||||
- cores=cores
|
||||
- load=load
|
||||
- interrupt=interrupt
|
||||
- context_switch=context_switch
|
||||
- usage=100 - idle
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
port: ^_^port^_^
|
||||
username: ^_^username^_^
|
||||
password: ^_^password^_^
|
||||
privateKey: ^_^privateKey^_^
|
||||
privateKeyPassphrase: ^_^privateKeyPassphrase^_^
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
# whether to use proxy server for ssh connection
|
||||
useProxy: ^_^useProxy^_^
|
||||
# ssh proxy host: ipv4 domain
|
||||
proxyHost: ^_^proxyHost^_^
|
||||
# ssh proxy port
|
||||
proxyPort: ^_^proxyPort^_^
|
||||
# ssh proxy username
|
||||
proxyUsername: ^_^proxyUsername^_^
|
||||
# ssh proxy password
|
||||
proxyPassword: ^_^proxyPassword^_^
|
||||
# ssh proxy private key
|
||||
proxyPrivateKey: ^_^proxyPrivateKey^_^
|
||||
script: sysctl -n machdep.cpu.brand_string; sysctl -n hw.logicalcpu; sysctl -n vm.loadavg | awk '{print $2, $3, $4}'; idle=$(top -l 1 | grep "CPU usage" | awk '{print $7}' | tr -d '%') ; free_pages=$(vm_stat | awk '/free/ {gsub(/\./,"",$3); print $3}'); active_pages=$(vm_stat | awk '/active/ {gsub(/\./,"",$3); print $3}'); first_swapins=$(vm_stat | awk '/swapins/ {gsub(/\./,"",$2); print $2}'); sleep 1; second_swapins=$(vm_stat | awk '/swapins/ {gsub(/\./,"",$2); print $2}'); echo "$free_pages"; echo "$active_pages"; echo "$idle";
|
||||
parseType: oneRow
|
||||
|
||||
- name: memory
|
||||
i18n:
|
||||
zh-CN: 内存信息
|
||||
en-US: Memory Info
|
||||
ja-JP: メモリ情報
|
||||
zh-TW: 內存信息
|
||||
priority: 2
|
||||
fields:
|
||||
- field: total
|
||||
type: 1
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 总内存容量
|
||||
en-US: Total Memory
|
||||
ja-JP: メモリ容量
|
||||
zh-TW: 總內存容量
|
||||
- field: used
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 用户程序内存量
|
||||
en-US: User Program Memory
|
||||
ja-JP: ユーザープログラムメモリ
|
||||
zh-TW: 用戶程序內存量
|
||||
- field: free
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 空闲内存容量
|
||||
zh-TW: 空閒內存容量
|
||||
en-US: Free Memory
|
||||
ja-JP: 空きメモリ
|
||||
- field: buff_cache
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 缓存占用内存
|
||||
zh-TW: 緩存佔用內存
|
||||
en-US: Buff Cache Memory
|
||||
ja-JP: バッファメモリ
|
||||
- field: available
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 剩余可用内存
|
||||
zh-TW: 剩餘可用內存
|
||||
en-US: Available Memory
|
||||
ja-JP: 使用可能なメモリ
|
||||
- field: usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存使用率
|
||||
zh-TW: 內存使用率
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
aliasFields:
|
||||
- total
|
||||
- used
|
||||
- free
|
||||
- buff_cache
|
||||
- available
|
||||
calculates:
|
||||
- total=total
|
||||
- used=used
|
||||
- free=free
|
||||
- buff_cache=buff_cache
|
||||
- available=available
|
||||
- usage=(used / total) * 100
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
port: ^_^port^_^
|
||||
username: ^_^username^_^
|
||||
password: ^_^password^_^
|
||||
privateKey: ^_^privateKey^_^
|
||||
privateKeyPassphrase: ^_^privateKeyPassphrase^_^
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
# whether to use proxy server for ssh connection
|
||||
useProxy: ^_^useProxy^_^
|
||||
# ssh proxy host: ipv4 domain
|
||||
proxyHost: ^_^proxyHost^_^
|
||||
# ssh proxy port
|
||||
proxyPort: ^_^proxyPort^_^
|
||||
# ssh proxy username
|
||||
proxyUsername: ^_^proxyUsername^_^
|
||||
# ssh proxy password
|
||||
proxyPassword: ^_^proxyPassword^_^
|
||||
# ssh proxy private key
|
||||
proxyPrivateKey: ^_^proxyPrivateKey^_^
|
||||
script: |
|
||||
sysctl -n hw.memsize | awk '{
|
||||
t=$1/1048576;
|
||||
cmd="vm_stat";
|
||||
while (cmd | getline) {
|
||||
if ($1=="Pages") {
|
||||
if ($2=="free:") {f=$3}
|
||||
else if ($2=="active:") {a=$3}
|
||||
else if ($2=="inactive:") {i=$3}
|
||||
else if ($2=="speculative:") {s=$3}
|
||||
else if ($2~/wired/) {w=$NF}
|
||||
};
|
||||
gsub(/\.[ \t]*$/,"",f);
|
||||
gsub(/\.[ \t]*$/,"",a);
|
||||
gsub(/\.[ \t]*$/,"",i);
|
||||
gsub(/\.[ \t]*$/,"",s);
|
||||
gsub(/\.[ \t]*$/,"",w);
|
||||
};
|
||||
close(cmd);
|
||||
fm=(f+s)/256;
|
||||
um=(a+w)/256;
|
||||
im=i/256;
|
||||
bm=im;
|
||||
am=fm+im;
|
||||
print "total used free buff_cache available";
|
||||
printf "%d %d %d %d %d\n", t, um, fm, bm, am
|
||||
}'
|
||||
parseType: multiRow
|
||||
|
||||
# - name: disk
|
||||
# i18n:
|
||||
# zh-CN: 磁盘信息
|
||||
# zh-TW: 磁盤信息
|
||||
# en-US: Disk Info
|
||||
# ja-JP: ディスク情報
|
||||
# priority: 3
|
||||
# fields:
|
||||
# - field: disk_num
|
||||
# type: 1
|
||||
# i18n:
|
||||
# zh-CN: 磁盘总数
|
||||
# zh-TW: 磁盤總數
|
||||
# en-US: Disk Num
|
||||
# ja-JP: ディスク番号
|
||||
# - field: partition_num
|
||||
# type: 1
|
||||
# i18n:
|
||||
# zh-CN: 分区总数
|
||||
# zh-TW: 分區總數
|
||||
# en-US: Partition Num
|
||||
# ja-JP: パーティション
|
||||
# - field: block_write
|
||||
# type: 0
|
||||
# i18n:
|
||||
# zh-CN: 写磁盘块数
|
||||
# zh-TW: 寫磁盤塊數
|
||||
# en-US: Block Write
|
||||
# ja-JP: 書き込みディスクブロック数
|
||||
# - field: block_read
|
||||
# type: 0
|
||||
# i18n:
|
||||
# zh-CN: 读磁盘块数
|
||||
# zh-TW: 讀磁盤塊數
|
||||
# en-US: Block Read
|
||||
# ja-JP: 読み取りブロック数
|
||||
# - field: write_rate
|
||||
# type: 0
|
||||
# unit: iops
|
||||
# i18n:
|
||||
# zh-CN: 磁盘写速率
|
||||
# zh-TW: 磁盤寫速率
|
||||
# en-US: Write Rate
|
||||
# ja-JP: ディスク書き込み速度
|
||||
# protocol: ssh
|
||||
# ssh:
|
||||
# host: ^_^host^_^
|
||||
# port: ^_^port^_^
|
||||
# username: ^_^username^_^
|
||||
# password: ^_^password^_^
|
||||
# privateKey: ^_^privateKey^_^
|
||||
# privateKeyPassphrase: ^_^privateKeyPassphrase^_^
|
||||
# timeout: ^_^timeout^_^
|
||||
# reuseConnection: ^_^reuseConnection^_^
|
||||
# # whether to use proxy server for ssh connection
|
||||
# useProxy: ^_^useProxy^_^
|
||||
# # ssh proxy host: ipv4 domain
|
||||
# proxyHost: ^_^proxyHost^_^
|
||||
# # ssh proxy port
|
||||
# proxyPort: ^_^proxyPort^_^
|
||||
# # ssh proxy username
|
||||
# proxyUsername: ^_^proxyUsername^_^
|
||||
# # ssh proxy password
|
||||
# proxyPassword: ^_^proxyPassword^_^
|
||||
# # ssh proxy private key
|
||||
# proxyPrivateKey: ^_^proxyPrivateKey^_^
|
||||
# script: cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print "interface_name receive_bytes transmit_bytes"} {gsub(":", "", $1); print $1,$2,$10}'
|
||||
# parseType: oneRow
|
||||
|
||||
- name: interface
|
||||
i18n:
|
||||
zh-CN: 网卡信息
|
||||
zh-TW: 網卡信息
|
||||
en-US: Interface Info
|
||||
ja-JP: ネットワークカード情報
|
||||
priority: 4
|
||||
fields:
|
||||
- field: interface_name
|
||||
type: 1
|
||||
label: true
|
||||
i18n:
|
||||
zh-CN: 网卡名称
|
||||
zh-TW: 網卡名稱
|
||||
en-US: Interface Name
|
||||
ja-JP: ネットワークカード名
|
||||
- field: receive_bytes
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 入站数据流量
|
||||
zh-TW: 入站數據流量
|
||||
en-US: Receive Bytes
|
||||
ja-JP: 受信バイト数
|
||||
- field: transmit_bytes
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 出站数据流量
|
||||
zh-TW: 出站數據流量
|
||||
en-US: Transmit Bytes
|
||||
ja-JP: 送信バイト数
|
||||
units:
|
||||
- receive_bytes=B->MB
|
||||
- transmit_bytes=B->MB
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
port: ^_^port^_^
|
||||
username: ^_^username^_^
|
||||
password: ^_^password^_^
|
||||
privateKey: ^_^privateKey^_^
|
||||
privateKeyPassphrase: ^_^privateKeyPassphrase^_^
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
# whether to use proxy server for ssh connection
|
||||
useProxy: ^_^useProxy^_^
|
||||
# ssh proxy host: ipv4 domain
|
||||
proxyHost: ^_^proxyHost^_^
|
||||
# ssh proxy port
|
||||
proxyPort: ^_^proxyPort^_^
|
||||
# ssh proxy username
|
||||
proxyUsername: ^_^proxyUsername^_^
|
||||
# ssh proxy password
|
||||
proxyPassword: ^_^proxyPassword^_^
|
||||
# ssh proxy private key
|
||||
proxyPrivateKey: ^_^proxyPrivateKey^_^
|
||||
script: netstat -i | grep -v "lo0" | awk 'BEGIN { print "interface_name receive_bytes transmit_bytes" } NR>1 && $1 !~ /^-/ { print $1, $5, $9 }'
|
||||
parseType: multiRow
|
||||
|
||||
- name: disk_free
|
||||
i18n:
|
||||
zh-CN: 文件系统
|
||||
zh-TW: 文件系統
|
||||
en-US: Disk Free
|
||||
ja-JP: ファイルシステム
|
||||
priority: 5
|
||||
fields:
|
||||
- field: filesystem
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 文件系统
|
||||
zh-TW: 檔案系統
|
||||
en-US: Filesystem
|
||||
ja-JP: ファイルシステム
|
||||
- field: used
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 已使用量
|
||||
zh-TW: 已使用量
|
||||
en-US: Used
|
||||
ja-JP: 使用済み
|
||||
- field: available
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 可用量
|
||||
zh-TW: 可用量
|
||||
en-US: Available
|
||||
ja-JP: 使用可能
|
||||
- field: usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 使用率
|
||||
zh-TW: 使用率
|
||||
en-US: Usage
|
||||
ja-JP: 使用率
|
||||
- field: mounted
|
||||
type: 1
|
||||
label: true
|
||||
i18n:
|
||||
zh-CN: 挂载点
|
||||
zh-TW: 掛載點
|
||||
en-US: Mounted
|
||||
ja-JP: マウント
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
port: ^_^port^_^
|
||||
username: ^_^username^_^
|
||||
password: ^_^password^_^
|
||||
privateKey: ^_^privateKey^_^
|
||||
privateKeyPassphrase: ^_^privateKeyPassphrase^_^
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
# whether to use proxy server for ssh connection
|
||||
useProxy: ^_^useProxy^_^
|
||||
# ssh proxy host: ipv4 domain
|
||||
proxyHost: ^_^proxyHost^_^
|
||||
# ssh proxy port
|
||||
proxyPort: ^_^proxyPort^_^
|
||||
# ssh proxy username
|
||||
proxyUsername: ^_^proxyUsername^_^
|
||||
# ssh proxy password
|
||||
proxyPassword: ^_^proxyPassword^_^
|
||||
# ssh proxy private key
|
||||
proxyPrivateKey: ^_^proxyPrivateKey^_^
|
||||
script: df -mP | tail -n +2 | awk 'BEGIN{ print "filesystem used available usage mounted"} {print $1,$3,$4,$5,$6}'
|
||||
parseType: multiRow
|
||||
|
||||
- name: top_cpu_process
|
||||
i18n:
|
||||
zh-CN: Top10 CPU 进程
|
||||
zh-TW: Top10 CPU 進程
|
||||
en-US: Top10 CPU Process
|
||||
ja-JP: トップ10 CPUプロセス
|
||||
priority: 6
|
||||
fields:
|
||||
- field: pid
|
||||
type: 1
|
||||
label: true
|
||||
i18n:
|
||||
zh-CN: 进程ID
|
||||
zh-TW: 進程ID
|
||||
en-US: PID
|
||||
ja-JP: プロセスID
|
||||
- field: cpu_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: CPU占用率
|
||||
zh-TW: CPU佔用率
|
||||
en-US: CPU Usage
|
||||
ja-JP: CPU使用率
|
||||
- field: mem_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存占用率
|
||||
zh-TW: 內存佔用率
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
- field: command
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 执行命令
|
||||
zh-TW: 執行指令
|
||||
en-US: Command
|
||||
ja-JP: 指令
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
port: ^_^port^_^
|
||||
username: ^_^username^_^
|
||||
password: ^_^password^_^
|
||||
privateKey: ^_^privateKey^_^
|
||||
privateKeyPassphrase: ^_^privateKeyPassphrase^_^
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
# whether to use proxy server for ssh connection
|
||||
useProxy: ^_^useProxy^_^
|
||||
# ssh proxy host: ipv4 domain
|
||||
proxyHost: ^_^proxyHost^_^
|
||||
# ssh proxy port
|
||||
proxyPort: ^_^proxyPort^_^
|
||||
# ssh proxy username
|
||||
proxyUsername: ^_^proxyUsername^_^
|
||||
# ssh proxy password
|
||||
proxyPassword: ^_^proxyPassword^_^
|
||||
# ssh proxy private key
|
||||
proxyPrivateKey: ^_^proxyPrivateKey^_^
|
||||
script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
|
||||
parseType: multiRow
|
||||
|
||||
- name: top_mem_process
|
||||
i18n:
|
||||
zh-CN: Top10 内存进程
|
||||
zh-TW: Top10 內存進程
|
||||
en-US: Top10 Memory Process
|
||||
ja-JP: トップ10 メモリプロセス
|
||||
priority: 7
|
||||
fields:
|
||||
- field: pid
|
||||
type: 1
|
||||
label: true
|
||||
i18n:
|
||||
zh-CN: 进程ID
|
||||
zh-TW: 進程ID
|
||||
en-US: PID
|
||||
ja-JP: プロセスID
|
||||
- field: mem_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存占用率
|
||||
zh-TW: 內存佔用率
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
- field: cpu_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: CPU占用率
|
||||
zh-TW: CPU佔用率
|
||||
en-US: CPU Usage
|
||||
ja-JP: CPU使用率
|
||||
- field: command
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 执行命令
|
||||
zh-TW: 執行指令
|
||||
en-US: Command
|
||||
ja-JP: 指令
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
port: ^_^port^_^
|
||||
username: ^_^username^_^
|
||||
password: ^_^password^_^
|
||||
privateKey: ^_^privateKey^_^
|
||||
privateKeyPassphrase: ^_^privateKeyPassphrase^_^
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
# whether to use proxy server for ssh connection
|
||||
useProxy: ^_^useProxy^_^
|
||||
# ssh proxy host: ipv4 domain
|
||||
proxyHost: ^_^proxyHost^_^
|
||||
# ssh proxy port
|
||||
proxyPort: ^_^proxyPort^_^
|
||||
# ssh proxy username
|
||||
proxyUsername: ^_^proxyUsername^_^
|
||||
# ssh proxy password
|
||||
proxyPassword: ^_^proxyPassword^_^
|
||||
# ssh proxy private key
|
||||
|
||||
proxyPrivateKey: ^_^proxyPrivateKey^_^
|
||||
script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11
|
||||
parseType: multiRow
|
||||
@@ -21,13 +21,11 @@ app: debian
|
||||
name:
|
||||
zh-CN: Debian操作系统
|
||||
en-US: Debian Linux
|
||||
ja-JP: Debian Linux
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: Hertzbeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH 协议</a> 对 Debian 操作系统的通用性能指标 (系统信息、CPU、内存、磁盘、网卡、文件系统、TOP资源进程等) 进行采集监控。<br>您可以点击“<i>新建 Debian</i>”并配置HOST端口账户等相关参数进行添加,支持SSH账户密码或密钥认证。或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: HertzBeat uses <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH protocol</a> to monitors Debian operating system's general performance metrics such as cpu, memory, disk, basic, interface, disk_free, top_process etc. <br>You can click the "<i>New Debian</i>" and config host port and other related params to add, auth support password or secretKey. Or import an existing setup through the "<i>More Actions</i>" menu.
|
||||
zh-TW: Hertzbeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH 协议</a> 對 Debian 操作系统的通用性能指標 (系統信息、CPU、內存、磁盤、網卡、文件系統、TOP資源進程等) 進行採集監控。<br>您可以點擊“<i>新建 Debian</i>”並配置HOST端口賬戶等相關參數進行添加,支持SSH賬戶密碼或密鑰認證。或者選擇“<i>更多操作</i>”,導入已有配寘。
|
||||
ja-JP: Hertzbeat は <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSHプロトコルを介して</a> Centosシステムの一般的なパフォーマンスのメトリック監視します。<br>「<i>新規 Debian</i>」をクリックしてホストなどのパラメタを設定した後、新規することができます。SSHまたはキー認証をサポートします。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/debian
|
||||
en-US: https://hertzbeat.apache.org/docs/help/debian
|
||||
@@ -39,7 +37,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -50,7 +47,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -65,7 +61,6 @@ params:
|
||||
name:
|
||||
zh-CN: 超时时间(ms)
|
||||
en-US: Timeout(ms)
|
||||
ja-JP: タイムアウト(ms)
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -80,7 +75,6 @@ params:
|
||||
name:
|
||||
zh-CN: 复用连接
|
||||
en-US: Reuse Connection
|
||||
ja-JP: コネクション再利用
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
@@ -92,7 +86,6 @@ params:
|
||||
name:
|
||||
zh-CN: 使用代理
|
||||
en-US: Use Proxy Connection
|
||||
ja-JP: プロキシコネクション利用
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
@@ -104,7 +97,6 @@ params:
|
||||
name:
|
||||
zh-CN: 用户名
|
||||
en-US: Username
|
||||
ja-JP: ユーザー名
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
@@ -117,7 +109,6 @@ params:
|
||||
name:
|
||||
zh-CN: 密码
|
||||
en-US: Password
|
||||
ja-JP: パスワード
|
||||
# type-param field type(most mapping the html input tag)
|
||||
type: password
|
||||
# required-true or false
|
||||
@@ -128,7 +119,6 @@ params:
|
||||
name:
|
||||
zh-CN: 私钥
|
||||
en-US: PrivateKey
|
||||
ja-JP: 秘密鍵
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: textarea
|
||||
placeholder: -----BEGIN RSA PRIVATE KEY-----
|
||||
@@ -141,7 +131,6 @@ params:
|
||||
name:
|
||||
zh-CN: 密钥短语
|
||||
en-US: PrivateKey PassPhrase
|
||||
ja-JP: 秘密鍵フレーズ
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: password
|
||||
# required-true or false
|
||||
@@ -154,7 +143,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理主机
|
||||
en-US: Proxy Host
|
||||
ja-JP: プロキシホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# required-true or false
|
||||
@@ -166,7 +154,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理端口
|
||||
en-US: Proxy Port
|
||||
ja-JP: プロキシポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -183,7 +170,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理用户名
|
||||
en-US: Proxy Username
|
||||
ja-JP: プロキシユーザー名
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
@@ -198,7 +184,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理密码
|
||||
en-US: Proxy Password
|
||||
ja-JP: プロキシパスワード
|
||||
# type-param field type(most mapping the html input tag)
|
||||
type: password
|
||||
# required-true or false
|
||||
@@ -211,7 +196,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理主机私钥
|
||||
en-US: proxyPrivateKey
|
||||
ja-JP: プロキシ秘密鍵
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: textarea
|
||||
placeholder: -----BEGIN RSA PRIVATE KEY-----
|
||||
@@ -226,7 +210,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 系统基本信息
|
||||
en-US: Basic Info
|
||||
ja-JP: システム基礎情報
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -239,19 +222,16 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 主机名称
|
||||
en-US: Host Name
|
||||
ja-JP: ホスト名
|
||||
- field: version
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 操作系统版本
|
||||
en-US: System Version
|
||||
ja-JP: システムバージョン
|
||||
- field: uptime
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 启动时间
|
||||
en-US: Uptime
|
||||
ja-JP: アップタイム
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: ssh
|
||||
# the config content when protocol is ssh
|
||||
@@ -291,7 +271,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: CPU 信息
|
||||
en-US: CPU Info
|
||||
ja-JP: CPU情報
|
||||
priority: 1
|
||||
fields:
|
||||
- field: info
|
||||
@@ -299,38 +278,32 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 型号
|
||||
en-US: Info
|
||||
ja-JP: バージョン
|
||||
- field: cores
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 核数
|
||||
en-US: Cores
|
||||
ja-JP: コア数
|
||||
- field: interrupt
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 中断数
|
||||
en-US: Interrupt
|
||||
ja-JP: 割り込み数
|
||||
- field: load
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 负载
|
||||
en-US: Load
|
||||
ja-JP: ロード
|
||||
- field: context_switch
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 上下文切换
|
||||
en-US: Context Switch
|
||||
ja-JP: コンテキストスイッチ
|
||||
- field: usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 使用率
|
||||
en-US: Usage
|
||||
ja-JP: 使用率
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- info
|
||||
@@ -377,7 +350,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 内存信息
|
||||
en-US: Memory Info
|
||||
ja-JP: メモリ情報
|
||||
priority: 2
|
||||
fields:
|
||||
- field: total
|
||||
@@ -386,42 +358,36 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 总内存容量
|
||||
en-US: Total Memory
|
||||
ja-JP: メモリ容量
|
||||
- field: used
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 用户程序内存量
|
||||
en-US: User Program Memory
|
||||
ja-JP: ユーザープログラムメモリ
|
||||
- field: free
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 空闲内存容量
|
||||
en-US: Free Memory
|
||||
ja-JP: 空きメモリ
|
||||
- field: buff_cache
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 缓存占用内存
|
||||
en-US: Buff Cache Memory
|
||||
ja-JP: バッファメモリ
|
||||
- field: available
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 剩余可用内存
|
||||
en-US: Available Memory
|
||||
ja-JP: 使用可能なメモリ
|
||||
- field: usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存使用率
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
aliasFields:
|
||||
- total
|
||||
- used
|
||||
@@ -464,7 +430,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 磁盘信息
|
||||
en-US: Disk Info
|
||||
ja-JP: ディスク情報
|
||||
priority: 3
|
||||
fields:
|
||||
- field: disk_num
|
||||
@@ -472,32 +437,27 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 磁盘总数
|
||||
en-US: Disk Num
|
||||
ja-JP: ディスク番号
|
||||
- field: partition_num
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 分区总数
|
||||
en-US: Partition Num
|
||||
ja-JP: パーティション
|
||||
- field: block_write
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 写磁盘块数
|
||||
en-US: Block Write
|
||||
ja-JP: 書き込みディスクブロック数
|
||||
- field: block_read
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 读磁盘块数
|
||||
en-US: Block Read
|
||||
ja-JP: 読み取りブロック数
|
||||
- field: write_rate
|
||||
type: 0
|
||||
unit: iops
|
||||
i18n:
|
||||
zh-CN: 磁盘写速率
|
||||
en-US: Write Rate
|
||||
ja-JP: ディスク書き込み速度
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
@@ -527,7 +487,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 网卡信息
|
||||
en-US: Interface Info
|
||||
ja-JP: ネットワークカード情報
|
||||
priority: 4
|
||||
fields:
|
||||
- field: interface_name
|
||||
@@ -536,21 +495,18 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 网卡名称
|
||||
en-US: Interface Name
|
||||
ja-JP: ネットワークカード名
|
||||
- field: receive_bytes
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 入站数据流量
|
||||
en-US: Receive Bytes
|
||||
ja-JP: 受信バイト数
|
||||
- field: transmit_bytes
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 出站数据流量
|
||||
en-US: Transmit Bytes
|
||||
ja-JP: 送信バイト数
|
||||
units:
|
||||
- receive_bytes=B->MB
|
||||
- transmit_bytes=B->MB
|
||||
@@ -583,7 +539,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 文件系统
|
||||
en-US: Disk Free
|
||||
ja-JP: ファイルシステム
|
||||
priority: 5
|
||||
fields:
|
||||
- field: filesystem
|
||||
@@ -591,35 +546,30 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 文件系统
|
||||
en-US: Filesystem
|
||||
ja-JP: ファイルシステム
|
||||
- field: used
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 已使用量
|
||||
en-US: Used
|
||||
ja-JP: 使用済み
|
||||
- field: available
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 可用量
|
||||
en-US: Available
|
||||
ja-JP: 使用可能
|
||||
- field: usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 使用率
|
||||
en-US: Usage
|
||||
ja-JP: 使用率
|
||||
- field: mounted
|
||||
type: 1
|
||||
label: true
|
||||
i18n:
|
||||
zh-CN: 挂载点
|
||||
en-US: Mounted
|
||||
ja-JP: マウント
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
@@ -649,7 +599,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Top10 CPU 进程
|
||||
en-US: Top10 CPU Process
|
||||
ja-JP: トップ10 CPUプロセス
|
||||
priority: 6
|
||||
fields:
|
||||
- field: pid
|
||||
@@ -658,27 +607,23 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 进程ID
|
||||
en-US: PID
|
||||
ja-JP: プロセスID
|
||||
- field: cpu_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: CPU占用率
|
||||
en-US: CPU Usage
|
||||
ja-JP: CPU使用率
|
||||
- field: mem_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存占用率
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
- field: command
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 执行命令
|
||||
en-US: Command
|
||||
ja-JP: 指令
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
@@ -708,7 +653,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Top10 内存进程
|
||||
en-US: Top10 Memory Process
|
||||
ja-JP: トップ10 メモリプロセス
|
||||
priority: 7
|
||||
fields:
|
||||
- field: pid
|
||||
@@ -717,27 +661,23 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 进程ID
|
||||
en-US: PID
|
||||
ja-JP: プロセスID
|
||||
- field: mem_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存占用率
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
- field: cpu_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: CPU占用率
|
||||
en-US: CPU Usage
|
||||
ja-JP: CPU使用率
|
||||
- field: command
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 执行命令
|
||||
en-US: Command
|
||||
ja-JP: 指令
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
|
||||
@@ -22,13 +22,11 @@ app: deepseek
|
||||
name:
|
||||
zh-CN: Deepseek
|
||||
en-US: Deepseek
|
||||
ja-JP: Deepseek
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: Hertzbeat 对 Deepseek Api进行测量监控。<br>您可以点击 “<i>新建 Deepseek</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: Hertzbeat monitors Deepseek Api. You could click the "<i>New Deepseek</i>" button and proceed with the configuration or import an existing setup through the "<i>More Actions</i>" menu.
|
||||
zh-TW: Hertzbeat對Deepseek Api進行量測監控。<br>您可以點擊“<i>Deepseek</i>”並進行配寘,或者選擇“<i>更多操作</i>”,導入已有配寘。
|
||||
ja-JP: Hertzbeat は Deepseek Apiを監視します。<br>「<i>新規 Deepseek</i>」をクリックしてパラメタを設定した後、新規することができます。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/deepseek
|
||||
en-US: https://hertzbeat.apache.org/docs/help/deepseek
|
||||
@@ -40,7 +38,6 @@ params:
|
||||
name:
|
||||
zh-CN: 会话密钥
|
||||
en-US: Session Key
|
||||
ja-JP: セッション鍵
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# required-true or false
|
||||
@@ -53,7 +50,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 计费
|
||||
en-US: Billing
|
||||
ja-JP: 料金
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -65,25 +61,21 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 货币
|
||||
en-US: Currency
|
||||
ja-JP: 通貨
|
||||
- field: total_balance
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 可用余额
|
||||
en-US: Available Balance
|
||||
ja-JP: 利用可能残高
|
||||
- field: granted_balance
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 未过期的赠金余额
|
||||
en-US: Unexpired Gift Balance
|
||||
ja-JP: 有効期限内のギフト残高
|
||||
- field: topped_up_balance
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 充值的余额
|
||||
en-US: Topped Up Balance
|
||||
ja-JP: 残高
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: http
|
||||
# the config content when protocol is http
|
||||
|
||||
@@ -21,13 +21,11 @@ app: dm
|
||||
name:
|
||||
zh-CN: 达梦数据库
|
||||
en-US: DM DB
|
||||
ja-JP: DM データベース
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: HertzBeat 对 DM达梦数据库 的通用性能指标(basic、status、thread)进行采集监控,支持版本为 DM8+。<br>您可以点击“<i>新建 达梦数据库</i>”并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: HertzBeat monitors DM database of basic performance metrics such as status and thread, the version we support is DM8+. You could click the "<i>New DM</i>" button and proceed with the configuration or import an existing setup through the "<i>More Actions</i>" menu.
|
||||
zh-TW: HertzBeat 對 DM達夢數據庫 的通用性能指標(basic、status、thread)進行采集監控,支持版本爲 DM8+。<br>您可以點擊“<i>新建 達夢數據庫</i>”並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
|
||||
ja-JP: Hertzbeat は DM データベースの一般的なパフォーマンスのメトリック監視します。<br>「<i>新規 DM データベース</i>」をクリックしてパラメタを設定した後、新規することができます。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/dm
|
||||
en-US: https://hertzbeat.apache.org/docs/help/dm
|
||||
@@ -39,7 +37,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -50,7 +47,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -67,7 +63,6 @@ params:
|
||||
name:
|
||||
zh-CN: 用户名
|
||||
en-US: Username
|
||||
ja-JP: ユーザー名
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
@@ -82,7 +77,6 @@ params:
|
||||
name:
|
||||
zh-CN: 用户密码
|
||||
en-US: Password
|
||||
ja-JP: パスワード
|
||||
# type-param field type(most mapping the html input tag)
|
||||
type: password
|
||||
# required-true or false
|
||||
@@ -95,7 +89,6 @@ params:
|
||||
name:
|
||||
zh-CN: 超时时间
|
||||
en-US: Timeout
|
||||
ja-JP: タイムアウト(ms)
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -111,7 +104,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 基本信息
|
||||
en-US: Basic Info
|
||||
ja-JP: 基礎情報
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -122,19 +114,16 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 端口号
|
||||
en-US: Port Number
|
||||
ja-JP: ポート
|
||||
type: 1
|
||||
- field: CTL_PATH
|
||||
i18n:
|
||||
zh-CN: 控制路径
|
||||
en-US: Control Path
|
||||
ja-JP: 制御パス
|
||||
type: 1
|
||||
- field: MAX_SESSIONS
|
||||
i18n:
|
||||
zh-CN: 最大会话数
|
||||
en-US: Max Sessions
|
||||
ja-JP: 最大セッション数
|
||||
type: 0
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
@@ -169,14 +158,12 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 状态
|
||||
en-US: Status
|
||||
ja-JP: ステータス
|
||||
priority: 1
|
||||
fields:
|
||||
- field: status
|
||||
i18n:
|
||||
zh-CN: 状态
|
||||
en-US: Status
|
||||
ja-JP: ステータス
|
||||
type: 1
|
||||
protocol: jdbc
|
||||
jdbc:
|
||||
@@ -197,26 +184,22 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 线程
|
||||
en-US: Thread
|
||||
ja-JP: スレッド情報
|
||||
priority: 2
|
||||
fields:
|
||||
- field: dm_sql_thd
|
||||
i18n:
|
||||
zh-CN: SQL线程数
|
||||
en-US: SQL Thread
|
||||
ja-JP: SQLスレッド数
|
||||
type: 0
|
||||
- field: dm_io_thd
|
||||
i18n:
|
||||
zh-CN: I/O线程数
|
||||
en-US: I/O Thread
|
||||
ja-JP: I/Oスレッド数
|
||||
type: 0
|
||||
- field: dm_quit_thd
|
||||
i18n:
|
||||
zh-CN: 退出线程数
|
||||
en-US: Quit Thread
|
||||
ja-JP: 終了したスレッド数
|
||||
type: 0
|
||||
aliasFields:
|
||||
- dm_sql_thd
|
||||
|
||||
@@ -21,13 +21,11 @@ app: dns
|
||||
name:
|
||||
zh-CN: DNS服务器监控
|
||||
en-US: DNS SERVER MONITORS
|
||||
ja-JP: DNS サーバーモニター
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: HertzBeat 对 DNS 服务相关指标进行监测。
|
||||
en-US: HertzBeat monitors related indicators of the DNS service.
|
||||
zh-TW: HertzBeat對DNS服務相關名額進行監測。
|
||||
ja-JP: HertzBeatはDNSのメトリックを監視します。
|
||||
# Input params define for monitoring(render web ui by the definition)
|
||||
params:
|
||||
# field-param field key
|
||||
@@ -36,7 +34,6 @@ params:
|
||||
name:
|
||||
zh-CN: DNS服务器IP
|
||||
en-US: DNS Server IP
|
||||
ja-JP: DNS サーバーのIP
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -47,7 +44,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -61,7 +57,6 @@ params:
|
||||
name:
|
||||
zh-CN: 域名解析的地址
|
||||
en-US: Address For DNS
|
||||
ja-JP: アドレス
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# required-true or false
|
||||
@@ -72,7 +67,6 @@ params:
|
||||
name:
|
||||
zh-CN: 连接超时时间(ms)
|
||||
en-US: Connect Timeout(ms)
|
||||
ja-JP: 接続タイムアウト(ms)
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -86,7 +80,6 @@ params:
|
||||
name:
|
||||
zh-CN: 是否使用tcp协议
|
||||
en-US: Use TCP Protocol
|
||||
ja-JP: TCP プロトコルを利用
|
||||
# type-param field type(boolean mapping the html switch tag)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
@@ -99,7 +92,6 @@ params:
|
||||
name:
|
||||
zh-CN: 查询类别
|
||||
en-US: Query Class
|
||||
ja-JP: クエリクラス
|
||||
type: radio
|
||||
required: true
|
||||
options:
|
||||
@@ -123,7 +115,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Header
|
||||
en-US: Header
|
||||
ja-JP: ヘッダ
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -135,49 +126,41 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 响应时间
|
||||
en-US: Response Time
|
||||
ja-JP: 応答時間
|
||||
- field: opcode
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 操作码
|
||||
en-US: Opcode
|
||||
ja-JP: 命令コード
|
||||
- field: status
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 响应状态
|
||||
en-US: Response Status
|
||||
ja-JP: 応答ステータス
|
||||
- field: flags
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 响应标志
|
||||
en-US: Response Flags
|
||||
ja-JP: 応答フラグ
|
||||
- field: questionRowCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 请求记录数
|
||||
en-US: Question Record Count
|
||||
ja-JP: Questionレコード数
|
||||
- field: answerRowCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 响应记录数
|
||||
en-US: Answer Record Count
|
||||
ja-JP: Answerレコード数
|
||||
- field: authorityRowCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 授权记录数
|
||||
en-US: Authority Record Count
|
||||
ja-JP: Authorityレコード数
|
||||
- field: additionalRowCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 附加记录数
|
||||
en-US: Additional Record Count
|
||||
ja-JP: Additionalレコード数
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk, dns
|
||||
protocol: dns
|
||||
# Specific collection configuration when protocol is telnet protocol
|
||||
@@ -200,7 +183,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Question
|
||||
en-US: Question
|
||||
ja-JP: Question
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 1
|
||||
@@ -211,7 +193,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Section
|
||||
en-US: Section
|
||||
ja-JP: Section
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk, dns
|
||||
protocol: dns
|
||||
# Specific collection configuration when protocol is telnet protocol
|
||||
@@ -234,7 +215,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Answer
|
||||
en-US: Answer
|
||||
ja-JP: Answer
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 2
|
||||
@@ -245,61 +225,51 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Section0
|
||||
en-US: Section0
|
||||
ja-JP: Section0
|
||||
- field: section1
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section1
|
||||
en-US: Section1
|
||||
ja-JP: Section1
|
||||
- field: section2
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section2
|
||||
en-US: Section2
|
||||
ja-JP: Section2
|
||||
- field: section3
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section3
|
||||
en-US: Section3
|
||||
ja-JP: Section3
|
||||
- field: section4
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section4
|
||||
en-US: Section4
|
||||
ja-JP: Section4
|
||||
- field: section5
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section5
|
||||
en-US: Section5
|
||||
ja-JP: Section5
|
||||
- field: section6
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section6
|
||||
en-US: Section6
|
||||
ja-JP: Section6
|
||||
- field: section7
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section7
|
||||
en-US: Section7
|
||||
ja-JP: Section7
|
||||
- field: section8
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section8
|
||||
en-US: Section8
|
||||
ja-JP: Section8
|
||||
- field: section9
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section9
|
||||
en-US: Section9
|
||||
ja-JP: Section9
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk, dns
|
||||
protocol: dns
|
||||
# Specific collection configuration when protocol is telnet protocol
|
||||
@@ -322,7 +292,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Authority
|
||||
en-US: Authority
|
||||
ja-JP: Authority
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 3
|
||||
@@ -333,61 +302,51 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Section0
|
||||
en-US: Section0
|
||||
ja-JP: Section0
|
||||
- field: section1
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section1
|
||||
en-US: Section1
|
||||
ja-JP: Section1
|
||||
- field: section2
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section2
|
||||
en-US: Section2
|
||||
ja-JP: Section2
|
||||
- field: section3
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section3
|
||||
en-US: Section3
|
||||
ja-JP: Section3
|
||||
- field: section4
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section4
|
||||
en-US: Section4
|
||||
ja-JP: Section4
|
||||
- field: section5
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section5
|
||||
en-US: Section5
|
||||
ja-JP: Section5
|
||||
- field: section6
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section6
|
||||
en-US: Section6
|
||||
ja-JP: Section6
|
||||
- field: section7
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section7
|
||||
en-US: Section7
|
||||
ja-JP: Section7
|
||||
- field: section8
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section8
|
||||
en-US: Section8
|
||||
ja-JP: Section8
|
||||
- field: section9
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section9
|
||||
en-US: Section9
|
||||
ja-JP: Section9
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk, dns
|
||||
protocol: dns
|
||||
# Specific collection configuration when protocol is telnet protocol
|
||||
@@ -410,7 +369,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Additional
|
||||
en-US: Additional
|
||||
ja-JP: Additional
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 4
|
||||
@@ -421,61 +379,51 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Section0
|
||||
en-US: Section0
|
||||
ja-JP: Section0
|
||||
- field: section1
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section1
|
||||
en-US: Section1
|
||||
ja-JP: Section1
|
||||
- field: section2
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section2
|
||||
en-US: Section2
|
||||
ja-JP: Section2
|
||||
- field: section3
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section3
|
||||
en-US: Section3
|
||||
ja-JP: Section3
|
||||
- field: section4
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section4
|
||||
en-US: Section4
|
||||
ja-JP: Section4
|
||||
- field: section5
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section5
|
||||
en-US: Section5
|
||||
ja-JP: Section5
|
||||
- field: section6
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section6
|
||||
en-US: Section6
|
||||
ja-JP: Section6
|
||||
- field: section7
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section7
|
||||
en-US: Section7
|
||||
ja-JP: Section7
|
||||
- field: section8
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section8
|
||||
en-US: Section8
|
||||
ja-JP: Section8
|
||||
- field: section9
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Section9
|
||||
en-US: Section9
|
||||
ja-JP: Section9
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk, dns
|
||||
protocol: dns
|
||||
# Specific collection configuration when protocol is telnet protocol
|
||||
|
||||
@@ -21,7 +21,6 @@ app: dns_sd
|
||||
name:
|
||||
zh-CN: Dns Service Discovery
|
||||
en-US: Dns Service Discovery
|
||||
ja-JP: Dns サービスディスカバリー
|
||||
# Input params define for app api(render web ui by the definition)
|
||||
params:
|
||||
# field-param field key
|
||||
@@ -30,7 +29,6 @@ params:
|
||||
name:
|
||||
zh-CN: DNS地址
|
||||
en-US: DNS Host
|
||||
ja-JP: DNS ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# required-true or false
|
||||
@@ -41,7 +39,6 @@ params:
|
||||
name:
|
||||
zh-CN: DNS端口
|
||||
en-US: DNS Port
|
||||
ja-JP: DNS ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# required-true or false
|
||||
@@ -53,7 +50,6 @@ params:
|
||||
name:
|
||||
zh-CN: 记录类型
|
||||
en-US: Record Type
|
||||
ja-JP: レコードタイプ
|
||||
# type-param field type(radio mapping the html radio tag)
|
||||
type: radio
|
||||
# required-true or false
|
||||
@@ -75,7 +71,6 @@ params:
|
||||
name:
|
||||
zh-CN: 记录名
|
||||
en-US: Record Name
|
||||
ja-JP: レコード名
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# required-true or false
|
||||
@@ -85,7 +80,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 监控目标
|
||||
en-US: Monitor Target
|
||||
ja-JP: 監視対象
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -97,13 +91,11 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Host
|
||||
en-US: Host
|
||||
ja-JP: ホスト
|
||||
- field: port
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Port
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: dns_sd
|
||||
# the config content when protocol is dns_sd
|
||||
|
||||
@@ -21,13 +21,11 @@ app: docker
|
||||
name:
|
||||
zh-CN: Docker
|
||||
en-US: Docker
|
||||
ja-JP: Docker
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: HertzBeat 对 Docker 容器的通用性能指标(system、containers、stats)进行采集监控。<br><span class='help_module_span'>注意⚠️:为了监控 Docker 中的容器信息,您需要打开端口,让采集请求获取到对应的信息, <a class='help_module_content' href='https://hertzbeat.apache.org/zh-cn/docs/help/docker'>点击查看开启步骤</a>。</span>
|
||||
en-US: HertzBeat monitoring Docker of general performance metrics such as containers, status etc. <br><span class='help_module_span'>Note⚠️:In order to monitoring metrics of Docker, you need to enable the data export port so that the collector can collect data from here,<a class='help_module_content' href='https://hertzbeat.apache.org/docs/help/docker'>Click here to view the steps</a>.</span>
|
||||
zh-TW: HertzBeat 對 Docker 容器的通用性能指標(system、containers、stats)進行采集監控。<br><span class='help_module_span'>注意⚠️:爲了監控 Docker 中的容器信息,您需要打開端口,讓采集請求獲取到對應的信息, <a class='help_module_content' href='https://hertzbeat.apache.org/zh-cn/docs/help/docker'>點擊查看開啓步驟</a>。</span>
|
||||
ja-JP: HertzBeat は Dockerコンテナの一般的なパフォーマンスのメトリック監視します。<br><span class='help_module_span'>注意⚠️:Dockerコンテナの情報を監視するために、ポートを有効にする必要があります。<a class='help_module_content' href='https://hertzbeat.apache.org/docs/help/docker'>クリックしてガイドを見ます</a>。</span>
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/docker/
|
||||
en-US: https://hertzbeat.apache.org/docs/help/docker/
|
||||
@@ -39,7 +37,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-field type, style (most map input tag type attribute)
|
||||
type: host
|
||||
# Is it mandatory? true-required false-optional
|
||||
@@ -48,7 +45,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
type: number
|
||||
# When type is number, use range to represent the range
|
||||
range: '[0,65535]'
|
||||
@@ -58,7 +54,6 @@ params:
|
||||
name:
|
||||
zh-CN: SSL连接
|
||||
en-US: SSL
|
||||
ja-JP: SSL利用
|
||||
# shen the type is boolean, the front end uses switch to display the switch
|
||||
type: boolean
|
||||
required: false
|
||||
@@ -67,7 +62,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 系统
|
||||
en-US: system
|
||||
ja-JP: システム
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -78,74 +72,62 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 主机名
|
||||
en-US: name
|
||||
ja-JP: ホスト名
|
||||
type: 1
|
||||
- field: version
|
||||
i18n:
|
||||
zh-CN: 版本
|
||||
en-US: version
|
||||
ja-JP: バージョン
|
||||
type: 1
|
||||
- field: os
|
||||
i18n:
|
||||
zh-CN: 操作系统
|
||||
en-US: os
|
||||
ja-JP: オーエス
|
||||
type: 1
|
||||
- field: root_dir
|
||||
i18n:
|
||||
zh-CN: 根目录
|
||||
en-US: root dir
|
||||
ja-JP: ルートディレクトリ
|
||||
type: 1
|
||||
- field: containers
|
||||
i18n:
|
||||
zh-CN: 容器总数
|
||||
en-US: containers
|
||||
ja-JP: コンテナ数
|
||||
type: 0
|
||||
- field: containers_running
|
||||
i18n:
|
||||
zh-CN: 运行容器数
|
||||
en-US: running containers
|
||||
ja-JP: 実行中のコンテナ数
|
||||
type: 0
|
||||
- field: containers_paused
|
||||
i18n:
|
||||
zh-CN: 暂停容器数
|
||||
en-US: paused containers
|
||||
ja-JP: 一時停止中のコンテナ数
|
||||
type: 0
|
||||
- field: containers_stopped
|
||||
i18n:
|
||||
zh-CN: 已停止容器数
|
||||
en-US: stopped containers
|
||||
ja-JP: 停止したコンテナの数
|
||||
type: 0
|
||||
- field: images
|
||||
i18n:
|
||||
zh-CN: 镜像数
|
||||
en-US: images
|
||||
ja-JP: イメージ数
|
||||
type: 0
|
||||
- field: ncpu
|
||||
i18n:
|
||||
zh-CN: CPU数量
|
||||
en-US: ncpu
|
||||
ja-JP: CPU数
|
||||
type: 0
|
||||
- field: mem_total
|
||||
i18n:
|
||||
zh-CN: 内存总量
|
||||
en-US: total memory
|
||||
ja-JP: メモリ容量
|
||||
type: 0
|
||||
unit: MB
|
||||
- field: system_time
|
||||
i18n:
|
||||
zh-CN: 系统时间
|
||||
en-US: system time
|
||||
ja-JP: システム時間
|
||||
type: 1
|
||||
aliasFields:
|
||||
- Name
|
||||
@@ -197,7 +179,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 容器总数
|
||||
en-US: containers
|
||||
ja-JP: コンテナ数
|
||||
# The smaller the priority value (0-127), the higher the priority of the metrics. Lower-priority metricss will be scheduled after higher-priority metricss have been collected. metricss with the same priority will be scheduled to collect data in parallel.
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 1
|
||||
@@ -208,37 +189,31 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 主键
|
||||
en-US: ID
|
||||
ja-JP: 主キー
|
||||
type: 1
|
||||
- field: name
|
||||
i18n:
|
||||
zh-CN: 名称
|
||||
en-US: name
|
||||
ja-JP: 名前
|
||||
type: 1
|
||||
- field: image
|
||||
i18n:
|
||||
zh-CN: 镜像
|
||||
en-US: image
|
||||
ja-JP: イメージ
|
||||
type: 1
|
||||
- field: command
|
||||
i18n:
|
||||
zh-CN: 命令行
|
||||
en-US: command
|
||||
ja-JP: 指令
|
||||
type: 1
|
||||
- field: state
|
||||
i18n:
|
||||
zh-CN: 状态
|
||||
en-US: state
|
||||
ja-JP: 状態
|
||||
type: 1
|
||||
- field: status
|
||||
i18n:
|
||||
zh-CN: 状态
|
||||
en-US: status
|
||||
ja-JP: 健全状態
|
||||
type: 1
|
||||
aliasFields:
|
||||
- Id
|
||||
@@ -276,53 +251,45 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 状态
|
||||
en-US: stats
|
||||
ja-JP: スタッツ
|
||||
priority: 2
|
||||
fields:
|
||||
- field: name
|
||||
i18n:
|
||||
zh-CN: 名称
|
||||
en-US: name
|
||||
ja-JP: 名前
|
||||
type: 1
|
||||
- field: available_memory
|
||||
i18n:
|
||||
zh-CN: 可用内存
|
||||
en-US: available memory
|
||||
ja-JP: 使用可能なメモリ
|
||||
type: 0
|
||||
unit: MB
|
||||
- field: used_memory
|
||||
i18n:
|
||||
zh-CN: 已用内存
|
||||
en-US: used memory
|
||||
ja-JP: 使用済みメモリ
|
||||
type: 0
|
||||
unit: MB
|
||||
- field: memory_usage
|
||||
i18n:
|
||||
zh-CN: 内存使用率
|
||||
en-US: memory usage
|
||||
ja-JP: メモリ使用率
|
||||
type: 0
|
||||
unit: '%'
|
||||
- field: cpu_delta
|
||||
i18n:
|
||||
zh-CN: 已使用CPU数
|
||||
en-US: cpu delta
|
||||
ja-JP: 使用中のCPUコア数
|
||||
type: 0
|
||||
- field: number_cpus
|
||||
i18n:
|
||||
zh-CN: 可使用CPU数
|
||||
en-US: cpus number
|
||||
ja-JP: 使用可能なCPUコア数
|
||||
type: 0
|
||||
- field: cpu_usage
|
||||
i18n:
|
||||
zh-CN: CPU使用率
|
||||
en-US: cpu usage
|
||||
ja-JP: CPU使用率
|
||||
type: 0
|
||||
unit: '%'
|
||||
aliasFields:
|
||||
|
||||
@@ -20,13 +20,11 @@ app: doris_be
|
||||
name:
|
||||
zh-CN: Apache Doris BE
|
||||
en-US: Apache Doris BE
|
||||
ja-JP: Apache Doris BE
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: Hertzbeat 对 DORIS 数据库BE的通用性能指标(load channel count、memtable flush total、process thread num、light work max threads等)进行采集监控,支持版本为DORIS2.0.0。<br>您可以点击 “<i>新建 Doris DatabaseBE</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
zh-CN: Hertzbeat 对 DORIS 数据库FE的通用性能指标(load channel count、memtable flush total、process thread num、light work max threads等)进行采集监控,支持版本为DORIS2.0.0。<br>您可以点击 “<i>新建 Doris DatabaseBE</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: Hertzbeat monitoring Doris DatabaseBE through general performance metric such as load channel count, memtable flush total, process thread num and light work max threads. The version we support is DORIS2.0.0. You could click the "<i>New Doris DatabaseBE Monitor</i>" button and proceed with the configuration or import an existing setup through the "<i>More Actions</i>" menu.
|
||||
zh-TW: Hertzbeat 對 DORIS 資料庫BE的通用性能指標(load channel count、memtable flush total、process thread num、light work max threads等)進行採集監控,支持版本為DORIS2.0.0。<br>您可以點擊“<i>新建Doris DatabaseBE</i>”並進行配寘,或者選擇“<i>更多操作</i>”,導入已有配寘。
|
||||
ja-JP: Hertzbeat は DORIS 2.0.0のデータベースBEの一般的なパフォーマンスのメトリック監視します。<br>「<i>新規 Doris DatabaseBE</i>」をクリックしてパラメタを設定した後、新規することができます。
|
||||
zh-TW: Hertzbeat 對 DORIS 資料庫FE的通用性能指標(load channel count、memtable flush total、process thread num、light work max threads等)進行採集監控,支持版本為DORIS2.0.0。<br>您可以點擊“<i>新建Doris DatabaseBE</i>”並進行配寘,或者選擇“<i>更多操作</i>”,導入已有配寘。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/doris_be/
|
||||
en-US: https://hertzbeat.apache.org/docs/help/doris_be/
|
||||
@@ -38,7 +36,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标 Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -47,7 +44,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -59,7 +55,6 @@ params:
|
||||
name:
|
||||
zh-CN: 查询超时时间
|
||||
en-US: Query Timeout
|
||||
ja-JP: クエリタイムアウト
|
||||
type: number
|
||||
required: false
|
||||
# hide param-true or false
|
||||
@@ -70,7 +65,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 加载通道数
|
||||
en-US: Load Channel Count
|
||||
ja-JP: ロードチャンネル数
|
||||
priority: 0
|
||||
fields:
|
||||
- field: value
|
||||
@@ -88,7 +82,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Memtable 刷新总数
|
||||
en-US: Memtable Flush Total
|
||||
ja-JP: Memtableのリフレッシュ回数
|
||||
priority: 1
|
||||
fields:
|
||||
- field: value
|
||||
@@ -106,7 +99,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Plan Fragment 数量
|
||||
en-US: Plan Fragment Count
|
||||
ja-JP: Plan Fragment数
|
||||
priority: 2
|
||||
fields:
|
||||
- field: value
|
||||
@@ -124,7 +116,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 进程线程数
|
||||
en-US: Process Thread Num
|
||||
ja-JP: プロセススレッド数
|
||||
priority: 3
|
||||
fields:
|
||||
- field: value
|
||||
@@ -142,7 +133,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 查询扫描行数
|
||||
en-US: Query Scan Rows
|
||||
ja-JP: クエリのスキャン行数
|
||||
priority: 4
|
||||
fields:
|
||||
- field: value
|
||||
@@ -160,7 +150,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 结果缓冲区块数
|
||||
en-US: Result Buffer Block Count
|
||||
ja-JP: 結果バッファブロック数
|
||||
priority: 5
|
||||
fields:
|
||||
- field: value
|
||||
@@ -178,7 +167,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 批量发送线程池队列大小
|
||||
en-US: Send Batch Thread Pool Queue Size
|
||||
ja-JP: バッチ送信スレッドプールのキューサイズ
|
||||
priority: 6
|
||||
fields:
|
||||
- field: value
|
||||
@@ -196,7 +184,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Tablet Base 最大压缩分数
|
||||
en-US: Tablet Base Max Compaction Score
|
||||
ja-JP: Tablet Base最大圧縮スコア
|
||||
priority: 7
|
||||
fields:
|
||||
- field: value
|
||||
@@ -214,7 +201,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 超时取消的 Fragment 数量
|
||||
en-US: Timeout Canceled Fragment Count
|
||||
ja-JP: タイムアウトでキャンセルされたFragment数
|
||||
priority: 8
|
||||
fields:
|
||||
- field: value
|
||||
@@ -232,7 +218,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 加载行数
|
||||
en-US: Load Rows
|
||||
ja-JP: ロード行数
|
||||
priority: 9
|
||||
fields:
|
||||
- field: value
|
||||
@@ -250,7 +235,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Rowset 总数
|
||||
en-US: All Rowsets Num
|
||||
ja-JP: Rowset数
|
||||
priority: 10
|
||||
fields:
|
||||
- field: value
|
||||
@@ -268,7 +252,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Segment 总数
|
||||
en-US: All Segments Num
|
||||
ja-JP: Segment数
|
||||
priority: 11
|
||||
fields:
|
||||
- field: value
|
||||
@@ -286,7 +269,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 繁重工作最大线程数
|
||||
en-US: Heavy Work Max Threads
|
||||
ja-JP: 重作業用最大スレッド数
|
||||
priority: 12
|
||||
fields:
|
||||
- field: value
|
||||
@@ -304,7 +286,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 轻量工作最大线程数
|
||||
en-US: Light Work Max Threads
|
||||
ja-JP: 軽作業用最大スレッド数
|
||||
priority: 13
|
||||
fields:
|
||||
- field: value
|
||||
@@ -322,7 +303,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 繁重工作池队列大小
|
||||
en-US: Heavy Work Pool Queue Size
|
||||
ja-JP: 重作業用プールのキューサイズ
|
||||
priority: 14
|
||||
fields:
|
||||
- field: value
|
||||
@@ -340,7 +320,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 轻量工作池队列大小
|
||||
en-US: Light Work Pool Queue Size
|
||||
ja-JP: 軽作業用プールのキューサイズ
|
||||
priority: 15
|
||||
fields:
|
||||
- field: value
|
||||
@@ -358,7 +337,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 繁重工作活跃线程数
|
||||
en-US: Heavy Work Active Threads
|
||||
ja-JP: 活動中の重作業用スレッド数
|
||||
priority: 16
|
||||
fields:
|
||||
- field: value
|
||||
@@ -376,7 +354,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 轻量工作活跃线程数
|
||||
en-US: Light Work Active Threads
|
||||
ja-JP: 活動中の軽作業用スレッド数
|
||||
priority: 17
|
||||
fields:
|
||||
- field: value
|
||||
@@ -394,7 +371,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 压缩字节总数
|
||||
en-US: Compaction Bytes Total
|
||||
ja-JP: 圧縮バイト合計
|
||||
priority: 18
|
||||
fields:
|
||||
- field: type
|
||||
@@ -415,7 +391,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 磁盘可用容量
|
||||
en-US: Disks Avail Capacity
|
||||
ja-JP: 利用可能なディスク容量
|
||||
priority: 19
|
||||
fields:
|
||||
- field: path
|
||||
@@ -436,7 +411,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 磁盘总容量
|
||||
en-US: Disks Total Capacity
|
||||
ja-JP: ディスク容量
|
||||
priority: 20
|
||||
fields:
|
||||
- field: path
|
||||
@@ -457,7 +431,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 本地读取字节总数
|
||||
en-US: Local Bytes Read Total
|
||||
ja-JP: 読み取られたバイト数
|
||||
priority: 21
|
||||
fields:
|
||||
- field: value
|
||||
@@ -476,7 +449,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 本地写入字节总数
|
||||
en-US: Local Bytes Written Total
|
||||
ja-JP: 書き込まれたバイト数
|
||||
priority: 22
|
||||
fields:
|
||||
- field: value
|
||||
@@ -495,7 +467,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 内存分配字节
|
||||
en-US: Memory Allocated Bytes
|
||||
ja-JP: メモリ割り当てバイト
|
||||
priority: 23
|
||||
fields:
|
||||
- field: value
|
||||
|
||||
@@ -20,13 +20,11 @@ app: doris_fe
|
||||
name:
|
||||
zh-CN: Apache Doris FE
|
||||
en-US: Apache Doris FE
|
||||
ja-JP: Apache Doris FE
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: Hertzbeat 对 Doris 数据库FE的通用指标(doris_fe connection total、doris_fe edit log clean、doris_fe image、doris_fe rps等)进行测量监控,支持版本为DORIS2.0.0。<br>您可以点击 “<i>新建 Doris DatabaseFE</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: Hertzbeat monitoring Doris DatabaseFE through general performance metric such as doris_fe connection total, doris_fe edit log clean, doris_fe image and doris_fe rps. The version we support is DORIS2.0.0. You could click the "<i>New Doris DatabaseFE Monitor</i>" button and proceed with the configuration or import an existing setup through the "<i>More Actions</i>" menu.
|
||||
zh-TW: Hertzbeat 對 Doris 資料庫FE的通用名額(doris_fe connection total、doris_fe edit log clean、doris_fe image、doris_fe rps等)進行量測監控,支持版本為DORIS2.0.0。<br>您可以點擊“<i>新建Doris DatabaseFE</i>”並進行配寘,或者選擇“<i>更多操作</i>”,導入已有配寘。
|
||||
ja-JP: Hertzbeat は DORIS 2.0.0のデータベースFEの一般的なパフォーマンスのメトリック監視します。<br>「<i>新規 Doris DatabaseFE</i>」をクリックしてパラメタを設定した後、新規することができます。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/doris_fe/
|
||||
en-US: https://hertzbeat.apache.org/docs/help/doris_fe/
|
||||
@@ -38,7 +36,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标 Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -47,7 +44,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -59,7 +55,6 @@ params:
|
||||
name:
|
||||
zh-CN: 查询超时时间
|
||||
en-US: Query Timeout
|
||||
ja-JP: クエリタイムアウト
|
||||
type: number
|
||||
required: false
|
||||
# hide param-true or false
|
||||
@@ -70,7 +65,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 连接总数
|
||||
en-US: Connection Total
|
||||
ja-JP: コネクション数
|
||||
priority: 0
|
||||
fields:
|
||||
- field: value
|
||||
@@ -93,7 +87,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 编辑日志清理
|
||||
en-US: Edit Log Clean
|
||||
ja-JP: 編集ログのクリーン
|
||||
priority: 1
|
||||
fields:
|
||||
- field: type
|
||||
@@ -118,7 +111,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 编辑日志
|
||||
en-US: Edit Log
|
||||
ja-JP: 編集ログ
|
||||
priority: 2
|
||||
fields:
|
||||
- field: type
|
||||
@@ -143,7 +135,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 图片清理
|
||||
en-US: Image Clean
|
||||
ja-JP: イメージのクリーン
|
||||
priority: 3
|
||||
fields:
|
||||
- field: type
|
||||
@@ -168,7 +159,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 图片写入
|
||||
en-US: Image Write
|
||||
ja-JP: イメージを書き込む
|
||||
priority: 4
|
||||
fields:
|
||||
- field: type
|
||||
@@ -193,7 +183,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 查询错误
|
||||
en-US: Query Error
|
||||
ja-JP: クエリエラー
|
||||
priority: 5
|
||||
fields:
|
||||
- field: value
|
||||
@@ -216,7 +205,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 最大日志ID
|
||||
en-US: Max Journal ID
|
||||
ja-JP: マックスジャーナルID
|
||||
priority: 6
|
||||
fields:
|
||||
- field: value
|
||||
@@ -239,7 +227,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 最大Tablet压缩分数
|
||||
en-US: Max Tablet Compaction Score
|
||||
ja-JP: Tablet最大圧縮スコア
|
||||
priority: 7
|
||||
fields:
|
||||
- field: value
|
||||
@@ -262,7 +249,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 每秒查询率
|
||||
en-US: QPS
|
||||
ja-JP: QPS
|
||||
priority: 8
|
||||
fields:
|
||||
- field: value
|
||||
@@ -285,7 +271,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 查询错误率
|
||||
en-US: Query Error Rate
|
||||
ja-JP: クエリエラー率
|
||||
priority: 9
|
||||
fields:
|
||||
- field: value
|
||||
@@ -310,7 +295,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 报告队列大小
|
||||
en-US: Report Queue Size
|
||||
ja-JP: レポートのキューサイズ
|
||||
priority: 10
|
||||
fields:
|
||||
- field: value
|
||||
@@ -333,7 +317,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 每秒转数
|
||||
en-US: RPS
|
||||
ja-JP: RPS
|
||||
priority: 11
|
||||
fields:
|
||||
- field: value
|
||||
@@ -356,7 +339,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 调度 Tablet 数量
|
||||
en-US: Scheduled Tablet Num
|
||||
ja-JP: Tablet予定数
|
||||
priority: 12
|
||||
fields:
|
||||
- field: value
|
||||
@@ -379,7 +361,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 事务状态
|
||||
en-US: Transaction Status
|
||||
ja-JP: トランザクション状態
|
||||
priority: 13
|
||||
fields:
|
||||
- field: type
|
||||
|
||||
@@ -21,13 +21,11 @@ app: dynamic_tp
|
||||
name:
|
||||
zh-CN: DynamicTp 线程池
|
||||
en-US: DynamicTp Pool
|
||||
ja-JP: DynamicTpスレッドプール
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: HertzBeat 对 DynamicTp actuator 暴露的线程池性能指标(thread pool)进行采集监控。<br><span class='help_module_span'>注意⚠️:您需要集成使用 DynamicTp,<a class='help_module_content' href='https://hertzbeat.apache.org/zh-cn/docs/help/dynamic_tp'>点击查看集成步骤</a>。
|
||||
en-US: HertzBeat monitoring DynamicTp of the thread Pool Performance Metrics which exposed by DynamicTp actuator. <br><span class='help_module_span'>Note⚠️:You should integrate and use DynamicTp, <a class='help_module_content' href='https://hertzbeat.apache.org/docs/help/dynamic_tp'>Click here to view the specific steps.</a>"
|
||||
zh-TW: HertzBeat 對 DynamicTp actuator暴露的執行緒池性能指標(thread pool)進行採集監控。<br><span class='help_ module_ span'>注意⚠️:您需要集成使用DynamicTp,<a class='help_ module_ content' href='https://hertzbeat.apache.org/zh-cn/docs/help/dynamic_tp'>點擊查看集成步驟</a>。
|
||||
ja-JP: HertzBeat は DynamicTpスレッドプールの一般的なパフォーマンスのメトリック監視します。<br><span class='help_module_span'>注意⚠️:DynamicTpの使用を統合する必要があり、<a class='help_module_content' href='https://hertzbeat.apache.org/docs/help/dynamic_tp'>クリックしてガイドを見ます</a>。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/dynamic_tp/
|
||||
en-US: https://hertzbeat.apache.org/docs/help/dynamic_tp/
|
||||
@@ -39,7 +37,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -50,7 +47,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -65,7 +61,6 @@ params:
|
||||
name:
|
||||
zh-CN: 启动SSL
|
||||
en-US: SSL
|
||||
ja-JP: SSL利用
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
@@ -76,7 +71,6 @@ params:
|
||||
name:
|
||||
zh-CN: Base Path
|
||||
en-US: Base Path
|
||||
ja-JP: Base Path
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# default value
|
||||
@@ -92,7 +86,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 线程池
|
||||
en-US: thread pool
|
||||
ja-JP: スレッドプール
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -103,44 +96,37 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 池名称
|
||||
en-US: pool name
|
||||
ja-JP: プール名
|
||||
type: 1
|
||||
label: true
|
||||
- field: queue_type
|
||||
i18n:
|
||||
zh-CN: 队列类型
|
||||
en-US: queue type
|
||||
ja-JP: キュータイプ
|
||||
type: 1
|
||||
- field: core_pool_size
|
||||
i18n:
|
||||
zh-CN: 核心线程数
|
||||
en-US: core pool size
|
||||
ja-JP: コアのスレッド数
|
||||
type: 0
|
||||
- field: maximum_pool_size
|
||||
i18n:
|
||||
zh-CN: 最大线程数
|
||||
en-US: maximum pool size
|
||||
ja-JP: 最大スレッド数
|
||||
type: 0
|
||||
- field: fair
|
||||
i18n:
|
||||
zh-CN: 公平
|
||||
en-US: fair
|
||||
ja-JP: 目標ホスト
|
||||
type: 1
|
||||
- field: reject_handler_name
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 拒绝策略
|
||||
en-US: reject handler name
|
||||
ja-JP: 拒否戦略
|
||||
- field: dynamic
|
||||
i18n:
|
||||
zh-CN: 动态
|
||||
en-US: dynamic
|
||||
ja-JP: dynamic
|
||||
type: 1
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
@@ -184,89 +170,75 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 运行中的线程池
|
||||
en-US: thread pool running
|
||||
ja-JP: 実行中のスレッドプール
|
||||
priority: 1
|
||||
fields:
|
||||
- field: pool_name
|
||||
i18n:
|
||||
zh-CN: 池名称
|
||||
en-US: pool name
|
||||
ja-JP: プール名
|
||||
type: 1
|
||||
label: true
|
||||
- field: queue_capacity
|
||||
i18n:
|
||||
zh-CN: 队列容量
|
||||
en-US: queue capacity
|
||||
ja-JP: キュー容量
|
||||
type: 0
|
||||
unit: MB
|
||||
- field: queue_size
|
||||
i18n:
|
||||
zh-CN: 队列大小
|
||||
en-US: queue size
|
||||
ja-JP: キューサイズ
|
||||
type: 0
|
||||
- field: queue_remaining_capacity
|
||||
i18n:
|
||||
zh-CN: 队列剩余容量
|
||||
en-US: queue remaining capacity
|
||||
ja-JP: 使用可能なキュー容量
|
||||
type: 0
|
||||
unit: MB
|
||||
- field: active_count
|
||||
i18n:
|
||||
zh-CN: 活动线程数
|
||||
en-US: active count
|
||||
ja-JP: 活動中のスレッド数
|
||||
type: 0
|
||||
- field: task_count
|
||||
i18n:
|
||||
zh-CN: 任务数
|
||||
en-US: task count
|
||||
ja-JP: タスク数
|
||||
type: 0
|
||||
- field: completed_task_count
|
||||
i18n:
|
||||
zh-CN: 完成的任务数
|
||||
en-US: completed task count
|
||||
ja-JP: 完了したタスク数
|
||||
type: 0
|
||||
- field: largest_pool_size
|
||||
i18n:
|
||||
zh-CN: 最大线程数
|
||||
en-US: largest pool size
|
||||
ja-JP: 最大スレッド数
|
||||
type: 0
|
||||
- field: pool_size
|
||||
i18n:
|
||||
zh-CN: 线程池大小
|
||||
en-US: pool size
|
||||
ja-JP: プールサイズ
|
||||
type: 0
|
||||
- field: wait_task_count
|
||||
i18n:
|
||||
zh-CN: 等待任务数
|
||||
en-US: wait task count
|
||||
ja-JP: 待機中のタスク数
|
||||
type: 0
|
||||
- field: reject_count
|
||||
i18n:
|
||||
zh-CN: 拒绝数
|
||||
en-US: reject count
|
||||
ja-JP: 拒否数
|
||||
type: 0
|
||||
- field: run_timeout_count
|
||||
i18n:
|
||||
zh-CN: 运行超时数
|
||||
en-US: run timeout count
|
||||
ja-JP: 実行タイムアウト数
|
||||
type: 0
|
||||
- field: queue_timeout_count
|
||||
i18n:
|
||||
zh-CN: 队列超时数
|
||||
en-US: queue timeout count
|
||||
ja-JP: キュータイムアウト数
|
||||
type: 0
|
||||
aliasFields:
|
||||
- poolName
|
||||
|
||||
@@ -21,13 +21,11 @@ app: elasticsearch
|
||||
name:
|
||||
zh-CN: ElasticSearch
|
||||
en-US: ElasticSearch
|
||||
ja-JP: ElasticSearch
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: Hertzbeat 对 ElasticSearch 数据库监控通用指标进行测量监控。<br>您可以点击 “<i>新建 ElasticSearch</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: Hertzbeat monitoring ElasticSearch through general performance metrics. You could click the "<i>New ElasticSearch</i>" button and proceed with the configuration or import an existing setup through the "<i>More Actions</i>" menu.
|
||||
zh-TW: Hertzbeat 對 ElasticSearch 資料庫監控通用名額進行量測監控。<br>您可以點擊“<i>新建ElasticSearch</i>”並進行配寘,或者選擇“<i>更多操作</i>”,導入已有配寘。
|
||||
ja-JP: HertzBeat は ElasticSearch データベースの一般的なパフォーマンスのメトリック監視します。<br>「<i>新規 ElasticSearch</i>」をクリックしてパラメタを設定した後、新規することができます。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/elasticsearch
|
||||
en-US: https://hertzbeat.apache.org/docs/help/elasticsearch
|
||||
@@ -39,7 +37,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -50,7 +47,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -65,7 +61,6 @@ params:
|
||||
name:
|
||||
zh-CN: 查询超时时间
|
||||
en-US: Query Timeout
|
||||
ja-JP: クエリタイムアウト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# required-true or false
|
||||
@@ -80,7 +75,6 @@ params:
|
||||
name:
|
||||
zh-CN: 启用HTTPS
|
||||
en-US: SSL
|
||||
ja-JP: SSL利用
|
||||
# type-param field type(boolean mapping the html h tag)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
@@ -91,7 +85,6 @@ params:
|
||||
name:
|
||||
zh-CN: 认证方式
|
||||
en-US: Auth Type
|
||||
ja-JP: 認証方法
|
||||
# type-param field type(most mapping the html input tag)
|
||||
type: radio
|
||||
# required-true or false
|
||||
@@ -108,7 +101,6 @@ params:
|
||||
name:
|
||||
zh-CN: 用户名
|
||||
en-US: Username
|
||||
ja-JP: ユーザー名
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
@@ -121,7 +113,6 @@ params:
|
||||
name:
|
||||
zh-CN: 密码
|
||||
en-US: Password
|
||||
ja-JP: パスワード
|
||||
# type-param field type(most mapping the html input tag)
|
||||
type: password
|
||||
# required-true or false
|
||||
@@ -133,7 +124,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 集群健康状态
|
||||
en-US: Cluster Health Status
|
||||
ja-JP: クラスタ健全状態
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -146,57 +136,49 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 集群名称
|
||||
en-US: Cluster Name
|
||||
ja-JP: クラスタ名
|
||||
- field: status
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 集群状态
|
||||
en-US: status
|
||||
ja-JP: 状態
|
||||
- field: nodes
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 集群节点数
|
||||
en-US: nodes
|
||||
ja-JP: ノード数
|
||||
- field: data_nodes
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 数据节点数
|
||||
en-US: Data Nodes
|
||||
ja-JP: データノード数
|
||||
- field: active_primary_shards
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 主节点活跃分片数
|
||||
en-US: Active Primary Shards
|
||||
ja-JP: 主ノードの活動中シャーズ数
|
||||
- field: active_shards
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 活跃分片数
|
||||
en-US: Active Shards
|
||||
ja-JP: 活動中シャーズ数
|
||||
- field: active_percentage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 分片健康度(%)
|
||||
en-US: Active Percentage
|
||||
ja-JP: シャーズの健全率
|
||||
- field: initializing_shards
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 初始化分片数
|
||||
en-US: Initializing Shards
|
||||
ja-JP: 初期化シャーズ数
|
||||
- field: unassigned_shards
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 未分配分片数
|
||||
en-US: Unassigned Shards
|
||||
ja-JP: 未割り当てシャーズ数
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
# (可选)监控指标别名, 做为中间字段与采集数据字段和指标字段映射转换
|
||||
aliasFields:
|
||||
- cluster_name
|
||||
- status
|
||||
@@ -248,7 +230,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 集群节点信息
|
||||
en-US: Cluster Nodes
|
||||
ja-JP: クラスタノード情報
|
||||
priority: 1
|
||||
fields:
|
||||
- field: total
|
||||
@@ -256,19 +237,16 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 节点数
|
||||
en-US: total
|
||||
ja-JP: ノード数
|
||||
- field: successful
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 在线节点数
|
||||
en-US: successful
|
||||
ja-JP: オンラインノード数
|
||||
- field: failed
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 离线节点数
|
||||
en-US: failed
|
||||
ja-JP: オフラインノード数
|
||||
protocol: http
|
||||
http:
|
||||
host: ^_^host^_^
|
||||
@@ -291,7 +269,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 节点详细信息
|
||||
en-US: Node Detail
|
||||
ja-JP: ノード情報
|
||||
priority: 2
|
||||
fields:
|
||||
- field: node_name
|
||||
@@ -300,73 +277,65 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 节点名称
|
||||
en-US: Node Name
|
||||
ja-JP: ノード名
|
||||
- field: ip
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: IP地址
|
||||
en-US: IP Address
|
||||
ja-JP: IP アドレス
|
||||
- field: cpu_load_average
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: CPU平均负载
|
||||
en-US: Cpu Load Average
|
||||
ja-JP: CPUロードアベレージ
|
||||
- field: cpu_percent
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: CPU占用率
|
||||
en-US: Cpu Percent
|
||||
ja-JP: CPU使用率
|
||||
- field: heap_used
|
||||
type: 0
|
||||
unit: MB
|
||||
i18n:
|
||||
zh-CN: 内存使用量(MB)
|
||||
en-US: Heap Used
|
||||
ja-JP: メモリ使用量(MB)
|
||||
- field: heap_used_percent
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存使用率
|
||||
en-US: Heap Used Percent
|
||||
ja-JP: メモリ使用率
|
||||
- field: heap_total
|
||||
type: 1
|
||||
unit: 'MB'
|
||||
i18n:
|
||||
zh-CN: 总内存(MB)
|
||||
en-US: Heap Total
|
||||
ja-JP: メモリ容量(MB)
|
||||
- field: disk_free
|
||||
type: 0
|
||||
unit: 'GB'
|
||||
i18n:
|
||||
zh-CN: 磁盘剩余容量(GB)
|
||||
en-US: Disk Free
|
||||
ja-JP: 利用可能なディスク容量
|
||||
- field: disk_total
|
||||
type: 1
|
||||
unit: 'GB'
|
||||
i18n:
|
||||
zh-CN: 磁盘总容量
|
||||
en-US: Disk Total
|
||||
ja-JP: ディスク容量
|
||||
- field: disk_used_percent
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 磁盘使用率
|
||||
en-US: Disk Used Percent
|
||||
ja-JP: ディスク使用率
|
||||
aliasFields:
|
||||
- $.name
|
||||
- $.ip
|
||||
# $.os.cpu.load_average.1m 支持 5.x 及以上版本;$.os.load_average 支持 2.x 及以上版本
|
||||
- $.os.cpu.load_average.1m
|
||||
- $.os.load_average
|
||||
# $.os.cpu.percent 支持 5.x 及以上版本;$.os.cpu_percent 支持 2.x 及以上版本
|
||||
- $.os.cpu_percent
|
||||
- $.os.cpu.percent
|
||||
- $.jvm.mem.heap_used_in_bytes
|
||||
|
||||
@@ -21,13 +21,11 @@ app: emqx
|
||||
name:
|
||||
zh-CN: EMQX MQTT
|
||||
en-US: EMQX MQTT
|
||||
ja-JP: EMQX MQTT
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: EMQX 是一款开源的大规模分布式 MQTT 消息服务器。Hertzbeat对EMQX MQTT消息服务器 5.0+ 版本的通用指标进行测量监控,<br>您可以点击 “<i>新建 EMQX 消息服务器</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: EMQX is an open source large-scale distributed MQTT message server. Hertzbeat measures and monitors common metrics of the EMQX message server 5.0+ version.<br>You can click "<i>New EMQX message server</i>" and configure it, or select "<i>More operations</i>", Import existing configuration.
|
||||
zh-TW: EMQX 是一款開源的大規模分散式 MQTT 訊息伺服器。 Hertzbeat對EMQX MQTT訊息伺服器 5.0+ 版本的通用指標進行測量監控,<br>您可以點擊“<i>新建 EMQX 訊息伺服器</i>” 並進行配置,或者選擇“<i>更多操作</i>” ,導入已有配置。
|
||||
ja-JP: EMQXは、オープンソースの大規模分散MQTTメッセージサーバーです。HertzbeatはEMQX MQTTメッセージサーバー(バージョン5.0+)の一般的なフォーマンスのメトリック監視します。<br>「<i>新規 EMQX</i>」をクリックしてパラメタを設定した後、新規することができます。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/emqx
|
||||
en-US: https://hertzbeat.apache.org/docs/help/emqx
|
||||
@@ -39,7 +37,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -50,7 +47,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -63,14 +59,12 @@ params:
|
||||
name:
|
||||
zh-CN: 启用HTTPS
|
||||
en-US: HTTPS
|
||||
ja-JP: HTTPS
|
||||
type: boolean
|
||||
defaultValue: false
|
||||
- field: timeout
|
||||
name:
|
||||
zh-CN: 超时时间(ms)
|
||||
en-US: Timeout(ms)
|
||||
ja-JP: タイムアウト(ms)
|
||||
type: number
|
||||
required: false
|
||||
hide: true
|
||||
@@ -78,7 +72,6 @@ params:
|
||||
name:
|
||||
zh-CN: 认证方式
|
||||
en-US: Auth Type
|
||||
ja-JP: 認証方法
|
||||
type: radio
|
||||
required: true
|
||||
options:
|
||||
@@ -89,14 +82,12 @@ params:
|
||||
name:
|
||||
zh-CN: API Key
|
||||
en-US: API Key
|
||||
ja-JP: API キー
|
||||
type: text
|
||||
required: true
|
||||
- field: secretkey
|
||||
name:
|
||||
zh-CN: Secret Key
|
||||
en-US: Secret Key
|
||||
ja-JP: 鍵
|
||||
type: text
|
||||
required: true
|
||||
metrics:
|
||||
@@ -106,7 +97,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 概要
|
||||
en-US: Summary
|
||||
ja-JP: 概要
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -118,25 +108,21 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 系统版本
|
||||
en-US: Version
|
||||
ja-JP: バージョン
|
||||
- field: node_name
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 节点名称
|
||||
en-US: Node Name
|
||||
ja-JP: ノード名
|
||||
- field: broker_status
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Broker 状态
|
||||
en-US: Broker Status
|
||||
ja-JP: ブローカーステータス
|
||||
- field: app_status
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 应用状态
|
||||
en-US: App Status
|
||||
ja-JP: Appステータス
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- rel_vsn
|
||||
@@ -179,7 +165,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 指标
|
||||
en-US: Metrics
|
||||
ja-JP: メトリック
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 1
|
||||
@@ -191,79 +176,66 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 客户端连接
|
||||
en-US: Client Connected
|
||||
ja-JP: クライアント接続済み
|
||||
- field: client_disconnected
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 客户端断开
|
||||
en-US: Client Disconnected
|
||||
ja-JP: クライアント切断
|
||||
- field: packets_sent
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 发送数据包
|
||||
en-US: Packets Sent
|
||||
ja-JP: 送信パケット
|
||||
- field: packets_received
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 接收数据包
|
||||
en-US: Packets Received
|
||||
ja-JP: 受信パケット
|
||||
- field: bytes_sent
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 发送字节
|
||||
en-US: Bytes Sent
|
||||
ja-JP: 送信バイト数
|
||||
- field: bytes_received
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 接收字节
|
||||
en-US: Bytes Received
|
||||
ja-JP: 受信バイト数
|
||||
- field: messages_sent
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 发送消息
|
||||
en-US: Messages Sent
|
||||
ja-JP: 送信メッセージ
|
||||
- field: messages_acked
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 消息确认
|
||||
en-US: Messages Acked
|
||||
ja-JP: 確認メッセージ
|
||||
- field: messages_delayed
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 延迟消息
|
||||
en-US: Messages Delayed
|
||||
ja-JP: 遅延メッセージ
|
||||
- field: authorization_deny
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 授权拒绝
|
||||
en-US: Authorization Deny
|
||||
ja-JP: 認証拒否
|
||||
- field: client_authorize
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 客户端授权
|
||||
en-US: Client Authorize
|
||||
ja-JP: クライアント認証
|
||||
- field: session_created
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 会话创建
|
||||
en-US: Session Created
|
||||
ja-JP: 目標ホスト
|
||||
- field: session_discarded
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 会话丢弃
|
||||
en-US: Session Discarded
|
||||
ja-JP: 目標ホスト
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- client.connected
|
||||
@@ -324,7 +296,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 统计
|
||||
en-US: Stats
|
||||
ja-JP: スタッツ
|
||||
priority: 2
|
||||
fields:
|
||||
# metrics content contains field-metric name, type-metric type:0-number,1-string, instance-if is metrics, unit-metric unit('%','ms','MB')
|
||||
@@ -333,133 +304,111 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 通道数
|
||||
en-US: Channels Count
|
||||
ja-JP: チャンネル数
|
||||
- field: channels_max
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 通道最大数
|
||||
en-US: Channels Max
|
||||
ja-JP: 最大チャンネル数
|
||||
- field: connections_count
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 连接数
|
||||
en-US: Connections Count
|
||||
ja-JP: 接続数
|
||||
- field: connections_max
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大连接数
|
||||
en-US: Connections Max
|
||||
ja-JP: 最大接続数
|
||||
- field: delayed_count
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 延迟数
|
||||
en-US: Delayed Count
|
||||
ja-JP: 遅延数
|
||||
- field: delayed_max
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大延迟数
|
||||
en-US: Delayed Max
|
||||
ja-JP: 最大遅延数
|
||||
- field: live_connections_count
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 活动连接数
|
||||
en-US: Live Connections Count
|
||||
ja-JP: ライブ接続数
|
||||
- field: live_connections_max
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大活动连接数
|
||||
en-US: Live Connections Max
|
||||
ja-JP: 最大ライブ接続数
|
||||
- field: retained_count
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 保留数
|
||||
en-US: Retained Count
|
||||
ja-JP: 保持数
|
||||
- field: retained_max
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大保留数
|
||||
en-US: Retained Max
|
||||
ja-JP: 最大保持数
|
||||
- field: sessions_count
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 会话数
|
||||
en-US: Sessions Count
|
||||
ja-JP: セッション数
|
||||
- field: sessions_max
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大会话数
|
||||
en-US: Sessions Max
|
||||
ja-JP: 最大セッション数
|
||||
- field: suboptions_count
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 订阅选项数
|
||||
en-US: Suboptions Count
|
||||
ja-JP: サブスクリプションのオプション数
|
||||
- field: suboptions_max
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大订阅选项数
|
||||
en-US: Suboptions Max
|
||||
ja-JP: 最大サブスクリプションのオプション数
|
||||
- field: subscribers_count
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 订阅者数
|
||||
en-US: Subscribers Count
|
||||
ja-JP: サブスクライバー数
|
||||
- field: subscribers_max
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大订阅者数
|
||||
en-US: Subscribers Max
|
||||
ja-JP: 最大サブスクライバー数
|
||||
- field: subscriptions_count
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 订阅数
|
||||
en-US: Subscriptions Count
|
||||
ja-JP: サブスクリプション数
|
||||
- field: subscriptions_max
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大订阅数
|
||||
en-US: Subscriptions Max
|
||||
ja-JP: 最大サブスクリプション数
|
||||
- field: subscriptions_shared_count
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 共享订阅数
|
||||
en-US: Subscriptions Shared Count
|
||||
ja-JP: 共有サブスクリプション数
|
||||
- field: subscriptions_shared_max
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大共享订阅数
|
||||
en-US: Subscriptions Shared Max
|
||||
ja-JP: 最大共有サブスクリプション数
|
||||
- field: topics_count
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 主题数
|
||||
en-US: Topics Count
|
||||
ja-JP: トピック数
|
||||
- field: topics_max
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大主题数
|
||||
en-US: Topics Max
|
||||
ja-JP: 最大トピック数
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- channels.count
|
||||
|
||||
@@ -21,13 +21,11 @@ app: euleros
|
||||
name:
|
||||
zh-CN: EulerOS 操作系统
|
||||
en-US: EulerOS
|
||||
ja-JP: EulerOS
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: Hertzbeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH 协议</a> 对 EulerOS 操作系统的通用性能指标 (系统信息、CPU、内存、磁盘、网卡、文件系统、TOP资源进程等) 进行采集监控。<br>您可以点击“<i>新建 EulerOS</i>”并配置HOST端口账户等相关参数进行添加,支持SSH账户密码或密钥认证。或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: HertzBeat uses <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH protocol</a> to monitors EulerOS operating system's general performance metrics such as cpu, memory, disk, basic, interface, disk_free, top_process etc. <br>You can click the "<i>New EulerOS</i>" and config host port and other related params to add, auth support password or secretKey. Or import an existing setup through the "<i>More Actions</i>" menu.
|
||||
zh-TW: Hertzbeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH 协议</a> 對 EulerOS 操作系统的通用性能指標 (系統信息、CPU、內存、磁盤、網卡、文件系統、TOP資源進程等) 進行採集監控。<br>您可以點擊“<i>新建 EulerOS</i>”並配置HOST端口賬戶等相關參數進行添加,支持SSH賬戶密碼或密鑰認證。或者選擇“<i>更多操作</i>”,導入已有配寘。
|
||||
ja-JP: Hertzbeat は <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSHプロトコルを介して</a> EulerOS システムの一般的なパフォーマンスのメトリック監視します。<br>「<i>新規 EulerOS</i>」をクリックしてホストなどのパラメタを設定した後、新規することができます。SSHまたはキー認証をサポートします。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/euleros
|
||||
en-US: https://hertzbeat.apache.org/docs/help/euleros
|
||||
@@ -39,7 +37,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -50,7 +47,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -65,7 +61,6 @@ params:
|
||||
name:
|
||||
zh-CN: 超时时间(ms)
|
||||
en-US: Timeout(ms)
|
||||
ja-JP: タイムアウト(ms)
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -80,7 +75,6 @@ params:
|
||||
name:
|
||||
zh-CN: 复用连接
|
||||
en-US: Reuse Connection
|
||||
ja-JP: コネクション再利用
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
@@ -92,7 +86,6 @@ params:
|
||||
name:
|
||||
zh-CN: 使用代理
|
||||
en-US: Use Proxy Connection
|
||||
ja-JP: プロキシコネクション利用
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
@@ -104,7 +97,6 @@ params:
|
||||
name:
|
||||
zh-CN: 用户名
|
||||
en-US: Username
|
||||
ja-JP: ユーザー名
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
@@ -117,7 +109,6 @@ params:
|
||||
name:
|
||||
zh-CN: 密码
|
||||
en-US: Password
|
||||
ja-JP: パスワード
|
||||
# type-param field type(most mapping the html input tag)
|
||||
type: password
|
||||
# required-true or false
|
||||
@@ -128,7 +119,6 @@ params:
|
||||
name:
|
||||
zh-CN: 私钥
|
||||
en-US: PrivateKey
|
||||
ja-JP: 秘密鍵
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: textarea
|
||||
placeholder: -----BEGIN RSA PRIVATE KEY-----
|
||||
@@ -142,7 +132,6 @@ params:
|
||||
name:
|
||||
zh-CN: 密钥短语
|
||||
en-US: PrivateKey PassPhrase
|
||||
ja-JP: 秘密鍵フレーズ
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: password
|
||||
# required-true or false
|
||||
@@ -155,7 +144,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理主机
|
||||
en-US: Proxy Host
|
||||
ja-JP: プロキシホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# required-true or false
|
||||
@@ -167,7 +155,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理端口
|
||||
en-US: Proxy Port
|
||||
ja-JP: プロキシポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -184,7 +171,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理用户名
|
||||
en-US: Proxy Username
|
||||
ja-JP: プロキシユーザー名
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
@@ -199,7 +185,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理密码
|
||||
en-US: Proxy Password
|
||||
ja-JP: プロキシパスワード
|
||||
# type-param field type(most mapping the html input tag)
|
||||
type: password
|
||||
# required-true or false
|
||||
@@ -212,7 +197,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理主机私钥
|
||||
en-US: proxyPrivateKey
|
||||
ja-JP: プロキシ秘密鍵
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: textarea
|
||||
placeholder: -----BEGIN RSA PRIVATE KEY-----
|
||||
@@ -227,7 +211,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 系统基本信息
|
||||
en-US: Basic Info
|
||||
ja-JP: システム基礎情報
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -240,19 +223,16 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 主机名称
|
||||
en-US: Host Name
|
||||
ja-JP: ホスト名
|
||||
- field: version
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 操作系统版本
|
||||
en-US: System Version
|
||||
ja-JP: システムバージョン
|
||||
- field: uptime
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 启动时间
|
||||
en-US: Uptime
|
||||
ja-JP: アップタイム
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: ssh
|
||||
# the config content when protocol is ssh
|
||||
@@ -292,7 +272,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: CPU 信息
|
||||
en-US: CPU Info
|
||||
ja-JP: CPU情報
|
||||
priority: 1
|
||||
fields:
|
||||
- field: info
|
||||
@@ -300,38 +279,32 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 型号
|
||||
en-US: Info
|
||||
ja-JP: バージョン
|
||||
- field: cores
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 核数
|
||||
en-US: Cores
|
||||
ja-JP: コア数
|
||||
- field: interrupt
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 中断数
|
||||
en-US: Interrupt
|
||||
ja-JP: 割り込み数
|
||||
- field: load
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 负载
|
||||
en-US: Load
|
||||
ja-JP: ロード
|
||||
- field: context_switch
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 上下文切换
|
||||
en-US: Context Switch
|
||||
ja-JP: コンテキストスイッチ
|
||||
- field: usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 使用率
|
||||
en-US: Usage
|
||||
ja-JP: 使用率
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- info
|
||||
@@ -378,7 +351,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 内存信息
|
||||
en-US: Memory Info
|
||||
ja-JP: メモリ情報
|
||||
priority: 2
|
||||
fields:
|
||||
- field: total
|
||||
@@ -387,42 +359,36 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 总内存容量
|
||||
en-US: Total Memory
|
||||
ja-JP: メモリ容量
|
||||
- field: used
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 用户程序内存量
|
||||
en-US: User Program Memory
|
||||
ja-JP: ユーザープログラムメモリ
|
||||
- field: free
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 空闲内存容量
|
||||
en-US: Free Memory
|
||||
ja-JP: 空きメモリ
|
||||
- field: buff_cache
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 缓存占用内存
|
||||
en-US: Buff Cache Memory
|
||||
ja-JP: バッファメモリ
|
||||
- field: available
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 剩余可用内存
|
||||
en-US: Available Memory
|
||||
ja-JP: 使用可能なメモリ
|
||||
- field: usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存使用率
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
aliasFields:
|
||||
- total
|
||||
- used
|
||||
@@ -465,7 +431,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 磁盘信息
|
||||
en-US: Disk Info
|
||||
ja-JP: ディスク情報
|
||||
priority: 3
|
||||
fields:
|
||||
- field: disk_num
|
||||
@@ -473,32 +438,27 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 磁盘总数
|
||||
en-US: Disk Num
|
||||
ja-JP: ディスク番号
|
||||
- field: partition_num
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 分区总数
|
||||
en-US: Partition Num
|
||||
ja-JP: パーティション
|
||||
- field: block_write
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 写磁盘块数
|
||||
en-US: Block Write
|
||||
ja-JP: 書き込みディスクブロック数
|
||||
- field: block_read
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 读磁盘块数
|
||||
en-US: Block Read
|
||||
ja-JP: 読み取りブロック数
|
||||
- field: write_rate
|
||||
type: 0
|
||||
unit: iops
|
||||
i18n:
|
||||
zh-CN: 磁盘写速率
|
||||
en-US: Write Rate
|
||||
ja-JP: ディスク書き込み速度
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
@@ -528,7 +488,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 网卡信息
|
||||
en-US: Interface Info
|
||||
ja-JP: ネットワークカード情報
|
||||
priority: 4
|
||||
fields:
|
||||
- field: interface_name
|
||||
@@ -537,21 +496,18 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 网卡名称
|
||||
en-US: Interface Name
|
||||
ja-JP: ネットワークカード名
|
||||
- field: receive_bytes
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 入站数据流量
|
||||
en-US: Receive Bytes
|
||||
ja-JP: 受信バイト数
|
||||
- field: transmit_bytes
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 出站数据流量
|
||||
en-US: Transmit Bytes
|
||||
ja-JP: 送信バイト数
|
||||
units:
|
||||
- receive_bytes=B->MB
|
||||
- transmit_bytes=B->MB
|
||||
@@ -584,7 +540,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 文件系统
|
||||
en-US: Disk Free
|
||||
ja-JP: ファイルシステム
|
||||
priority: 5
|
||||
fields:
|
||||
- field: filesystem
|
||||
@@ -592,35 +547,30 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 文件系统
|
||||
en-US: Filesystem
|
||||
ja-JP: ファイルシステム
|
||||
- field: used
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 已使用量
|
||||
en-US: Used
|
||||
ja-JP: 使用済み
|
||||
- field: available
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 可用量
|
||||
en-US: Available
|
||||
ja-JP: 使用可能
|
||||
- field: usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 使用率
|
||||
en-US: Usage
|
||||
ja-JP: 使用率
|
||||
- field: mounted
|
||||
type: 1
|
||||
label: true
|
||||
i18n:
|
||||
zh-CN: 挂载点
|
||||
en-US: Mounted
|
||||
ja-JP: マウント
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
@@ -650,7 +600,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Top10 CPU 进程
|
||||
en-US: Top10 CPU Process
|
||||
ja-JP: トップ10 CPUプロセス
|
||||
priority: 6
|
||||
fields:
|
||||
- field: pid
|
||||
@@ -659,27 +608,23 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 进程ID
|
||||
en-US: PID
|
||||
ja-JP: プロセスID
|
||||
- field: cpu_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: CPU占用率
|
||||
en-US: CPU Usage
|
||||
ja-JP: CPU使用率
|
||||
- field: mem_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存占用率
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
- field: command
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 执行命令
|
||||
en-US: Command
|
||||
ja-JP: 指令
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
@@ -709,7 +654,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Top10 内存进程
|
||||
en-US: Top10 Memory Process
|
||||
ja-JP: トップ10 メモリプロセス
|
||||
priority: 7
|
||||
fields:
|
||||
- field: pid
|
||||
@@ -718,27 +662,23 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 进程ID
|
||||
en-US: PID
|
||||
ja-JP: プロセスID
|
||||
- field: mem_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存占用率
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
- field: cpu_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: CPU占用率
|
||||
en-US: CPU Usage
|
||||
ja-JP: CPU使用率
|
||||
- field: command
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 执行命令
|
||||
en-US: Command
|
||||
ja-JP: 指令
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
|
||||
@@ -21,7 +21,6 @@ app: eureka_sd
|
||||
name:
|
||||
zh-CN: Eureka Service Discovery
|
||||
en-US: Eureka Service Discovery
|
||||
ja-JP: Eureka サービスディスカバリー
|
||||
# Input params define for app api(render web ui by the definition)
|
||||
params:
|
||||
# field-param field key
|
||||
@@ -30,7 +29,6 @@ params:
|
||||
name:
|
||||
zh-CN: Eureka服务发现地址
|
||||
en-US: Eureka Service Discovery Url
|
||||
ja-JP: Eureka サービスディスカバリーURL
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# required-true or false
|
||||
@@ -41,7 +39,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 监控目标
|
||||
en-US: Monitor Target
|
||||
ja-JP: 監視対象
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -53,13 +50,11 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Host
|
||||
en-US: Host
|
||||
ja-JP: ホスト
|
||||
- field: port
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Port
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: eureka_sd
|
||||
# the config content when protocol is http_sd
|
||||
|
||||
@@ -21,13 +21,11 @@ app: flink
|
||||
name:
|
||||
zh-CN: Apache Flink
|
||||
en-US: Apache Flink
|
||||
ja-JP: Apache Flink
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: Hertzbeat 对 Flink流引擎的通用指标进行测量监控。<br>您可以点击 “<i>新建 Flink流引擎</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: Hertzbeat monitoring Flink Stream through general performance metric. You could click the "<i>New Flink Stream</i>" button and proceed with the configuration or import an existing setup through the "<i>More Actions</i>" menu.
|
||||
zh-TW: Hertzbeat 對 Flink流引擎的通用名額進行量測監控。<br>您可以點擊“<i>新建Flink流引擎</i>”並進行配寘,或者選擇“<i>更多操作</i>”,導入已有配寘。
|
||||
ja-JP: HertzBeat は Flinkの一般的なメトリック監視します。<br>「<i>新規 Flink</i>」をクリックしてパラメタを設定した後、新規することができます。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/flink
|
||||
en-US: https://hertzbeat.apache.org/docs/help/flink
|
||||
@@ -39,7 +37,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -50,7 +47,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -65,7 +61,6 @@ params:
|
||||
name:
|
||||
zh-CN: 启动SSL
|
||||
en-US: SSL
|
||||
ja-JP: SSL利用
|
||||
# type-param field type(boolean mapping the html switch tag)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
@@ -75,7 +70,6 @@ params:
|
||||
name:
|
||||
zh-CN: 认证方式
|
||||
en-US: Auth Type
|
||||
ja-JP: 認証方法
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: radio
|
||||
required: false
|
||||
@@ -90,7 +84,6 @@ params:
|
||||
name:
|
||||
zh-CN: 用户名
|
||||
en-US: Username
|
||||
ja-JP: ユーザー名
|
||||
type: text
|
||||
limit: 50
|
||||
required: false
|
||||
@@ -99,7 +92,6 @@ params:
|
||||
name:
|
||||
zh-CN: 密码
|
||||
en-US: Password
|
||||
ja-JP: パスワード
|
||||
type: password
|
||||
required: false
|
||||
hide: true
|
||||
@@ -118,7 +110,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 版本
|
||||
en-US: Version
|
||||
ja-JP: バージョン
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: http
|
||||
# the config content when protocol is http
|
||||
@@ -152,31 +143,26 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 插槽总数
|
||||
en-US: Slots Total
|
||||
ja-JP: スロット数
|
||||
- field: slots_used # slots used count
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 已用插槽数
|
||||
en-US: Slots Used
|
||||
ja-JP: 使用済みスロット数
|
||||
- field: task_total # task count
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 任务总数
|
||||
en-US: Task Total
|
||||
ja-JP: タスク数
|
||||
- field: jobs_running # Number of running tasks
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 正在运行的任务数
|
||||
en-US: Jobs Running
|
||||
ja-JP: 実行中のタスク数
|
||||
- field: jobs_failed # Number of failed tasks
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 已经失败的任务数
|
||||
en-US: Jobs Failed
|
||||
ja-JP: 失敗したタスク数
|
||||
aliasFields:
|
||||
- slots-total
|
||||
- slots-available
|
||||
|
||||
@@ -21,13 +21,11 @@ app: flink_on_yarn
|
||||
name:
|
||||
zh-CN: Apache Flink On Yarn
|
||||
en-US: Apache Flink On Yarn
|
||||
ja-JP: Apache Flink On Yarn
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: Hertzbeat 对 Flink 流引擎 Yarn 模式的通用指标进行测量监控。<br>您可以点击 “<i>新建 Flink On Yarn</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: Hertzbeat monitoring Flink Stream through general performance metric. You could click the "<i>New Flink Stream</i>" button and proceed with the configuration or import an existing setup through the "<i>More Actions</i>" menu.
|
||||
zh-TW: Hertzbeat 對 Flink 流引擎 Yarn 模式的通用指標進行測量監控。<br>您可以點擊 “<i>新建 Flink On Yarn</i>” 並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
|
||||
ja-JP: HertzBeat は Flink 「Yarn モード」の一般的なメトリック監視します。<br>「<i>新規 Flink</i>」をクリックしてパラメタを設定した後、新規することができます。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/flink_on_yarn
|
||||
en-US: https://hertzbeat.apache.org/docs/help/flink_on_yarn
|
||||
@@ -39,7 +37,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -50,7 +47,6 @@ params:
|
||||
name:
|
||||
zh-CN: Yarn端口
|
||||
en-US: Yarn Port
|
||||
ja-JP: Yarnポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -65,7 +61,6 @@ params:
|
||||
name:
|
||||
zh-CN: 应用ID
|
||||
en-US: Application ID
|
||||
ja-JP: 応用ID
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# required-true or false
|
||||
@@ -76,7 +71,6 @@ params:
|
||||
name:
|
||||
zh-CN: 启动SSL
|
||||
en-US: SSL
|
||||
ja-JP: SSL利用
|
||||
# type-param field type(boolean mapping the html switch tag)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
@@ -86,7 +80,6 @@ params:
|
||||
name:
|
||||
zh-CN: 认证方式
|
||||
en-US: Auth Type
|
||||
ja-JP: 認証方法
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: radio
|
||||
required: false
|
||||
@@ -101,7 +94,6 @@ params:
|
||||
name:
|
||||
zh-CN: 用户名
|
||||
en-US: Username
|
||||
ja-JP: ユーザー名
|
||||
type: text
|
||||
limit: 50
|
||||
required: false
|
||||
@@ -110,7 +102,6 @@ params:
|
||||
name:
|
||||
zh-CN: 密码
|
||||
en-US: Password
|
||||
ja-JP: パスワード
|
||||
type: password
|
||||
required: false
|
||||
hide: true
|
||||
@@ -120,7 +111,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: JobManager Metrics
|
||||
en-US: JobManager Metrics
|
||||
ja-JP: JobManagerメトリック
|
||||
priority: 0
|
||||
fields:
|
||||
- field: id
|
||||
@@ -129,13 +119,11 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 监控项
|
||||
en-US: key
|
||||
ja-JP: キー
|
||||
- field: value
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 值
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
protocol: http
|
||||
http:
|
||||
host: ^_^host^_^
|
||||
@@ -155,7 +143,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: JobManager Config
|
||||
en-US: JobManager Config
|
||||
ja-JP: JobManager設定
|
||||
priority: 1
|
||||
fields:
|
||||
- field: key
|
||||
@@ -163,13 +150,11 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 监控项
|
||||
en-US: key
|
||||
ja-JP: キー
|
||||
- field: value
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 值
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
protocol: http
|
||||
http:
|
||||
host: ^_^host^_^
|
||||
@@ -190,7 +175,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: TaskManager
|
||||
en-US: TaskManager
|
||||
ja-JP: TaskManager
|
||||
priority: 2
|
||||
fields:
|
||||
- field: id
|
||||
@@ -199,198 +183,168 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Container ID
|
||||
en-US: Container ID
|
||||
ja-JP: コンテナID
|
||||
- field: path
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Path
|
||||
en-US: Path
|
||||
ja-JP: パス
|
||||
- field: dataPort
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Data Port
|
||||
en-US: Data Port
|
||||
ja-JP: データポート
|
||||
- field: jmxPort
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: JMX Port
|
||||
en-US: JMX Port
|
||||
ja-JP: JMXポート
|
||||
- field: timeSinceLastHeartbeat
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Last Heartbeat
|
||||
en-US: Last Heartbeat
|
||||
ja-JP: 最後のハートビート
|
||||
- field: slotsNumber
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: All Slots
|
||||
en-US: All Slots
|
||||
ja-JP: スロット
|
||||
- field: freeSlots
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Free Slots
|
||||
en-US: Free Slots
|
||||
ja-JP: 利用可能なスロット
|
||||
- field: totalResourceCpuCores
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: totalResourceCpuCores
|
||||
en-US: totalResourceCpuCores
|
||||
ja-JP: totalResourceCpuCores
|
||||
- field: totalResourceTaskHeapMemory
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: totalResourceTaskHeapMemory
|
||||
en-US: totalResourceTaskHeapMemory
|
||||
ja-JP: totalResourceTaskHeapMemory
|
||||
unit: MB
|
||||
- field: totalResourceManagedMemory
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: totalResourceManagedMemory
|
||||
en-US: totalResourceManagedMemory
|
||||
ja-JP: totalResourceManagedMemory
|
||||
unit: MB
|
||||
- field: totalResourceNetworkMemory
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: totalResourceNetworkMemory
|
||||
en-US: totalResourceNetworkMemory
|
||||
ja-JP: totalResourceNetworkMemory
|
||||
unit: MB
|
||||
- field: freeResourceCpuCores
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: freeResourceCpuCores
|
||||
en-US: freeResourceCpuCores
|
||||
ja-JP: freeResourceCpuCores
|
||||
- field: freeResourceTaskHeapMemory
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: freeResourceTaskHeapMemory
|
||||
en-US: freeResourceTaskHeapMemory
|
||||
ja-JP: freeResourceTaskHeapMemory
|
||||
unit: MB
|
||||
- field: freeResourceTaskOffHeapMemory
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: freeResourceTaskOffHeapMemory
|
||||
en-US: freeResourceTaskOffHeapMemory
|
||||
ja-JP: freeResourceTaskOffHeapMemory
|
||||
unit: MB
|
||||
- field: freeResourceManagedMemory
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: freeResourceManagedMemory
|
||||
en-US: freeResourceManagedMemory
|
||||
ja-JP: freeResourceManagedMemory
|
||||
unit: MB
|
||||
- field: freeResourceNetworkMemory
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: freeResourceNetworkMemory
|
||||
en-US: freeResourceNetworkMemory
|
||||
ja-JP: freeResourceNetworkMemory
|
||||
unit: MB
|
||||
- field: hardwareCpuCores
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: CPU Cores
|
||||
en-US: CPU Cores
|
||||
ja-JP: Cpuコア数
|
||||
- field: hardwarePhysicalMemory
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Physical MEM
|
||||
en-US: Physical MEM
|
||||
ja-JP: 物理メモリ
|
||||
unit: GB
|
||||
- field: hardwareFreeMemory
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM Heap Size
|
||||
en-US: JVM Heap Size
|
||||
ja-JP: Java仮想マシンのヒープサイズ
|
||||
unit: MB
|
||||
- field: hardwareManagedMemory
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Flink Managed MEM
|
||||
en-US: Flink Managed MEM
|
||||
ja-JP: Flink管理メモリ
|
||||
unit: MB
|
||||
- field: memoryConfigurationFrameworkHeap
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Framework Heap
|
||||
en-US: Framework Heap
|
||||
ja-JP: フレームワークのヒープ
|
||||
unit: MB
|
||||
- field: memoryConfigurationTaskHeap
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Task Heap
|
||||
en-US: Task Heap
|
||||
ja-JP: タスクヒープ
|
||||
unit: MB
|
||||
- field: memoryConfigurationFrameworkOffHeap
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Framework Off-Heap
|
||||
en-US: Framework Off-Heap
|
||||
ja-JP: フレームワークのオフヒープ
|
||||
unit: MB
|
||||
- field: memoryConfigurationTaskOffHeap
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Task Off-Heap
|
||||
en-US: Task Off-Heap
|
||||
ja-JP: タスクオフヒープ
|
||||
unit: MB
|
||||
- field: memoryConfigurationNetworkMemory
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Network
|
||||
en-US: Network
|
||||
ja-JP: ネットワーク
|
||||
unit: MB
|
||||
- field: memoryConfigurationManagedMemory
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Managed Memory
|
||||
en-US: Managed Memory
|
||||
ja-JP: 管理メモリ
|
||||
unit: MB
|
||||
- field: memoryConfigurationJvmMetaspace
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM Metaspace
|
||||
en-US: JVM Metaspace
|
||||
ja-JP: Java仮想マシンのメタスペース
|
||||
unit: MB
|
||||
- field: memoryConfigurationJvmOverhead
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM Overhead
|
||||
en-US: JVM Overhead
|
||||
ja-JP: Java仮想マシンのオーバーヘッド
|
||||
- field: memoryConfigurationTotalFlinkMemory
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: memoryConfigurationTotalFlinkMemory
|
||||
en-US: memoryConfigurationTotalFlinkMemory
|
||||
ja-JP: memoryConfigurationTotalFlinkMemory
|
||||
- field: memoryConfigurationTotalProcessMemory
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: memoryConfigurationTotalProcessMemory
|
||||
en-US: memoryConfigurationTotalProcessMemory
|
||||
ja-JP: memoryConfigurationTotalProcessMemory
|
||||
aliasFields:
|
||||
- $.id
|
||||
- $.path
|
||||
@@ -485,14 +439,12 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: TaskManager Metrics
|
||||
en-US: TaskManager Metrics
|
||||
ja-JP: TaskManagerメトリック
|
||||
priority: 3
|
||||
fields:
|
||||
- field: container_id
|
||||
i18n:
|
||||
zh-CN: Container ID
|
||||
en-US: Container ID
|
||||
ja-JP: コンテナID
|
||||
type: 1
|
||||
label: true
|
||||
- field: id
|
||||
@@ -500,14 +452,12 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 监控项
|
||||
en-US: key
|
||||
ja-JP: キー
|
||||
label: true
|
||||
- field: value
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 值
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
unit: MB
|
||||
units:
|
||||
- value=B->MB
|
||||
|
||||
@@ -21,13 +21,11 @@ app: freebsd
|
||||
name:
|
||||
zh-CN: FreeBSD操作系统
|
||||
en-US: OS FreeBSD
|
||||
ja-JP: OS FreeBSD
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: Hertzbeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH 协议</a> 对 FreeBSD 操作系统的通用性能指标 (系统信息、CPU、内存、磁盘、网卡、文件系统、TOP资源进程等) 进行采集监控。<br>您可以点击“<i>新建 FreeBSD</i>”并配置HOST端口账户等相关参数进行添加,支持SSH账户密码或密钥认证。或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: HertzBeat uses <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH protocol</a> to monitors FreeBSD operating system's general performance metrics such as cpu, memory, disk, basic, interface, disk_free, top_process etc. <br>You can click the "<i>New FreeBSD</i>" and config host port and other related params to add, auth support password or secretKey. Or import an existing setup through the "<i>More Actions</i>" menu.
|
||||
zh-TW: Hertzbeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH 协议</a> 對 FreeBSD 操作系统的通用性能指標 (系統信息、CPU、內存、磁盤、網卡、文件系統、TOP資源進程等) 進行採集監控。<br>您可以點擊“<i>新建 FreeBSD</i>”並配置HOST端口賬戶等相關參數進行添加,支持SSH賬戶密碼或密鑰認證。或者選擇“<i>更多操作</i>”,導入已有配寘。
|
||||
ja-JP: Hertzbeat は <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSHプロトコルを介して</a> Centosシステムの一般的なパフォーマンスのメトリック監視します。<br>「<i>新規 FreeBSD</i>」をクリックしてホストなどのパラメタを設定した後、新規することができます。SSHまたはキー認証をサポートします。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn//docs/help/freebsd
|
||||
en-US: https://hertzbeat.apache.org/docs/help/freebsd
|
||||
@@ -39,7 +37,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -50,7 +47,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -65,7 +61,6 @@ params:
|
||||
name:
|
||||
zh-CN: 超时时间(ms)
|
||||
en-US: Timeout(ms)
|
||||
ja-JP: タイムアウト(ms)
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -80,7 +75,6 @@ params:
|
||||
name:
|
||||
zh-CN: 复用连接
|
||||
en-US: Reuse Connection
|
||||
ja-JP: コネクション再利用
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
@@ -92,7 +86,6 @@ params:
|
||||
name:
|
||||
zh-CN: 使用代理
|
||||
en-US: Use Proxy Connection
|
||||
ja-JP: プロキシコネクション利用
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
@@ -104,7 +97,6 @@ params:
|
||||
name:
|
||||
zh-CN: 用户名
|
||||
en-US: Username
|
||||
ja-JP: ユーザー名
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
@@ -117,7 +109,6 @@ params:
|
||||
name:
|
||||
zh-CN: 密码
|
||||
en-US: Password
|
||||
ja-JP: パスワード
|
||||
# type-param field type(most mapping the html input tag)
|
||||
type: password
|
||||
# required-true or false
|
||||
@@ -128,7 +119,6 @@ params:
|
||||
name:
|
||||
zh-CN: 私钥
|
||||
en-US: PrivateKey
|
||||
ja-JP: 秘密鍵
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: textarea
|
||||
placeholder: -----BEGIN RSA PRIVATE KEY-----
|
||||
@@ -142,7 +132,6 @@ params:
|
||||
name:
|
||||
zh-CN: 密钥短语
|
||||
en-US: PrivateKey PassPhrase
|
||||
ja-JP: 秘密鍵フレーズ
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: password
|
||||
# required-true or false
|
||||
@@ -155,7 +144,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理主机
|
||||
en-US: Proxy Host
|
||||
ja-JP: プロキシホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# required-true or false
|
||||
@@ -167,7 +155,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理端口
|
||||
en-US: Proxy Port
|
||||
ja-JP: プロキシポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -184,7 +171,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理用户名
|
||||
en-US: Proxy Username
|
||||
ja-JP: プロキシユーザー名
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
@@ -199,7 +185,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理密码
|
||||
en-US: Proxy Password
|
||||
ja-JP: プロキシパスワード
|
||||
# type-param field type(most mapping the html input tag)
|
||||
type: password
|
||||
# required-true or false
|
||||
@@ -212,7 +197,6 @@ params:
|
||||
name:
|
||||
zh-CN: 代理主机私钥
|
||||
en-US: proxyPrivateKey
|
||||
ja-JP: プロキシ秘密鍵
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: textarea
|
||||
placeholder: -----BEGIN RSA PRIVATE KEY-----
|
||||
@@ -227,7 +211,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 系统基本信息
|
||||
en-US: Basic Info
|
||||
ja-JP: システム基礎情報
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -240,19 +223,16 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 主机名称
|
||||
en-US: Host Name
|
||||
ja-JP: ホスト名
|
||||
- field: version
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 操作系统版本
|
||||
en-US: System Version
|
||||
ja-JP: システムバージョン
|
||||
- field: uptime
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 启动时间
|
||||
en-US: Uptime
|
||||
ja-JP: アップタイム
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: ssh
|
||||
# the config content when protocol is ssh
|
||||
@@ -292,7 +272,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: CPU 信息
|
||||
en-US: CPU Info
|
||||
ja-JP: CPU情報
|
||||
priority: 1
|
||||
fields:
|
||||
- field: info
|
||||
@@ -300,38 +279,32 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 型号
|
||||
en-US: Info
|
||||
ja-JP: バージョン
|
||||
- field: cores
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 核数
|
||||
en-US: Cores
|
||||
ja-JP: コア数
|
||||
- field: interrupt
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 中断数
|
||||
en-US: Interrupt
|
||||
ja-JP: 割り込み数
|
||||
- field: load
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 负载
|
||||
en-US: Load
|
||||
ja-JP: ロード
|
||||
- field: context_switch
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 上下文切换
|
||||
en-US: Context Switch
|
||||
ja-JP: コンテキストスイッチ
|
||||
- field: usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 使用率
|
||||
en-US: Usage
|
||||
ja-JP: 使用率
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
# (可选)监控指标别名, 做为中间字段与采集数据字段和指标字段映射转换
|
||||
aliasFields:
|
||||
@@ -379,7 +352,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 内存信息
|
||||
en-US: Memory Info
|
||||
ja-JP: メモリ情報
|
||||
priority: 2
|
||||
fields:
|
||||
- field: physmem
|
||||
@@ -388,35 +360,30 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 物理内存
|
||||
en-US: Physics Memory
|
||||
ja-JP: 物理メモリ
|
||||
- field: usermem
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 用户内存
|
||||
en-US: User Program Memory
|
||||
ja-JP: ユーザープログラムメモリ
|
||||
- field: realmem
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 实际内存
|
||||
en-US: Real Memory
|
||||
ja-JP: 実際のメモリ
|
||||
- field: availmem
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 可用内存
|
||||
en-US: Available Memory
|
||||
ja-JP: 使用可能なメモリ
|
||||
- field: usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存使用率
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
aliasFields:
|
||||
- physmem
|
||||
- usermem
|
||||
@@ -462,7 +429,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 文件系统
|
||||
en-US: Disk Free
|
||||
ja-JP: ディスク情報
|
||||
priority: 3
|
||||
fields:
|
||||
- field: filesystem
|
||||
@@ -470,35 +436,30 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 文件系统
|
||||
en-US: Filesystem
|
||||
ja-JP: ファイルシステム
|
||||
- field: used
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 已使用量
|
||||
en-US: Used
|
||||
ja-JP: 使用済み
|
||||
- field: available
|
||||
type: 0
|
||||
unit: Mb
|
||||
i18n:
|
||||
zh-CN: 可用量
|
||||
en-US: Available
|
||||
ja-JP: 利用可能
|
||||
- field: usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 使用率
|
||||
en-US: Usage
|
||||
ja-JP: 使用率
|
||||
- field: mounted
|
||||
type: 1
|
||||
label: true
|
||||
i18n:
|
||||
zh-CN: 挂载点
|
||||
en-US: Mounted
|
||||
ja-JP: マウント
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
@@ -528,7 +489,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Top10 CPU 进程
|
||||
en-US: Top10 CPU Process
|
||||
ja-JP: トップ10 CPUプロセス
|
||||
priority: 4
|
||||
fields:
|
||||
- field: pid
|
||||
@@ -537,27 +497,23 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 进程ID
|
||||
en-US: PID
|
||||
ja-JP: プロセスID
|
||||
- field: cpu_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: CPU占用率
|
||||
en-US: CPU Usage
|
||||
ja-JP: CPU使用率
|
||||
- field: mem_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存占用率
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
- field: command
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 执行命令
|
||||
en-US: Command
|
||||
ja-JP: 指令
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
@@ -587,7 +543,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Top10 内存进程
|
||||
en-US: Top10 Memory Process
|
||||
ja-JP: トップ10 メモリプロセス
|
||||
priority: 5
|
||||
fields:
|
||||
- field: pid
|
||||
@@ -596,27 +551,23 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 进程ID
|
||||
en-US: PID
|
||||
ja-JP: プロセスID
|
||||
- field: mem_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存占用率
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
- field: cpu_usage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: CPU占用率
|
||||
en-US: CPU Usage
|
||||
ja-JP: CPU使用率
|
||||
- field: command
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 执行命令
|
||||
en-US: Command
|
||||
ja-JP: 指令
|
||||
protocol: ssh
|
||||
ssh:
|
||||
host: ^_^host^_^
|
||||
|
||||
@@ -21,13 +21,11 @@ app: ftp
|
||||
name:
|
||||
zh-CN: FTP服务器
|
||||
en-US: FTP Server
|
||||
ja-JP: FTPサーバー
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: Hertzbeat 对 FTP 服务器的通用指标进行测量监控。<br>您可以点击 “<i>新建 FTP服务器</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: Hertzbeat monitoring FTP server through general performance metric. You could click the "<i>New FTP server</i>" button and proceed with the configuration or import an existing setup through the "<i>More Actions</i>" menu.
|
||||
zh-TW: Hertzbeat 對 FTP 伺服器的通用名額進行量測監控。<br>您可以點擊“<i>新建FTP伺服器</i>”並進行配寘,或者選擇“<i>更多操作</i>”,導入已有配寘。
|
||||
ja-JP: Hertzbeat は FTPサーバーの一般的なメトリック監視します。<br>「<i>新規 FTPサーバー</i>」をクリックしてパラメタを設定した後、新規することができます。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/ftp
|
||||
en-US: https://hertzbeat.apache.org/docs/help/ftp
|
||||
@@ -39,7 +37,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -50,7 +47,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -65,7 +61,6 @@ params:
|
||||
name:
|
||||
zh-CN: 用户名
|
||||
en-US: Username
|
||||
ja-JP: ユーザー名
|
||||
type: text
|
||||
limit: 50
|
||||
required: false
|
||||
@@ -74,7 +69,6 @@ params:
|
||||
name:
|
||||
zh-CN: 用户密码
|
||||
en-US: Password
|
||||
ja-JP: パスワード
|
||||
# type-param field type(most mapping the html input tag)
|
||||
type: password
|
||||
required: false
|
||||
@@ -83,7 +77,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目录
|
||||
en-US: Direction
|
||||
ja-JP: ディレクション
|
||||
type: text
|
||||
limit: 100
|
||||
required: true
|
||||
@@ -91,7 +84,6 @@ params:
|
||||
name:
|
||||
zh-CN: 超时时间
|
||||
en-US: Timeout
|
||||
ja-JP: タイムアウト
|
||||
type: number
|
||||
range: '[0,100000]'
|
||||
required: true
|
||||
@@ -101,7 +93,6 @@ params:
|
||||
name:
|
||||
zh-CN: 启用SFTP
|
||||
en-US: SFTP
|
||||
ja-JP: SFTP利用
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
@@ -113,7 +104,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 概要
|
||||
en-US: Basic
|
||||
ja-JP: 基礎情報
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -125,14 +115,12 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 活动状态
|
||||
en-US: Is Active
|
||||
ja-JP: 活動ステータス
|
||||
- field: responseTime
|
||||
type: 0
|
||||
unit: ms
|
||||
i18n:
|
||||
zh-CN: 响应时间
|
||||
en-US: Response Time
|
||||
ja-JP: 応答時間
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: ftp
|
||||
# the config content when protocol is ftp
|
||||
|
||||
@@ -21,13 +21,11 @@ app: fullsite
|
||||
name:
|
||||
zh-CN: SiteMap全站
|
||||
en-US: SITE MAP
|
||||
ja-JP: SITE MAP
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: HertzBeat 对网站全部页面的 URL 路径、HTTP 状态码、响应时间及请求反馈进行监测。由于一个网站可能有多个不同服务提供的页面,系统将采集网站暴露的<a class='help_module_content' href='https://en.wikipedia.org/wiki/Site_map'>网站地图(SiteMap)</a>来监控全站。<span class='help_module_span'><br>⚠️注意:此功能需要您的网站支持 XML 和 TXT 格式的 SiteMap。</span>
|
||||
en-US: HertzBeat monitoring all pages of website by URL path, HTTP status code, response times and request feedback. Due to the possibility that a website may have multiple pages provided by different services, Hertzbeat will collect <a class='help_module_content' href='https://en.wikipedia.org/wiki/Site_map'>SiteMap</a> which exposed by the website to monitor the entire site. <span class='help_module_span'><br>⚠️Note:HertzBeat support SiteMap in XML or TXT format.</span>
|
||||
zh-TW: HertzBeat對網站全部頁面的URL路徑、HTTP狀態碼、回應時間及請求迴響進行監測。 由於一個網站可能有多個不同服務提供的頁面,系統將採集網站暴露的<a class='help_ module_ content' href='https://en.wikipedia.org/wiki/Site_map'>網站地圖(SiteMap)</a>來監控全站。<span class='help_ module_ span'> <br>⚠️注意:此功能需要您的網站支持XML和TXT格式的SiteMap。</span>
|
||||
ja-JP: HertzBeat はウェブサイトの全てのURL、HTTPステータスコード、応答時間などのメトリック監視します。ウェブサイトには、異なるサービスによって提供される複数のページが存在する可能性があるため、システムはウェブサイトによって公開される<a class='help_ module_ content' href='https://en.wikipedia.org/wiki/Site_map'>SiteMap</a>を収集して監視します。<span class='help_ module_ span'> <br>⚠️注意:この機能を使用するには、ウェブサイトがXMLおよびTXT形式のSiteMapをサポートしている必要があります。</span>
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/guide/
|
||||
en-US: https://hertzbeat.apache.org/docs/help/guide/
|
||||
@@ -39,7 +37,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -50,7 +47,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -62,7 +58,6 @@ params:
|
||||
name:
|
||||
zh-CN: 网站地图
|
||||
en-US: Site Map
|
||||
ja-JP: Site Map
|
||||
type: text
|
||||
limit: 200
|
||||
required: true
|
||||
@@ -71,7 +66,6 @@ params:
|
||||
name:
|
||||
zh-CN: 启用HTTPS
|
||||
en-US: HTTPS
|
||||
ja-JP: HTTPS利用
|
||||
# type-param field type(boolean mapping the html switch tag)
|
||||
type: boolean
|
||||
required: true
|
||||
@@ -83,7 +77,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 概要信息
|
||||
en-US: Summary
|
||||
ja-JP: 概要
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -96,26 +89,22 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: URL
|
||||
en-US: URL
|
||||
ja-JP: URL
|
||||
- field: statusCode
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 响应状态码
|
||||
en-US: Status Code
|
||||
ja-JP: ステータスコード
|
||||
- field: responseTime
|
||||
type: 0
|
||||
unit: ms
|
||||
i18n:
|
||||
zh-CN: 响应时间
|
||||
en-US: Response Time
|
||||
ja-JP: 応答時間
|
||||
- field: errorMsg
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 错误信息
|
||||
en-US: Error Msg
|
||||
ja-JP: エラーメッセージ
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: http
|
||||
# the config content when protocol is http
|
||||
|
||||
@@ -21,13 +21,11 @@ app: greenplum
|
||||
name:
|
||||
zh-CN: GreenPlum 数据库
|
||||
en-US: GreenPlum DB
|
||||
ja-JP: GreenPlum データベース
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: HertzBeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC 协议</a> 通过配置 SQL 对 GreenPlum 数据库的通用性能指标 (basic、state、activity etc) 进行采集监控,支持版本为 GreenPlum 6.23.0+。<br>您可以点击“<i>新建 GreenPlum 数据库</i>”并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: HertzBeat uses <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC Protocol</a> to configure SQL for collecting general metrics of GreenPlum database (basic、state、activity etc). Supported version is GreenPlum 6.23.0+. <br>You can click "<i>New GreenPlum Database</i>" and configure it, or select "<i>More Action</i>" to import the existing configuration.
|
||||
zh-TW: HertzBeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC 協議</a> 通過配置 SQL 對 GreenPlum 數據庫的通用性能指標 (basic、state、activity etc)進行采集監控,支持版本爲 GreenPlum 6.23.0+。<br>您可以點擊“<i>新建 GreenPlum 數據庫</i>”並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
|
||||
ja-JP: Hertzbeat は <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBCプロトコルを介して</a> GreenPlum データベース(6.23.0+)の一般的なパフォーマンスのメトリック監視します。<br>「<i>新規 GreenPlum データベース</i>」をクリックしてパラメタを設定した後、新規することができます。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/greenplum
|
||||
en-US: https://hertzbeat.apache.org/docs/help/greenplum
|
||||
@@ -39,7 +37,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -50,7 +47,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -63,7 +59,6 @@ params:
|
||||
name:
|
||||
zh-CN: 查询超时时间(ms)
|
||||
en-US: Query Timeout(ms)
|
||||
ja-JP: クエリタイムアウト(ms)
|
||||
type: number
|
||||
range: '[400,200000]'
|
||||
required: false
|
||||
@@ -73,7 +68,6 @@ params:
|
||||
name:
|
||||
zh-CN: 数据库名称
|
||||
en-US: Database Name
|
||||
ja-JP: データベース名
|
||||
type: text
|
||||
defaultValue: postgres
|
||||
required: false
|
||||
@@ -81,7 +75,6 @@ params:
|
||||
name:
|
||||
zh-CN: 用户名
|
||||
en-US: Username
|
||||
ja-JP: ユーザー名
|
||||
type: text
|
||||
limit: 50
|
||||
required: false
|
||||
@@ -89,14 +82,12 @@ params:
|
||||
name:
|
||||
zh-CN: 密码
|
||||
en-US: Password
|
||||
ja-JP: パスワード
|
||||
type: password
|
||||
required: false
|
||||
- field: url
|
||||
name:
|
||||
zh-CN: URL
|
||||
en-US: URL
|
||||
ja-JP: URL
|
||||
type: text
|
||||
required: false
|
||||
hide: true
|
||||
@@ -108,7 +99,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 基本信息
|
||||
en-US: Basic Info
|
||||
ja-JP: 基礎情報
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -121,31 +111,26 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 服务器版本
|
||||
en-US: Server Version
|
||||
ja-JP: サーバーのバージョン
|
||||
- field: port
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
- field: server_encoding
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 服务器编码
|
||||
en-US: Server Encoding
|
||||
ja-JP: サーバーのエンコード
|
||||
- field: data_directory
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 数据目录
|
||||
en-US: Data Directory
|
||||
ja-JP: データディレクトリ
|
||||
- field: max_connections
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大连接数
|
||||
en-US: Max Connections
|
||||
ja-JP: 最大コネクション数
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: jdbc
|
||||
# the config content when protocol is jdbc
|
||||
@@ -170,7 +155,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 状态信息
|
||||
en-US: State Info
|
||||
ja-JP: 状態情報
|
||||
priority: 1
|
||||
fields:
|
||||
- field: db_name
|
||||
@@ -179,55 +163,47 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 数据库名称
|
||||
en-US: Database Name
|
||||
ja-JP: データベース名
|
||||
- field: conflicts
|
||||
type: 0
|
||||
unit: times
|
||||
i18n:
|
||||
zh-CN: 冲突次数
|
||||
en-US: Conflicts
|
||||
ja-JP: コンフリクト回数
|
||||
- field: deadlocks
|
||||
type: 0
|
||||
unit: times
|
||||
i18n:
|
||||
zh-CN: 死锁次数
|
||||
en-US: Deadlocks
|
||||
ja-JP: デッドロック回数
|
||||
- field: blks_read
|
||||
type: 0
|
||||
unit: blocks per second
|
||||
i18n:
|
||||
zh-CN: 读取块
|
||||
en-US: Blocks Read
|
||||
ja-JP: 読み取られたブロック
|
||||
- field: blks_hit
|
||||
type: 0
|
||||
unit: blocks per second
|
||||
i18n:
|
||||
zh-CN: 命中块
|
||||
en-US: Blocks Hit
|
||||
ja-JP: ヒットブロック
|
||||
- field: blk_read_time
|
||||
type: 0
|
||||
unit: ms
|
||||
i18n:
|
||||
zh-CN: 读取时间
|
||||
en-US: Read Time
|
||||
ja-JP: 読み取られタイム
|
||||
- field: blk_write_time
|
||||
type: 0
|
||||
unit: ms
|
||||
i18n:
|
||||
zh-CN: 写入时间
|
||||
en-US: Write Time
|
||||
ja-JP: 書き込まれタイム
|
||||
- field: stats_reset
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 统计重置
|
||||
en-US: Stats Reset
|
||||
ja-JP: 統計リセット
|
||||
protocol: jdbc
|
||||
jdbc:
|
||||
host: ^_^host^_^
|
||||
@@ -245,7 +221,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 活动信息
|
||||
en-US: Activity Info
|
||||
ja-JP: 活動情報
|
||||
priority: 2
|
||||
fields:
|
||||
- field: running
|
||||
@@ -254,7 +229,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 运行中
|
||||
en-US: Running
|
||||
ja-JP: 実行中
|
||||
protocol: jdbc
|
||||
jdbc:
|
||||
host: ^_^host^_^
|
||||
@@ -272,7 +246,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 资源配置
|
||||
en-US: Resource Config
|
||||
ja-JP: リソース設定
|
||||
priority: 3
|
||||
fields:
|
||||
- field: work_mem
|
||||
@@ -281,40 +254,34 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 工作内存
|
||||
en-US: Work Memory
|
||||
ja-JP: ワークメモリ
|
||||
- field: shared_buffers
|
||||
type: 0
|
||||
unit: MB
|
||||
i18n:
|
||||
zh-CN: 共享缓冲区
|
||||
en-US: Shared Buffers
|
||||
ja-JP: 共有バッファ
|
||||
- field: autovacuum
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 自动清理
|
||||
en-US: Auto Vacuum
|
||||
ja-JP: オートバキューム
|
||||
- field: max_connections
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大连接数
|
||||
en-US: Max Connections
|
||||
ja-JP: 最大コネクション数
|
||||
- field: effective_cache_size
|
||||
type: 0
|
||||
unit: MB
|
||||
i18n:
|
||||
zh-CN: 有效缓存大小
|
||||
en-US: Effective Cache Size
|
||||
ja-JP: キャッシュサイズ
|
||||
- field: wal_buffers
|
||||
type: 0
|
||||
unit: MB
|
||||
i18n:
|
||||
zh-CN: WAL缓冲区
|
||||
en-US: WAL Buffers
|
||||
ja-JP: WALバッファ
|
||||
protocol: jdbc
|
||||
jdbc:
|
||||
host: ^_^host^_^
|
||||
@@ -332,7 +299,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 连接信息
|
||||
en-US: Connection Info
|
||||
ja-JP: コネクション情報
|
||||
priority: 4
|
||||
fields:
|
||||
- field: active
|
||||
@@ -340,7 +306,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 活动连接
|
||||
en-US: Active Connection
|
||||
ja-JP: 活躍的なコネクション
|
||||
protocol: jdbc
|
||||
jdbc:
|
||||
host: ^_^host^_^
|
||||
@@ -358,7 +323,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 连接状态
|
||||
en-US: Connection State
|
||||
ja-JP: コネクションステート
|
||||
priority: 5
|
||||
fields:
|
||||
- field: state
|
||||
@@ -367,13 +331,11 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 状态
|
||||
en-US: State
|
||||
ja-JP: 状態
|
||||
- field: num
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 数量
|
||||
en-US: Num
|
||||
ja-JP: 数量
|
||||
protocol: jdbc
|
||||
jdbc:
|
||||
host: ^_^host^_^
|
||||
@@ -391,7 +353,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 连接数据库
|
||||
en-US: Connection Db
|
||||
ja-JP: コネクションデータベース
|
||||
priority: 6
|
||||
fields:
|
||||
- field: db_name
|
||||
@@ -400,13 +361,11 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 数据库名称
|
||||
en-US: Database Name
|
||||
ja-JP: データベース名
|
||||
- field: active
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 活动连接
|
||||
en-US: Active Connection
|
||||
ja-JP: 活躍的なコネクション
|
||||
protocol: jdbc
|
||||
jdbc:
|
||||
host: ^_^host^_^
|
||||
@@ -424,7 +383,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 元组信息
|
||||
en-US: Tuple Info
|
||||
ja-JP: 組情報
|
||||
priority: 7
|
||||
fields:
|
||||
- field: fetched
|
||||
@@ -432,31 +390,26 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 获取次数
|
||||
en-US: Fetched
|
||||
ja-JP: フェッチ回数
|
||||
- field: returned
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 返回次数
|
||||
en-US: Returned
|
||||
ja-JP: 戻る回数
|
||||
- field: inserted
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 插入次数
|
||||
en-US: Inserted
|
||||
ja-JP: インサート回数
|
||||
- field: updated
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 更新次数
|
||||
en-US: Updated
|
||||
ja-JP: 更新回数
|
||||
- field: deleted
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 删除次数
|
||||
en-US: Deleted
|
||||
ja-JP: 削除回数
|
||||
protocol: jdbc
|
||||
jdbc:
|
||||
host: ^_^host^_^
|
||||
@@ -474,7 +427,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 临时文件
|
||||
en-US: Temp File
|
||||
ja-JP: 一時ファイル
|
||||
priority: 8
|
||||
fields:
|
||||
- field: db_name
|
||||
@@ -483,20 +435,17 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 数据库名称
|
||||
en-US: Database Name
|
||||
ja-JP: データベース名
|
||||
- field: num
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 次数
|
||||
en-US: Num
|
||||
ja-JP: 数量
|
||||
- field: size
|
||||
type: 0
|
||||
unit: B
|
||||
i18n:
|
||||
zh-CN: 大小
|
||||
en-US: Size
|
||||
ja-JP: サイズ
|
||||
protocol: jdbc
|
||||
jdbc:
|
||||
host: ^_^host^_^
|
||||
@@ -514,7 +463,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 锁信息
|
||||
en-US: Lock Info
|
||||
ja-JP: ロック情報
|
||||
priority: 9
|
||||
fields:
|
||||
- field: db_name
|
||||
@@ -523,21 +471,18 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 数据库名称
|
||||
en-US: Database Name
|
||||
ja-JP: データベース名
|
||||
- field: conflicts
|
||||
type: 0
|
||||
unit: times
|
||||
i18n:
|
||||
zh-CN: 冲突次数
|
||||
en-US: Conflicts
|
||||
ja-JP: コンフリクト回数
|
||||
- field: deadlocks
|
||||
type: 0
|
||||
unit: times
|
||||
i18n:
|
||||
zh-CN: 死锁次数
|
||||
en-US: Deadlocks
|
||||
ja-JP: デッドロック回数
|
||||
protocol: jdbc
|
||||
jdbc:
|
||||
host: ^_^host^_^
|
||||
@@ -555,7 +500,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 慢查询
|
||||
en-US: Slow Sql
|
||||
ja-JP: スロークエリ
|
||||
priority: 10
|
||||
fields:
|
||||
- field: sql_text
|
||||
@@ -564,33 +508,28 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: SQL语句
|
||||
en-US: SQL Text
|
||||
ja-JP: SQL
|
||||
- field: calls
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 调用次数
|
||||
en-US: Calls
|
||||
ja-JP: コール回数
|
||||
- field: rows
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 行数
|
||||
en-US: Rows
|
||||
ja-JP: 行
|
||||
- field: avg_time
|
||||
type: 0
|
||||
unit: ms
|
||||
i18n:
|
||||
zh-CN: 平均时间
|
||||
en-US: Avg Time
|
||||
ja-JP: 平均時間
|
||||
- field: total_time
|
||||
type: 0
|
||||
unit: ms
|
||||
i18n:
|
||||
zh-CN: 总时间
|
||||
en-US: Total Time
|
||||
ja-JP: 合計時間
|
||||
aliasFields:
|
||||
- query
|
||||
- calls
|
||||
@@ -618,7 +557,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 事务信息
|
||||
en-US: Transaction Info
|
||||
ja-JP: トランザクション情報
|
||||
priority: 11
|
||||
fields:
|
||||
- field: db_name
|
||||
@@ -627,21 +565,18 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 数据库名称
|
||||
en-US: Database Name
|
||||
ja-JP: データベース名
|
||||
- field: commits
|
||||
type: 0
|
||||
unit: times
|
||||
i18n:
|
||||
zh-CN: 提交次数
|
||||
en-US: Commits
|
||||
ja-JP: コミット回数
|
||||
- field: rollbacks
|
||||
type: 0
|
||||
unit: times
|
||||
i18n:
|
||||
zh-CN: 回滚次数
|
||||
en-US: Rollbacks
|
||||
ja-JP: ロールバック回数
|
||||
protocol: jdbc
|
||||
jdbc:
|
||||
host: ^_^host^_^
|
||||
@@ -659,7 +594,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 冲突信息
|
||||
en-US: Conflicts Info
|
||||
ja-JP: コンフリクト情報
|
||||
priority: 12
|
||||
fields:
|
||||
- field: db_name
|
||||
@@ -668,37 +602,31 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 数据库名称
|
||||
en-US: Database Name
|
||||
ja-JP: データベース名
|
||||
- field: tablespace
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 表空间
|
||||
en-US: Tablespace
|
||||
ja-JP: 表領域
|
||||
- field: lock
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 锁
|
||||
en-US: Lock
|
||||
ja-JP: ロック
|
||||
- field: snapshot
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 快照
|
||||
en-US: Snapshot
|
||||
ja-JP: スナップショット
|
||||
- field: bufferpin
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 缓冲区
|
||||
en-US: Bufferpin
|
||||
ja-JP: バッファ
|
||||
- field: deadlock
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 死锁
|
||||
en-US: Deadlock
|
||||
ja-JP: デッドロック
|
||||
protocol: jdbc
|
||||
jdbc:
|
||||
host: ^_^host^_^
|
||||
@@ -716,7 +644,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 缓存命中率
|
||||
en-US: Cache Hit Ratio
|
||||
ja-JP: キャッシュ命中率
|
||||
priority: 13
|
||||
fields:
|
||||
- field: db_name
|
||||
@@ -725,14 +652,12 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 数据库名称
|
||||
en-US: Database Name
|
||||
ja-JP: データベース名
|
||||
- field: ratio
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 命中率
|
||||
en-US: Hit Ratio
|
||||
ja-JP: 命中率
|
||||
aliasFields:
|
||||
- blks_hit
|
||||
- blks_read
|
||||
@@ -756,7 +681,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Checkpoint信息
|
||||
en-US: Checkpoint Info
|
||||
ja-JP: チェックポイント情報
|
||||
priority: 14
|
||||
fields:
|
||||
- field: checkpoint_sync_time
|
||||
@@ -765,14 +689,12 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Checkpoint同步时间
|
||||
en-US: Checkpoint Sync Time
|
||||
ja-JP: チェックポイント同期時間
|
||||
- field: checkpoint_write_time
|
||||
type: 0
|
||||
unit: ms
|
||||
i18n:
|
||||
zh-CN: Checkpoint写入时间
|
||||
en-US: Checkpoint Write Time
|
||||
ja-JP: Checkpoint書き込まれた時間
|
||||
protocol: jdbc
|
||||
jdbc:
|
||||
host: ^_^host^_^
|
||||
@@ -790,7 +712,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Buffer信息
|
||||
en-US: Buffer Info
|
||||
ja-JP: バッファ情報
|
||||
priority: 15
|
||||
fields:
|
||||
- field: allocated
|
||||
@@ -798,31 +719,26 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 已分配
|
||||
en-US: Allocated
|
||||
ja-JP: 割り当てバッファ
|
||||
- field: fsync_calls_by_backend
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 后端进程直接执行的文件同步调用次数
|
||||
en-US: Fsync Calls By Backend
|
||||
ja-JP: バックエンド同期コール回数
|
||||
- field: written_directly_by_backend
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 后台写入到数据文件
|
||||
en-US: Written Directly By Backend
|
||||
ja-JP: バックエンドによる直接書き込まれたファイル
|
||||
- field: written_by_background_writer
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 后台写入
|
||||
en-US: Written By Background Writer
|
||||
ja-JP: バックグラウンドライターに書き込まれた
|
||||
- field: written_during_checkpoints
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 检查点期间写入
|
||||
en-US: Written During Checkpoints
|
||||
ja-JP: チェックポイント中の書き込み
|
||||
protocol: jdbc
|
||||
jdbc:
|
||||
host: ^_^host^_^
|
||||
|
||||
@@ -14,45 +14,51 @@
|
||||
# limitations under the License.
|
||||
|
||||
# The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring
|
||||
# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等
|
||||
category: bigdata
|
||||
# The monitoring type eg: linux windows tomcat mysql aws...
|
||||
# 监控类型 eg: linux windows tomcat mysql aws...
|
||||
app: greptime
|
||||
# The monitoring i18n name
|
||||
# 监控类型国际化名称
|
||||
name:
|
||||
zh-CN: GreptimeDB
|
||||
en-US: GreptimeDB
|
||||
ja-JP: GreptimeDB
|
||||
# The description and help of this monitoring type
|
||||
# 监控类型的帮助描述信息
|
||||
help:
|
||||
zh-CN: HertzBeat 对 GreptimeDB 时序数据库进行监控。<br><span class='help_module_span'><a class='help_module_content' https://docs.greptime.com/user-guide/operations/monitoring'>点击查看开启步骤</a>。</span>
|
||||
en-US: HertzBeat monitors the GreptimeDB time series database. <br><span class='help_module_span'><a class='help_module_content' https://docs.greptime.com/user-guide/operations/monitoring'>Click to view the activation steps</a>. </span>
|
||||
zh-TW: HertzBeat 對 GreptimeDB 時序資料庫進行監控。<br><span class='help_module_span'><a class='help_module_content' https://docs.greptime.com/user-guide/operations/monitoring'>點擊查看開啓步驟</a>。</span>
|
||||
ja-JP: HertzBeat は GreptimeDB 時系列データベースを監視します。<br><span class='help_module_span'><a class='help_module_content' https://docs.greptime.com/user-guide/operations/monitoring'>クリックしてガイドを見ます</a>。</span>
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.com/zh-cn/docs/help/greptimedb
|
||||
en-US: https://hertzbeat.com/docs/help/greptimedb
|
||||
# 监控所需输入参数定义(根据定义渲染页面UI)
|
||||
# Input params define for monitoring(render web ui by the definition)
|
||||
params:
|
||||
# field-param field key
|
||||
# field-变量字段标识符
|
||||
- field: host
|
||||
# name-param field display i18n name
|
||||
# name-参数字段显示名称
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
# type-字段类型,样式(大部分映射input标签type属性)
|
||||
type: host
|
||||
# required-true or false
|
||||
# required-是否是必输项 true-必填 false-可选
|
||||
required: true
|
||||
- field: port
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
# type-字段类型,样式(大部分映射input标签type属性)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
# 当type为number时,用range表示范围
|
||||
range: '[0,65535]'
|
||||
# default value
|
||||
defaultValue: 4000
|
||||
@@ -61,28 +67,28 @@ params:
|
||||
name:
|
||||
zh-CN: 查询超时时间
|
||||
en-US: Query Timeout
|
||||
ja-JP: クエリタイムアウト
|
||||
type: number
|
||||
required: false
|
||||
# hide param-true or false
|
||||
# 是否隐藏字段 true or false
|
||||
hide: true
|
||||
defaultValue: 6000
|
||||
|
||||
# collect metrics config list
|
||||
# 采集指标配置列表
|
||||
metrics:
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: greptime_app_version
|
||||
i18n:
|
||||
zh-CN: greptime 应用版本
|
||||
en-US: greptime_app_version
|
||||
ja-JP: greptime応用バージョン
|
||||
priority: 0
|
||||
fields:
|
||||
- field: short_version
|
||||
i18n:
|
||||
zh-CN: 版本
|
||||
en-US: version
|
||||
ja-JP: バージョン
|
||||
type: 1
|
||||
label: true
|
||||
protocol: http
|
||||
@@ -95,18 +101,17 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: greptime_catalog_schema_count
|
||||
i18n:
|
||||
zh-CN: 目录 模式 数量
|
||||
en-US: greptime_catalog_schema_count
|
||||
ja-JP: greptime_catalog_schema_count
|
||||
priority: 1
|
||||
fields:
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: 数量
|
||||
en-US: count
|
||||
ja-JP: 数量
|
||||
type: 1
|
||||
calculates:
|
||||
- name=.name
|
||||
@@ -120,25 +125,23 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: greptime_meta_cache_container_cache_get
|
||||
i18n:
|
||||
zh-CN: 缓存容器缓存获取
|
||||
en-US: greptime_meta_cache_container_cache_get
|
||||
ja-JP: キャッシュゲット
|
||||
priority: 2
|
||||
fields:
|
||||
- field: name
|
||||
i18n:
|
||||
zh-CN: 名称
|
||||
en-US: name
|
||||
ja-JP: キー
|
||||
type: 1
|
||||
label: true
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: 指标值
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -150,25 +153,23 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: greptime_meta_cache_container_cache_miss
|
||||
i18n:
|
||||
zh-CN: 缓存容器缓存未命中
|
||||
en-US: greptime_meta_cache_container_cache_miss
|
||||
ja-JP: キャッシュミス
|
||||
priority: 3
|
||||
fields:
|
||||
- field: name
|
||||
i18n:
|
||||
zh-CN: 名称
|
||||
en-US: name
|
||||
ja-JP: キー
|
||||
type: 1
|
||||
label: true
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: 指标值
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -180,25 +181,23 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: greptime_mito_region_count
|
||||
i18n:
|
||||
zh-CN: mito 引擎区域数量
|
||||
en-US: greptime_mito_region_count
|
||||
ja-JP: mitoエンジンのリージョン数量
|
||||
priority: 4
|
||||
fields:
|
||||
- field: worker
|
||||
i18n:
|
||||
zh-CN: 工作线程
|
||||
en-US: worker
|
||||
ja-JP: ワーカースレッド
|
||||
type: 1
|
||||
label: true
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: 数量
|
||||
en-US: count
|
||||
ja-JP: 数量
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -210,25 +209,23 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: greptime_mito_write_stall_total
|
||||
i18n:
|
||||
zh-CN: mito 引擎写入延迟总数
|
||||
en-US: greptime_mito_write_stall_total
|
||||
ja-JP: mitoエンジンの書き込み遅延の合計
|
||||
priority: 5
|
||||
fields:
|
||||
- field: worker
|
||||
i18n:
|
||||
zh-CN: 工作线程
|
||||
en-US: worker
|
||||
ja-JP: ワーカースレッド
|
||||
type: 1
|
||||
label: true
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: 数量
|
||||
en-US: total
|
||||
ja-JP: 数量
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -240,18 +237,17 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: greptime_meta_create_catalog_counter
|
||||
i18n:
|
||||
zh-CN: 创建目录计数器
|
||||
en-US: greptime_meta_create_catalog_counter
|
||||
ja-JP: 目録カウンター
|
||||
priority: 6
|
||||
fields:
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: 指标值
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -263,24 +259,22 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: greptime_runtime_threads_alive
|
||||
i18n:
|
||||
zh-CN: 运行时线程存活
|
||||
en-US: greptime_runtime_threads_alive
|
||||
ja-JP: ランタイムのアライブスレッド
|
||||
priority: 7
|
||||
fields:
|
||||
- field: thread_name
|
||||
i18n:
|
||||
zh-CN: 线程名称
|
||||
en-US: thread_name
|
||||
ja-JP: スレッド名
|
||||
type: 1
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: value
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -292,24 +286,22 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: greptime_runtime_threads_idle
|
||||
i18n:
|
||||
zh-CN: 运行时线程空闲
|
||||
en-US: greptime_runtime_threads_idle
|
||||
ja-JP: ランタイムのidleスレッド
|
||||
priority: 8
|
||||
fields:
|
||||
- field: thread_name
|
||||
i18n:
|
||||
zh-CN: 线程名称
|
||||
en-US: thread_name
|
||||
ja-JP: スレッド名
|
||||
type: 1
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: value
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -321,36 +313,32 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: greptime_servers_http_requests_total
|
||||
i18n:
|
||||
zh-CN: greptime 服务 HTTP 请求总数
|
||||
en-US: greptime_servers_http_requests_total
|
||||
ja-JP: HTTPリクエストの合計
|
||||
priority: 9
|
||||
fields:
|
||||
- field: code
|
||||
i18n:
|
||||
zh-CN: code
|
||||
en-US: code
|
||||
ja-JP: コード
|
||||
type: 1
|
||||
- field: method
|
||||
i18n:
|
||||
zh-CN: method
|
||||
en-US: method
|
||||
ja-JP: メソッド
|
||||
type: 1
|
||||
- field: path
|
||||
i18n:
|
||||
zh-CN: path
|
||||
en-US: path
|
||||
ja-JP: パス
|
||||
type: 1
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: value
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -362,18 +350,17 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: greptime_servers_mysql_connection_count
|
||||
i18n:
|
||||
zh-CN: greptime 服务 MySQL 连接数
|
||||
en-US: greptime_servers_mysql_connection_count
|
||||
ja-JP: MySQLのコネクション数
|
||||
priority: 10
|
||||
fields:
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: value
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -385,18 +372,17 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: greptime_servers_postgres_connection_count
|
||||
i18n:
|
||||
zh-CN: greptime 服务 Postgres 连接数
|
||||
en-US: greptime_servers_postgres_connection_count
|
||||
ja-JP: Postgresのコネクション数
|
||||
priority: 11
|
||||
fields:
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: value
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -408,18 +394,17 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: process_cpu_seconds_total
|
||||
i18n:
|
||||
zh-CN: 进程 CPU 时间总数
|
||||
en-US: process_cpu_seconds_total
|
||||
ja-JP: CPU時間合計
|
||||
priority: 12
|
||||
fields:
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: value
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -431,18 +416,17 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: process_max_fds
|
||||
i18n:
|
||||
zh-CN: 进程最大文件描述符
|
||||
en-US: process_max_fds
|
||||
ja-JP: プロセスの最大ファイル記述子
|
||||
priority: 13
|
||||
fields:
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: value
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -454,18 +438,17 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: process_open_fds
|
||||
i18n:
|
||||
zh-CN: 进程打开文件描述符
|
||||
en-US: process_open_fds
|
||||
ja-JP: プロセスのオープン中ファイル記述子
|
||||
priority: 14
|
||||
fields:
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: value
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -477,18 +460,17 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: process_resident_memory_bytes
|
||||
i18n:
|
||||
zh-CN: 进程常驻内存字节
|
||||
en-US: process_resident_memory_bytes
|
||||
ja-JP: プロセスの常駐メモリバイト
|
||||
priority: 15
|
||||
fields:
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: value
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -500,18 +482,17 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: process_start_time_seconds
|
||||
i18n:
|
||||
zh-CN: 进程启动时间(秒)
|
||||
en-US: process_start_time_seconds
|
||||
ja-JP: プロセスのアップタイム(秒)
|
||||
priority: 16
|
||||
fields:
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: value
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -523,18 +504,17 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: process_threads
|
||||
i18n:
|
||||
zh-CN: 进程线程
|
||||
en-US: process_threads
|
||||
ja-JP: プロセススレッド
|
||||
priority: 17
|
||||
fields:
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: value
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -546,18 +526,17 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: process_virtual_memory_bytes
|
||||
i18n:
|
||||
zh-CN: 进程虚拟内存字节
|
||||
en-US: process_virtual_memory_bytes
|
||||
ja-JP: プロセスの仮想メモリバイト
|
||||
priority: 18
|
||||
fields:
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: value
|
||||
en-US: value
|
||||
ja-JP: 値
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -569,24 +548,22 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: raft_engine_log_entry_count
|
||||
i18n:
|
||||
zh-CN: raft 引擎日志条目数量
|
||||
en-US: raft_engine_log_entry_count
|
||||
ja-JP: raftエンジンのログエントリー数
|
||||
priority: 19
|
||||
fields:
|
||||
- field: type
|
||||
i18n:
|
||||
zh-CN: 类型
|
||||
en-US: type
|
||||
ja-JP: タイプ
|
||||
type: 1
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: 数量
|
||||
en-US: count
|
||||
ja-JP: 数量
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -598,24 +575,22 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: raft_engine_log_file_count
|
||||
i18n:
|
||||
zh-CN: raft 引擎日志文件数量
|
||||
en-US: raft_engine_log_file_count
|
||||
ja-JP: raftエンジンのログファイル数
|
||||
priority: 20
|
||||
fields:
|
||||
- field: type
|
||||
i18n:
|
||||
zh-CN: 类型
|
||||
en-US: type
|
||||
ja-JP: タイプ
|
||||
type: 1
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: 数量
|
||||
en-US: count
|
||||
ja-JP: 数量
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -627,18 +602,17 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: raft_engine_memory_usage
|
||||
i18n:
|
||||
zh-CN: raft 引擎内存占用
|
||||
en-US: raft_engine_memory_usage
|
||||
ja-JP: raftエンジンのメモリ使用率
|
||||
priority: 21
|
||||
fields:
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: 占用
|
||||
en-US: total
|
||||
ja-JP: 使用率
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -650,24 +624,22 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: raft_engine_recycled_file_count
|
||||
i18n:
|
||||
zh-CN: raft 引擎回收文件数量
|
||||
en-US: raft_engine_recycled_file_count
|
||||
ja-JP: raftエンジンのリサイクルファイル数
|
||||
priority: 22
|
||||
fields:
|
||||
- field: type
|
||||
i18n:
|
||||
zh-CN: 类型
|
||||
en-US: type
|
||||
ja-JP: タイプ
|
||||
type: 1
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: 数量
|
||||
en-US: count
|
||||
ja-JP: 数量
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -679,18 +651,17 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: sys_jemalloc_allocated
|
||||
i18n:
|
||||
zh-CN: jemalloc 分配
|
||||
en-US: sys_jemalloc_allocated
|
||||
ja-JP: jemallocの割り当て
|
||||
priority: 23
|
||||
fields:
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: 数量
|
||||
en-US: value
|
||||
ja-JP: 数量
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
@@ -702,18 +673,17 @@ metrics:
|
||||
parseType: prometheus
|
||||
|
||||
# metrics - cluster_node_status
|
||||
# 监控指标 - cluster_node_status
|
||||
- name: sys_jemalloc_resident
|
||||
i18n:
|
||||
zh-CN: jemalloc 常驻
|
||||
en-US: sys_jemalloc_resident
|
||||
ja-JP: jemallocの常駐
|
||||
priority: 24
|
||||
fields:
|
||||
- field: value
|
||||
i18n:
|
||||
zh-CN: 数量
|
||||
en-US: value
|
||||
ja-JP: 数量
|
||||
type: 1
|
||||
protocol: http
|
||||
http:
|
||||
|
||||
@@ -21,13 +21,11 @@ app: h3c_switch
|
||||
name:
|
||||
zh-CN: 华三通用交换机
|
||||
en-US: H3C Switch
|
||||
ja-JP: H3Cスイッチングハブ
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: Hertzbeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-snmp'> SNMP 协议</a> 对 华三交换机 的通用指标(可用性,系统信息,端口流量等)进行采集监控。<br>您可以点击 “<i>新建 华三通用交换机</i>” 并进行配置SNMP相关参数添加,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: HertzBeat uses <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-snmp'> SNMP Protocol</a> to monitoring H3C Switch general performance metrics. <br>You can click the "<i>New H3C Switch</i>" button and config snmp params to add monitor or import an existing setup through the "<i>More Actions</i>" menu.
|
||||
zh-TW: Hertzbeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-snmp'> SNMP 協議</a> 對 華三交換機 的通用指標(可用性,系統信息,端口流量等)進行采集監控。<br>您可以點擊 “<i>新建 華三通用交換機</i>” 並進行配置SNMP相關參數添加,或者選擇“<i>更多操作</i>”,導入已有配置。
|
||||
ja-JP: Hertzbeat は <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-snmp'> SNMP プロトコルを介して</a> H3Cスイッチングハブの一般的なメトリック監視します。<br>「<i>新規 H3Cスイッチングハブ</i>」をクリックしてSNMPなどのパラメタを設定した後、新規することができます。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/h3c_switch
|
||||
en-US: https://hertzbeat.apache.org/docs/help/h3c_switch
|
||||
@@ -39,7 +37,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -50,7 +47,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -65,7 +61,6 @@ params:
|
||||
name:
|
||||
zh-CN: SNMP 版本
|
||||
en-US: SNMP Version
|
||||
ja-JP: SNMPバージョン
|
||||
# type-param field type(radio mapping the html radio tag)
|
||||
type: radio
|
||||
# required-true or false
|
||||
@@ -84,7 +79,6 @@ params:
|
||||
name:
|
||||
zh-CN: SNMP 团体字
|
||||
en-US: SNMP Community
|
||||
ja-JP: SNMPコミュニティ
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
@@ -104,7 +98,6 @@ params:
|
||||
name:
|
||||
zh-CN: SNMP username
|
||||
en-US: SNMP username
|
||||
ja-JP: SNMPユーザー名
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
@@ -123,7 +116,6 @@ params:
|
||||
name:
|
||||
zh-CN: SNMP contextName
|
||||
en-US: SNMP contextName
|
||||
ja-JP: SNMPコンテキスト名
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
@@ -142,7 +134,6 @@ params:
|
||||
name:
|
||||
zh-CN: SNMP authPassword
|
||||
en-US: SNMP authPassword
|
||||
ja-JP: SNMP認証パスワード
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
@@ -161,7 +152,6 @@ params:
|
||||
name:
|
||||
zh-CN: authPassword 加密方式
|
||||
en-US: authPassword Encryption
|
||||
ja-JP: 認証暗号
|
||||
# type-param field type(radio mapping the html radio tag)
|
||||
type: radio
|
||||
# required-true or false
|
||||
@@ -182,7 +172,6 @@ params:
|
||||
name:
|
||||
zh-CN: SNMP privPassphrase
|
||||
en-US: SNMP privPassphrase
|
||||
ja-JP: SNMPパスワードフレーズ
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
@@ -201,7 +190,6 @@ params:
|
||||
name:
|
||||
zh-CN: privPassword 加密方式
|
||||
en-US: privPassword Encryption
|
||||
ja-JP: パスワードの暗号
|
||||
# type-param field type(radio mapping the html radio tag)
|
||||
type: radio
|
||||
# required-true or false
|
||||
@@ -222,7 +210,6 @@ params:
|
||||
name:
|
||||
zh-CN: 超时时间(ms)
|
||||
en-US: Timeout(ms)
|
||||
ja-JP: タイムアウト(ms)
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -240,7 +227,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 系统信息
|
||||
en-US: System Info
|
||||
ja-JP: システム情報
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -252,38 +238,32 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 主机名称
|
||||
en-US: Host Name
|
||||
ja-JP: ホスト名
|
||||
- field: descr
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 描述信息
|
||||
en-US: Description
|
||||
ja-JP: 説明
|
||||
- field: uptime
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 运行时长
|
||||
en-US: Uptime
|
||||
ja-JP: アップタイム
|
||||
- field: location
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 位置
|
||||
en-US: Location
|
||||
ja-JP: 位置
|
||||
- field: contact
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 联系人
|
||||
en-US: Contact
|
||||
ja-JP: 連絡先
|
||||
- field: responseTime
|
||||
type: 0
|
||||
unit: ms
|
||||
i18n:
|
||||
zh-CN: 响应时间
|
||||
en-US: Response Time
|
||||
ja-JP: 応答時間
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: snmp
|
||||
# the config content when protocol is snmp
|
||||
@@ -325,7 +305,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 接口详情
|
||||
en-US: Interfaces Detail
|
||||
ja-JP: ネットワークカード詳細
|
||||
priority: 1
|
||||
fields:
|
||||
- field: index
|
||||
@@ -333,78 +312,66 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 编号
|
||||
en-US: Index
|
||||
ja-JP: 番号
|
||||
- field: descr
|
||||
type: 1
|
||||
label: true
|
||||
i18n:
|
||||
zh-CN: 接口名称
|
||||
en-US: Interface Name
|
||||
ja-JP: ネットワークカード名
|
||||
- field: mtu
|
||||
type: 0
|
||||
unit: 'byte'
|
||||
i18n:
|
||||
zh-CN: MTU
|
||||
en-US: MTU
|
||||
ja-JP: MTU
|
||||
- field: speed
|
||||
type: 0
|
||||
unit: 'MB/s'
|
||||
i18n:
|
||||
zh-CN: 接口速率
|
||||
en-US: Interface Speed
|
||||
ja-JP: ネットワークカード速度
|
||||
- field: in_octets
|
||||
type: 0
|
||||
unit: 'MByte'
|
||||
i18n:
|
||||
zh-CN: 入流量
|
||||
en-US: In Octets
|
||||
ja-JP: 受信バイト数
|
||||
- field: in_discards
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 入丢包数
|
||||
en-US: In Discards
|
||||
ja-JP: 受信パケットロス数
|
||||
- field: in_errors
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 入错包数
|
||||
en-US: In Errors
|
||||
ja-JP: 受信異常パケット数
|
||||
- field: out_octets
|
||||
type: 0
|
||||
unit: 'MByte'
|
||||
i18n:
|
||||
zh-CN: 出流量
|
||||
en-US: Out Octets
|
||||
ja-JP: 送信バイト数
|
||||
- field: out_discards
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 出丢包数
|
||||
en-US: Out Discards
|
||||
ja-JP: 送信パケットロス数
|
||||
- field: out_errors
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 出错包数
|
||||
en-US: Out Errors
|
||||
ja-JP: 送信異常パケット数
|
||||
- field: admin_status
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 配置状态
|
||||
en-US: Config Status
|
||||
ja-JP: 設定ステータス
|
||||
- field: oper_status
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 当前状态
|
||||
en-US: Current Status
|
||||
ja-JP: ステータス
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- ifIndex
|
||||
|
||||
@@ -21,13 +21,11 @@ app: hadoop
|
||||
name:
|
||||
zh-CN: Apache Hadoop
|
||||
en-US: Apache Hadoop
|
||||
ja-JP: Apache Hadoop
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: HertzBeat 使用<a class='help_module_content' href='https://baijiahao.baidu.com/s?id=1605937053950156833&wfr=spider&for=pc'> JMX 协议</a>对 Hadoop 的 JVM 虚拟机的通用性能指标(memory pool,限JDK8及以下的code cache、class loading、thread)进行采集监控。<br><span class='help_module_span'>⚠️注意:您需要在 Hadoop 应用开启 JMX 服务, <a class='help_module_content' href='https://hertzbeat.apache.org/zh-cn/docs/help/hadoop#hadoop%E5%BA%94%E7%94%A8%E5%BC%80%E5%90%AFjmx%E5%8D%8F%E8%AE%AE%E6%AD%A5%E9%AA%A4'>点击查看开启步骤</a>。</span>
|
||||
en-US: "HertzBeat monitors general performance metrics(memory pool, class loading, thread) of Hadoop VMware through <a class='help_module_content' href='https://zh.wikipedia.org/JMX'>JMX protocol</a>. <br><span class='help_module_span'>⚠️Note: You should enable the JMX service in Hadoop application, and the metric of code cache is only available to JDK8 and below.<a class='help_module_content' href='https://hertzbeat.apache.org/docs/help/hadoop#hadoop%E5%BA%94%E7%94%A8%E5%BC%80%E5%90%AFjmx%E5%8D%8F%E8%AE%AE%E6%AD%A5%E9%AA%A4'>Click here to view the specific steps.</a></span>"
|
||||
zh-TW: HertzBeat使用<a class='help_ module_ content' href='https://baijiahao.baidu.com/s?id=1605937053950156833&wfr=spider&for=pc'> JMX協定</a>對Hadoop的JVM虛擬機器的通用性能指標(memory pool,限JDK8及以下的code cache、class loading、thread)進行採集監控。<br><span class='help_ module_ span'> ⚠️ ️注意:您需要在Hadoop應用開啟JMX服務,<a class='help_ module_ content' href='https://hertzbeat.apache.org/zh-cn/docs/help/hadoop#hadoop%E5%BA%94%E7%94%A8%E5%BC%80%E5%90%AFjmx%E5%8D%8F%E8%AE%AE%E6%AD%A5%E9%AA%A4'>點擊查看開啟步驟</a>。</span>
|
||||
ja-JP: HertzBeatは <a class='help_module_content' href='https://baijiahao.baidu.com/s?id=1605937053950156833&wfr=spider&for=pc'> JMXプロトコルを介して</a> HadoopのJava仮想マシンの一般的なパフォーマンスのメトリックを監視します。<br><span class='help_module_span'> ⚠️注意:Hadoop で JMX サービスを有効にする必要があります。<a class='help_module_content' href=' https://hertzbeat.apache.org/zh-cn/docs/help/hadoop#hadoop%E5%BA%94%E7%94%A8%E5%BC%80%E5%90%AFjmx%E5%8D%8F%E8%AE%AE%E6%AD%A5%E9%AA%A4'>クリックしてガイドを見ます</a>。</span>
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/hadoop/
|
||||
en-US: https://hertzbeat.apache.org/docs/help/hadoop/
|
||||
@@ -39,7 +37,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -50,7 +47,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -65,7 +61,6 @@ params:
|
||||
name:
|
||||
zh-CN: JMX URL
|
||||
en-US: JMX URL
|
||||
ja-JP: JMX URL
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# required-true or false
|
||||
@@ -80,7 +75,6 @@ params:
|
||||
name:
|
||||
zh-CN: 用户名
|
||||
en-US: Username
|
||||
ja-JP: ユーザー名
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
@@ -95,7 +89,6 @@ params:
|
||||
name:
|
||||
zh-CN: 密码
|
||||
en-US: Password
|
||||
ja-JP: パスワード
|
||||
# type-param field type(most mapping the html input tag)
|
||||
type: password
|
||||
# required-true or false
|
||||
@@ -109,7 +102,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 虚拟机基础信息
|
||||
en-US: JVM Basic
|
||||
ja-JP: Java仮想マシン基礎情報
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -121,26 +113,22 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 名称
|
||||
en-US: Vm Name
|
||||
ja-JP: 仮想マシン名
|
||||
- field: VmVendor
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 厂商
|
||||
en-US: Vm Vendor
|
||||
ja-JP: 仮想マシンベンダー
|
||||
- field: VmVersion
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 版本
|
||||
en-US: Vm Version
|
||||
ja-JP: 仮想マシンバージョン
|
||||
- field: Uptime
|
||||
type: 0
|
||||
unit: ms
|
||||
i18n:
|
||||
zh-CN: 运行时长
|
||||
en-US: Up time
|
||||
ja-JP: アップタイム
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: jmx
|
||||
# the config content when protocol is jmx
|
||||
@@ -160,7 +148,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 内存池
|
||||
en-US: Memory Pool
|
||||
ja-JP: メモリプール
|
||||
fields:
|
||||
- field: name
|
||||
type: 1
|
||||
@@ -168,35 +155,30 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 指标名称
|
||||
en-US: Name
|
||||
ja-JP: 指標名
|
||||
- field: committed
|
||||
type: 0
|
||||
unit: MB
|
||||
i18n:
|
||||
zh-CN: 已分配内存
|
||||
en-US: Committed
|
||||
ja-JP: コミットメモリ
|
||||
- field: init
|
||||
type: 0
|
||||
unit: MB
|
||||
i18n:
|
||||
zh-CN: 初始化内存
|
||||
en-US: Init
|
||||
ja-JP: イニシャルメモリ
|
||||
- field: max
|
||||
type: 0
|
||||
unit: MB
|
||||
i18n:
|
||||
zh-CN: 最大内存
|
||||
en-US: Max
|
||||
ja-JP: 最大メモリ
|
||||
- field: used
|
||||
type: 0
|
||||
unit: MB
|
||||
i18n:
|
||||
zh-CN: 已使用内存
|
||||
en-US: Used
|
||||
ja-JP: 使用済みメモリ
|
||||
units:
|
||||
- committed=B->MB
|
||||
- init=B->MB
|
||||
@@ -233,32 +215,27 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 本地代码缓冲区
|
||||
en-US: Code Cache
|
||||
ja-JP: コードキャッシュ
|
||||
fields:
|
||||
- field: committed
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 已分配内存
|
||||
en-US: Committed
|
||||
ja-JP: コミットメモリ
|
||||
- field: init
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 初始化内存
|
||||
en-US: Init
|
||||
ja-JP: イニシャルメモリ
|
||||
- field: max
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大内存
|
||||
en-US: Max
|
||||
ja-JP: 最大メモリ
|
||||
- field: used
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 已使用内存
|
||||
en-US: Used
|
||||
ja-JP: 使用済みメモリ
|
||||
aliasFields:
|
||||
- Usage->committed
|
||||
- Usage->init
|
||||
@@ -285,7 +262,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 类加载信息
|
||||
en-US: Class Loading
|
||||
ja-JP: クラスローディング情報
|
||||
# collect metrics content
|
||||
fields:
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
@@ -294,19 +270,16 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 当前已加载类数量
|
||||
en-US: Loaded Class Count
|
||||
ja-JP: ロードされたクラス数
|
||||
- field: TotalLoadedClassCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 已加载类总数量
|
||||
en-US: Total Loaded Class Count
|
||||
ja-JP: ロードされたクラス総数
|
||||
- field: UnloadedClassCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 未加载类总数量
|
||||
en-US: Unloaded Class Count
|
||||
ja-JP: アンロードされたクラス総数
|
||||
protocol: jmx
|
||||
jmx:
|
||||
host: ^_^host^_^
|
||||
@@ -321,7 +294,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 线程信息
|
||||
en-US: Thread
|
||||
ja-JP: スレッド情報
|
||||
# collect metrics content
|
||||
fields:
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
@@ -330,39 +302,33 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 已启动线程总数
|
||||
en-US: Total Started Thread Count
|
||||
ja-JP: スレッド総数
|
||||
- field: ThreadCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 活跃线程数
|
||||
en-US: Thread Count
|
||||
ja-JP: 活躍スレッド数
|
||||
- field: PeakThreadCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大峰值线程数
|
||||
en-US: Peak Thread Count
|
||||
ja-JP: 最大スレッド数
|
||||
- field: DaemonThreadCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 活跃守护线程数
|
||||
en-US: Daemon Thread Count
|
||||
ja-JP: デーモンスレッド数
|
||||
- field: CurrentThreadUserTime
|
||||
type: 0
|
||||
unit: s
|
||||
i18n:
|
||||
zh-CN: 线程占用的CPU时间(用户态)
|
||||
en-US: Current Thread User Time
|
||||
ja-JP: 現在のスレッドユーザー時間
|
||||
- field: CurrentThreadCpuTime
|
||||
type: 0
|
||||
unit: s
|
||||
i18n:
|
||||
zh-CN: 线程占用的CPU时间
|
||||
en-US: Current Thread CPU Time
|
||||
ja-JP: 現在のスレッドシステム時間
|
||||
units:
|
||||
- CurrentThreadUserTime=NS->S
|
||||
- CurrentThreadCpuTime=NS->S
|
||||
|
||||
@@ -21,13 +21,12 @@ app: hbase_master
|
||||
name:
|
||||
zh-CN: Apache Hbase Master
|
||||
en-US: Apache Hbase Master
|
||||
ja-JP: Apache Hbase Master
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: Hertzbeat 对 Hbase 数据库 Master 节点监控指标进行监控。<br>您可以点击 “<i>新建 Apache Hbase Master</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: Hertzbeat monitors the Master node monitoring indicators of the Hbase database. <br>You can click "<i>New Apache Hbase Master</i>" to configure, or select "<i>More Actions</i>" to import an existing configuration.
|
||||
zh-TW: Hertzbeat 對 Hbase 數據庫 Master 节點監控指標進行監控。<br>您可以點擊 “<i>新建 Apache Hbase Master</i>” 並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
|
||||
ja-JP: Hertzbeat は HbaseデータベースのMasterノードの一般的なメトリック監視します。<br>「<i>新規 Apache Hbase Master</i>」をクリックしてパラメタを設定した後、新規することができます。
|
||||
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/hbase_master/
|
||||
en-US: https://hertzbeat.apache.org/docs/help/hbase_master/
|
||||
@@ -39,7 +38,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -50,7 +48,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -65,7 +62,6 @@ params:
|
||||
name:
|
||||
zh-CN: 查询超时时间
|
||||
en-US: Query Timeout
|
||||
ja-JP: クエリタイムアウト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# required-true or false
|
||||
@@ -80,7 +76,6 @@ params:
|
||||
name:
|
||||
zh-CN: 启用HTTPS
|
||||
en-US: HTTPS
|
||||
ja-JP: HTTPS
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
@@ -92,7 +87,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Master服务信息
|
||||
en-US: Master Service Info
|
||||
ja-JP: Masterサービス情報
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -104,25 +98,21 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 活跃RegionServer数量
|
||||
en-US: numRegionServers
|
||||
ja-JP: 活躍的なRegionServer数
|
||||
- field: numDeadRegionServers
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 异常RegionServer数量
|
||||
en-US: numDeadRegionServers
|
||||
ja-JP: 異常的なRegionServer数
|
||||
- field: averageLoad
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 集群平均负载
|
||||
en-US: averageLoad
|
||||
ja-JP: 平均ロード
|
||||
- field: clusterRequests
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 集群请求数量
|
||||
en-US: clusterRequests
|
||||
ja-JP: クラスターのリクエスト数
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- $.numRegionServers
|
||||
@@ -147,7 +137,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Region In Transition 信息
|
||||
en-US: Region In Transition Info
|
||||
ja-JP: Region In Transition 情報
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 1
|
||||
@@ -159,19 +148,16 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 当前的 RIT 数量
|
||||
en-US: ritCount
|
||||
ja-JP: RIT数
|
||||
- field: ritCountOverThreshold
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 超过阈值的 RIT 数量
|
||||
en-US: ritCountOverThreshold
|
||||
ja-JP: 閾値を超えたRIT数
|
||||
- field: ritOldestAge
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最老的RIT的持续时间
|
||||
en-US: ritOldestAge
|
||||
ja-JP: 最古のRITのスパン
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- $.ritCount
|
||||
@@ -194,7 +180,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 基础信息
|
||||
en-US: Basic Info
|
||||
ja-JP: 基礎情報
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 2
|
||||
@@ -206,57 +191,48 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 当前活跃RegionServer列表
|
||||
en-US: liveRegionServers
|
||||
ja-JP: 活躍的なRegionServer
|
||||
- field: deadRegionServers
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 当前离线RegionServer列表
|
||||
en-US: deadRegionServers
|
||||
ja-JP: オフラインRegionServer
|
||||
- field: zookeeperQuorum
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Zookeeper列表
|
||||
en-US: zookeeperQuorum
|
||||
ja-JP: zookeeper定足数
|
||||
- field: masterHostName
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Master节点
|
||||
en-US: masterHostName
|
||||
ja-JP: Masterホスト名
|
||||
- field: BalancerCluster_num_ops
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 集群负载均衡次数
|
||||
en-US: BalancerCluster_num_ops
|
||||
ja-JP: クラスターのロードバランシング回数
|
||||
- field: numActiveHandler
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: RPC句柄数
|
||||
en-US: numActiveHandler
|
||||
ja-JP: RPCハンドル数
|
||||
- field: receivedBytes
|
||||
type: 0
|
||||
unit: 'MB'
|
||||
i18n:
|
||||
zh-CN: 集群接收数据量(MB)
|
||||
en-US: receivedBytes
|
||||
ja-JP: 受信バイト
|
||||
- field: sentBytes
|
||||
type: 0
|
||||
unit: 'MB'
|
||||
i18n:
|
||||
zh-CN: 集群发送数据量(MB)
|
||||
en-US: sentBytes
|
||||
ja-JP: 送信バイト
|
||||
- field: clusterRequests
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 集群总请求数量
|
||||
en-US: clusterRequests
|
||||
ja-JP: クラスターのリクエスト数
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- $.beans[?(@.name == "Hadoop:service=HBase,name=Master,sub=Server")].['tag.liveRegionServers']
|
||||
|
||||
@@ -21,13 +21,11 @@ app: hbase_regionserver
|
||||
name:
|
||||
zh-CN: Apache Hbase RegionServer
|
||||
en-US: Apache Hbase RegionServer
|
||||
ja-JP: Apache Hbase RegionServer
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: Hertzbeat 对 Hbase 数据库 RegionServer 节点监控指标进行监控。<br>您可以点击 “<i>新建 Apache Hbase RegionServer</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: Hertzbeat monitors the RegionServer node monitoring indicators of the Hbase database. <br>You can click "<i>New Apache Hbase RegionServer</i>" to configure, or select "<i>More Actions</i>" to import an existing configuration.
|
||||
zh-TW: Hertzbeat 對 Hbase 數據庫 RegionServer 节點監控指標進行監控。<br>您可以點擊 “<i>新建 Apache Hbase RegionServer</i>” 並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
|
||||
ja-JP: Hertzbeat は HbaseデータベースのRegionServerノードの一般的なメトリック監視します。<br>「<i>新規 Apache Hbase RegionServer</i>」をクリックしてパラメタを設定した後、新規することができます。
|
||||
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/hbase_regionserver/
|
||||
@@ -40,7 +38,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -51,7 +48,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -66,7 +62,6 @@ params:
|
||||
name:
|
||||
zh-CN: 查询超时时间
|
||||
en-US: Query Timeout
|
||||
ja-JP: クエリタイムアウト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# required-true or false
|
||||
@@ -81,7 +76,6 @@ params:
|
||||
name:
|
||||
zh-CN: 启用HTTPS
|
||||
en-US: HTTPS
|
||||
ja-JP: HTTPS
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: boolean
|
||||
# required-true or false
|
||||
@@ -93,7 +87,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: RegionServer 服务信息
|
||||
en-US: RegionServer Service Info
|
||||
ja-JP: RegionServerサービス情報
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 0
|
||||
@@ -105,28 +98,24 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Region数量
|
||||
en-US: regionCount
|
||||
ja-JP: Region数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: readRequestCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 重启集群后的读请求数量
|
||||
en-US: readRequestCount
|
||||
ja-JP: 読み取りリクエスト数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: writeRequestCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 重启集群后的写请求数量
|
||||
en-US: writeRequestCount
|
||||
ja-JP: 書き込みリクエスト数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: averageRegionSize
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 平均Region大小
|
||||
en-US: averageRegionSize
|
||||
ja-JP: Regionの平均サイズ
|
||||
unit: 'MB'
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: totalRequestCount
|
||||
@@ -134,126 +123,108 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 全部请求数量
|
||||
en-US: totalRequestCount
|
||||
ja-JP: リクエスト総数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: ScanTime_num_ops
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Scan 请求总量
|
||||
en-US: ScanTime_num_ops
|
||||
ja-JP: Scan操作回数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: Append_num_ops
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Append 请求量
|
||||
en-US: Append_num_ops
|
||||
ja-JP: Append操作回数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: Increment_num_ops
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Increment请求量
|
||||
en-US: Increment_num_ops
|
||||
ja-JP: Increment操作回数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: Get_num_ops
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Get 请求量
|
||||
en-US: Get_num_ops
|
||||
ja-JP: Get操作回数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: Delete_num_ops
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Delete 请求量
|
||||
en-US: Delete_num_ops
|
||||
ja-JP: Delete操作回数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: Put_num_ops
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Put 请求量
|
||||
en-US: Put_num_ops
|
||||
ja-JP: Put操作回数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: ScanTime_mean
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 平均 Scan 请求时间
|
||||
en-US: ScanTime_mean
|
||||
ja-JP: Scan操作の平均時間
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: ScanTime_min
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最小 Scan 请求时间
|
||||
en-US: ScanTime_min
|
||||
ja-JP: Scan操作の最小時間
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: ScanTime_max
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大 Scan 请求时间
|
||||
en-US: ScanTime_max
|
||||
ja-JP: Scan操作の最大時間
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: ScanSize_mean
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 平均 Scan 请求大小
|
||||
en-US: ScanSize_mean
|
||||
ja-JP: Scan操作の平均サイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: ScanSize_min
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最小 Scan 请求大小
|
||||
en-US: ScanSize_min
|
||||
ja-JP: Scan操作の最小サイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: ScanSize_max
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大 Scan 请求大小
|
||||
en-US: ScanSize_max
|
||||
ja-JP: Scan操作の最大サイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: slowPutCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 慢操作次数/Put
|
||||
en-US: slowPutCount
|
||||
ja-JP: スローPut操作回数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: slowGetCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 慢操作次数/Get
|
||||
en-US: slowGetCount
|
||||
ja-JP: スローGet操作回数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: slowAppendCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 慢操作次数/Append
|
||||
en-US: slowAppendCount
|
||||
ja-JP: スローAppend操作回数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: slowIncrementCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 慢操作次数/Increment
|
||||
en-US: slowIncrementCount
|
||||
ja-JP: スローIncrement操作回数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: slowDeleteCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 慢操作次数/Delete
|
||||
en-US: slowDeleteCount
|
||||
ja-JP: スローDelete操作回数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: blockCacheSize
|
||||
type: 0
|
||||
@@ -261,42 +232,36 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 缓存块内存占用大小
|
||||
en-US: blockCacheSize
|
||||
ja-JP: ブロックキャッシュのサイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: blockCacheCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 缓存块数量_Block Cache 中的 Block 数量
|
||||
en-US: blockCacheCount
|
||||
ja-JP: ブロックキャッシュ数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: blockCacheExpressHitPercent
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 读缓存命中率
|
||||
en-US: blockCacheExpressHitPercent
|
||||
ja-JP: ブロックキャッシュ命中率
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: memStoreSize
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Memstore 大小
|
||||
en-US: memStoreSize
|
||||
ja-JP: Memstoreサイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: FlushTime_num_ops
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: RS写磁盘次数/MemStore Flush 写磁盘次数
|
||||
en-US: FlushTime_num_ops
|
||||
ja-JP: MemStore Flush操作回数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: flushQueueLength
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Region Flush 队列长度
|
||||
en-US: flushQueueLength
|
||||
ja-JP: Region Flushキューの長さ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: flushedCellsSize
|
||||
type: 0
|
||||
@@ -304,21 +269,18 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: flush到磁盘大小
|
||||
en-US: flushedCellsSize
|
||||
ja-JP: flushedサイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: storeCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Store 个数
|
||||
en-US: storeCount
|
||||
ja-JP: Store数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: storeFileCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Storefile 个数
|
||||
en-US: storeFileCount
|
||||
ja-JP: Storeファイル数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: storeFileSize
|
||||
type: 0
|
||||
@@ -326,42 +288,36 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: Storefile 大小
|
||||
en-US: storeFileSize
|
||||
ja-JP: Storeファイルサイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: compactionQueueLength
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Compaction 队列长度
|
||||
en-US: compactionQueueLength
|
||||
ja-JP: Compactionキューの長さ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: percentFilesLocal
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Region 的 HFile 位于本地 HDFS data node的比例
|
||||
en-US: percentFilesLocal
|
||||
ja-JP: Regionのローカルファイルのパーセント
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: percentFilesLocalSecondaryRegions
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Region 副本的 HFile 位于本地 HDFS data node的比例
|
||||
en-US: percentFilesLocalSecondaryRegions
|
||||
ja-JP: Secondary Regionのローカルファイルのパーセント
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: hlogFileCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: WAL 文件数量
|
||||
en-US: hlogFileCount
|
||||
ja-JP: WALファイル数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: hlogFileSize
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: WAL 文件大小
|
||||
en-US: hlogFileSize
|
||||
ja-JP: WALファイルサイズ
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- $.regionCount
|
||||
@@ -458,7 +414,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: RegionServer IPC 信息
|
||||
en-US: RegionServer IPC Info
|
||||
ja-JP: RegionServer IPC 情報
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 1
|
||||
@@ -470,28 +425,24 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: RPC句柄数
|
||||
en-US: numActiveHandler
|
||||
ja-JP: RPCハンドル数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: NotServingRegionException
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: NotServingRegionException 异常数量
|
||||
en-US: NotServingRegionException
|
||||
ja-JP: NotServingRegionException
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: RegionMovedException
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: RegionMovedException异常数量
|
||||
en-US: RegionMovedException
|
||||
ja-JP: RegionMovedException
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: RegionTooBusyException
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: RegionTooBusyException异常数量
|
||||
en-US: RegionTooBusyException
|
||||
ja-JP: RegionTooBusyException
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- $.numActiveHandler
|
||||
@@ -517,7 +468,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: RegionServer JVM 信息
|
||||
en-US: RegionServer JVM Info
|
||||
ja-JP: RegionServer Java仮想マシン情報
|
||||
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
|
||||
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
|
||||
priority: 2
|
||||
@@ -530,7 +480,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 进程使用的非堆内存大小
|
||||
en-US: MemNonHeapUsedM
|
||||
ja-JP: 使用済みのノンヒープメモリサイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: MemNonHeapCommittedM
|
||||
type: 0
|
||||
@@ -538,7 +487,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 进程 commit 的非堆内存大小
|
||||
en-US: MemNonHeapCommittedM
|
||||
ja-JP: コミットのノンヒープメモリサイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: MemHeapUsedM
|
||||
type: 0
|
||||
@@ -546,7 +494,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 进程使用的堆内存大小
|
||||
en-US: MemHeapUsedM
|
||||
ja-JP: 使用済みのヒープメモリサイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: MemHeapCommittedM
|
||||
type: 0
|
||||
@@ -554,7 +501,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 进程 commit 的堆内存大小
|
||||
en-US: MemHeapCommittedM
|
||||
ja-JP: コミットのヒープメモリサイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: MemHeapMaxM
|
||||
type: 0
|
||||
@@ -562,7 +508,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 进程最大的堆内存大小
|
||||
en-US: MemHeapMaxM
|
||||
ja-JP: 最大のヒープメモリサイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: MemMaxM
|
||||
type: 0
|
||||
@@ -570,14 +515,12 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 进程最大内存大小
|
||||
en-US: MemMaxM
|
||||
ja-JP: 最大のメモリサイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: GcCount
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Young GC次数
|
||||
en-US: GcCount
|
||||
ja-JP: GC回数
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- $.MemNonHeapUsedM
|
||||
|
||||
@@ -21,13 +21,11 @@ app: hdfs_datanode
|
||||
name:
|
||||
zh-CN: Apache HDFS DataNode
|
||||
en-US: Apache HDFS DataNode
|
||||
ja-JP: Apache HDFS DataNode
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: Hertzbeat 对 HDFS DataNode 节点监控指标进行监控。<br>您可以点击 “<i>新建 Apache HDFS DataNode</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: Hertzbeat monitors the HDFS DataNode metrics. <br>You can click "<i>New Apache HDFS DataNode</i>" to configure, or select "<i>More Actions</i>" to import an existing configuration.
|
||||
zh-TW: Hertzbeat 對 HDFS DataNode 節點監控指標進行監控。<br>您可以點擊 “<i>新建 Apache HDFS DataNode</i>” 並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
|
||||
ja-JP: Hertzbeat は HDFS DataNodeの一般的なメトリック監視します。<br>「<i>新規 Apache HDFS DataNode</i>」をクリックしてパラメタを設定した後、新規することができます。
|
||||
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/hdfs_datanode/
|
||||
@@ -40,7 +38,6 @@ params:
|
||||
name:
|
||||
zh-CN: 目标Host
|
||||
en-US: Target Host
|
||||
ja-JP: 目標ホスト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: host
|
||||
# required-true or false
|
||||
@@ -51,7 +48,6 @@ params:
|
||||
name:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -66,7 +62,6 @@ params:
|
||||
name:
|
||||
zh-CN: 查询超时时间
|
||||
en-US: Query Timeout
|
||||
ja-JP: クエリタイムアウト
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# required-true or false
|
||||
@@ -91,7 +86,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: DataNode HDFS使用量
|
||||
en-US: DfsUsed
|
||||
ja-JP: 使用済みのHDFS容量
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: Remaining
|
||||
type: 0
|
||||
@@ -99,7 +93,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: DataNode HDFS剩余空间
|
||||
en-US: Remaining
|
||||
ja-JP: 使用可能のHDFS容量
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: Capacity
|
||||
type: 0
|
||||
@@ -107,7 +100,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: DataNode HDFS空间总量
|
||||
en-US: Capacity
|
||||
ja-JP: HDFS容量合計
|
||||
units:
|
||||
- DfsUsed=B->GB
|
||||
- Remaining=B->GB
|
||||
@@ -142,70 +134,60 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: JVM 当前已经使用的 NonHeapMemory 的大小
|
||||
en-US: MemNonHeapUsedM
|
||||
ja-JP: 使用済みのノンヒープメモリサイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: MemNonHeapCommittedM
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM 配置的 NonHeapCommittedM 的大小
|
||||
en-US: MemNonHeapCommittedM
|
||||
ja-JP: コミットのノンヒープメモリサイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: MemHeapUsedM
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM 当前已经使用的 HeapMemory 的大小
|
||||
en-US: MemHeapUsedM
|
||||
ja-JP: 使用済みのヒープメモリサイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: MemHeapCommittedM
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM HeapMemory 提交大小
|
||||
en-US: MemHeapCommittedM
|
||||
ja-JP: コミットのヒープメモリサイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: MemHeapMaxM
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM 配置的 HeapMemory 的大小
|
||||
en-US: MemHeapMaxM
|
||||
ja-JP: 配置のヒープメモリサイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: MemMaxM
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM 运行时可以使用的最大内存大小
|
||||
en-US: MemMaxM
|
||||
ja-JP: 最大のヒープメモリサイズ
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: ThreadsRunnable
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 处于 RUNNABLE 状态的线程数量
|
||||
en-US: ThreadsRunnable
|
||||
ja-JP: RUNNABLE スレッド数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: ThreadsBlocked
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 处于 BLOCKED 状态的线程数量
|
||||
en-US: ThreadsBlocked
|
||||
ja-JP: BLOCKED スレッド数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: ThreadsWaiting
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 处于 WAITING 状态的线程数量
|
||||
en-US: ThreadsWaiting
|
||||
ja-JP: WAITING スレッド数
|
||||
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
|
||||
- field: ThreadsTimedWaiting
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 处于 TIMED WAITING 状态的线程数量
|
||||
en-US: ThreadsTimedWaiting
|
||||
ja-JP: TIMED WAITING スレッド数
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- $.MemNonHeapUsedM
|
||||
@@ -250,7 +232,6 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 启动时间
|
||||
en-US: StartTime
|
||||
ja-JP: 起動時間
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- $.beans[?(@.name == "java.lang:type=Runtime")].StartTime
|
||||
|
||||
@@ -33,76 +33,6 @@ params:
|
||||
type: text
|
||||
# required-true or false
|
||||
required: true
|
||||
# field-param field key
|
||||
- field: __sd_authType__
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 认证方式
|
||||
en-US: Auth Type
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: radio
|
||||
# required-true or false
|
||||
required: false
|
||||
# when type is radio checkbox, use option to show optional values {name1:value1,name2:value2}
|
||||
options:
|
||||
- label: Bearer Token
|
||||
value: Bearer Token
|
||||
- label: Basic Auth
|
||||
value: Basic Auth
|
||||
- label: Digest Auth
|
||||
value: Digest Auth
|
||||
# field-param field key
|
||||
- field: __sd_token__
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 认证Token
|
||||
en-US: Access Token
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# dependent parameter values list
|
||||
depend:
|
||||
__sd_authType__:
|
||||
- Bearer Token
|
||||
# required-true or false
|
||||
required: false
|
||||
# hide param-true or false
|
||||
hide: true
|
||||
# field-param field key
|
||||
- field: __sd_username__
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 用户名
|
||||
en-US: Username
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: text
|
||||
# when type is text, use limit to limit string length
|
||||
limit: 50
|
||||
# dependent parameter values list
|
||||
depend:
|
||||
__sd_authType__:
|
||||
- Basic Auth
|
||||
- Digest Auth
|
||||
# required-true or false
|
||||
required: false
|
||||
# hide param-true or false
|
||||
hide: true
|
||||
# field-param field key
|
||||
- field: __sd_password__
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 密码
|
||||
en-US: Password
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: password
|
||||
# dependent parameter values list
|
||||
depend:
|
||||
__sd_authType__:
|
||||
- Basic Auth
|
||||
- Digest Auth
|
||||
# required-true or false
|
||||
required: false
|
||||
# hide param-true or false
|
||||
hide: true
|
||||
|
||||
metrics:
|
||||
- name: target
|
||||
@@ -129,18 +59,4 @@ metrics:
|
||||
protocol: http_sd
|
||||
# the config content when protocol is http_sd
|
||||
http_sd:
|
||||
# http url
|
||||
url: ^_^__sd_url__^_^
|
||||
# http method: GET POST PUT DELETE PATCH
|
||||
method: GET
|
||||
# http auth
|
||||
authorization:
|
||||
# http auth type: Basic Auth, Digest Auth, Bearer Token
|
||||
type: ^_^__sd_authType__^_^
|
||||
bearerTokenToken: ^_^__sd_token__^_^
|
||||
basicAuthUsername: ^_^__sd_username__^_^
|
||||
basicAuthPassword: ^_^__sd_password__^_^
|
||||
digestAuthUsername: ^_^__sd_username__^_^
|
||||
digestAuthPassword: ^_^__sd_password__^_^
|
||||
# http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, prometheus-prometheus exporter rule
|
||||
parseType: default
|
||||
|
||||
@@ -46,8 +46,8 @@ import org.apache.hertzbeat.common.support.SpringContextHolder;
|
||||
import org.apache.hertzbeat.alert.service.impl.TencentSmsClientImpl;
|
||||
import org.apache.hertzbeat.warehouse.WarehouseWorkerPool;
|
||||
import org.apache.hertzbeat.warehouse.controller.MetricsDataController;
|
||||
import org.apache.hertzbeat.warehouse.store.history.tsdb.iotdb.IotDbDataStorage;
|
||||
import org.apache.hertzbeat.warehouse.store.history.tsdb.tdengine.TdEngineDataStorage;
|
||||
import org.apache.hertzbeat.warehouse.store.history.iotdb.IotDbDataStorage;
|
||||
import org.apache.hertzbeat.warehouse.store.history.tdengine.TdEngineDataStorage;
|
||||
import org.apache.hertzbeat.warehouse.store.realtime.memory.MemoryDataStorage;
|
||||
import org.apache.hertzbeat.warehouse.store.realtime.redis.RedisDataStorage;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
+19
-23
@@ -17,8 +17,22 @@
|
||||
|
||||
package org.apache.hertzbeat.manager.service;
|
||||
|
||||
import org.apache.hertzbeat.common.entity.manager.Bulletin;
|
||||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.hertzbeat.common.entity.manager.Monitor;
|
||||
import org.apache.hertzbeat.common.entity.manager.Bulletin;
|
||||
import org.apache.hertzbeat.manager.pojo.dto.BulletinMetricsData;
|
||||
import org.apache.hertzbeat.manager.dao.BulletinDao;
|
||||
import org.apache.hertzbeat.manager.service.impl.BulletinServiceImpl;
|
||||
import org.apache.hertzbeat.warehouse.store.realtime.RealTimeDataReader;
|
||||
@@ -32,21 +46,6 @@ import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* Test case for {@link BulletinService}
|
||||
*/
|
||||
@@ -146,17 +145,14 @@ public class BulletinServiceTest {
|
||||
fields.put("1", List.of("1", "2"));
|
||||
bulletin.setFields(fields);
|
||||
|
||||
BulletinMetricsData.BulletinMetricsDataBuilder contentBuilder = BulletinMetricsData.builder();
|
||||
|
||||
Monitor monitor = new Monitor();
|
||||
|
||||
when(bulletinDao.findById(any(Long.class))).thenReturn(java.util.Optional.of(bulletin));
|
||||
when(realTimeDataReader.getCurrentMetricsData(any(), any(String.class))).thenReturn(null);
|
||||
|
||||
when(monitorService.getMonitor(any(Long.class))).thenReturn(null);
|
||||
assertTrue(bulletinService.buildBulletinMetricsData(any(Long.class)).getContent().isEmpty());
|
||||
|
||||
when(monitorService.getMonitor(1L)).thenReturn(monitor);
|
||||
assertFalse(bulletinService.buildBulletinMetricsData(2L).getContent().isEmpty());
|
||||
|
||||
when(monitorService.getMonitor(any(Long.class))).thenReturn(monitor);
|
||||
assertNotNull(bulletinService.buildBulletinMetricsData(any(Long.class)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ package org.apache.hertzbeat.otel.config;
|
||||
|
||||
import org.apache.hertzbeat.common.constants.ConfigConstants;
|
||||
import org.apache.hertzbeat.common.constants.SignConstants;
|
||||
import org.apache.hertzbeat.warehouse.store.history.tsdb.greptime.GreptimeProperties;
|
||||
import org.apache.hertzbeat.warehouse.store.history.greptime.GreptimeProperties;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
|
||||
+12
-20
@@ -36,7 +36,7 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.hertzbeat.warehouse.store.history.tsdb.greptime.GreptimeProperties;
|
||||
import org.apache.hertzbeat.warehouse.store.history.greptime.GreptimeProperties;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -98,37 +98,29 @@ public class OpenTelemetryConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides default OpenTelemetry configuration that always executes.
|
||||
* Provides an AutoConfigurationCustomizerProvider to tailor the auto-configured OpenTelemetry SDK.
|
||||
* This includes setting up GrepTimeDB exporters for logs and traces, and customizing the resource.
|
||||
* Active only if 'greptime.enabled' is true.
|
||||
*
|
||||
* @param greptimeProperties Configuration for GrepTimeDB.
|
||||
* @return AutoConfigurationCustomizerProvider instance.
|
||||
*/
|
||||
@Bean
|
||||
public AutoConfigurationCustomizerProvider defaultOtelCustomizer() {
|
||||
log.info("Applying default OpenTelemetry SDK customizations.");
|
||||
@ConditionalOnProperty(name = "warehouse.store.greptime.enabled", havingValue = "true")
|
||||
public AutoConfigurationCustomizerProvider greptimeOtelCustomizer(GreptimeProperties greptimeProperties) {
|
||||
log.info("GreptimeDB is enabled. Applying OpenTelemetry SDK customizations.");
|
||||
|
||||
return providerCustomizer -> providerCustomizer
|
||||
.addPropertiesCustomizer(sdkConfigProperties -> {
|
||||
Map<String, String> newProperties = new HashMap<>();
|
||||
newProperties.put("otel.metrics.exporter", "none");
|
||||
newProperties.put("otel.traces.exporter", "none");
|
||||
newProperties.put("otel.traces.exporter", "otlp");
|
||||
newProperties.put("otel.logs.exporter", "none");
|
||||
return newProperties;
|
||||
})
|
||||
.addResourceCustomizer((resource, configProperties) -> {
|
||||
log.info("Customizing auto-configured OpenTelemetry Resource with service name: {}.", HERTZBEAT_SERVICE_NAME);
|
||||
return resource.merge(Resource.builder().put(SERVICE_NAME, HERTZBEAT_SERVICE_NAME).build());
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides GrepTimeDB-specific OpenTelemetry configuration when enabled.
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnProperty(name = "warehouse.store.greptime.enabled", havingValue = "true")
|
||||
public AutoConfigurationCustomizerProvider greptimeOtelCustomizer(GreptimeProperties greptimeProperties) {
|
||||
log.info("GreptimeDB is enabled. Applying additional OpenTelemetry SDK customizations for GrepTimeDB.");
|
||||
return providerCustomizer -> providerCustomizer
|
||||
.addPropertiesCustomizer(sdkConfigProperties -> {
|
||||
Map<String, String> newProperties = new HashMap<>();
|
||||
newProperties.put("otel.traces.exporter", "otlp");
|
||||
return newProperties;
|
||||
})
|
||||
.addSpanExporterCustomizer((originalSpanExporter, configProperties) -> {
|
||||
String traceEndpoint = greptimeProperties.httpEndpoint() + "/v1/otlp/v1/traces";
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ package org.apache.hertzbeat.warehouse.db;
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.hertzbeat.warehouse.store.history.tsdb.greptime.GreptimeProperties;
|
||||
import org.apache.hertzbeat.warehouse.store.history.greptime.GreptimeProperties;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import org.apache.hertzbeat.common.util.TimePeriodUtil;
|
||||
import static org.apache.hertzbeat.warehouse.constants.WarehouseConstants.INSTANT;
|
||||
import static org.apache.hertzbeat.warehouse.constants.WarehouseConstants.PROMQL;
|
||||
import static org.apache.hertzbeat.warehouse.constants.WarehouseConstants.RANGE;
|
||||
import org.apache.hertzbeat.warehouse.store.history.tsdb.vm.PromQlQueryContent;
|
||||
import org.apache.hertzbeat.warehouse.store.history.vm.PromQlQueryContent;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ package org.apache.hertzbeat.warehouse.db;
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.hertzbeat.warehouse.store.history.tsdb.vm.VictoriaMetricsProperties;
|
||||
import org.apache.hertzbeat.warehouse.store.history.vm.VictoriaMetricsProperties;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ package org.apache.hertzbeat.warehouse.listener;
|
||||
|
||||
import java.util.Optional;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.hertzbeat.warehouse.store.history.tsdb.AbstractHistoryDataStorage;
|
||||
import org.apache.hertzbeat.warehouse.store.history.AbstractHistoryDataStorage;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user