mirror of
https://github.com/dromara/hertzbeat.git
synced 2026-09-17 18:19:02 +00:00
Compare commits
28
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a22023a663 | ||
|
|
4e841a9fb1 | ||
|
|
b7ecb9b2ec | ||
|
|
7e1873bc10 | ||
|
|
8eb60210a3 | ||
|
|
d608f732f7 | ||
|
|
2d9a2955ef | ||
|
|
cae4423f30 | ||
|
|
d40d130dc6 | ||
|
|
65a522ea9b | ||
|
|
f0e53a9fb3 | ||
|
|
79da1a198b | ||
|
|
64cb804147 | ||
|
|
344cb25229 | ||
|
|
3ef635c977 | ||
|
|
14b53fc1f4 | ||
|
|
74d21a7acd | ||
|
|
330387734f | ||
|
|
7af77c9b86 | ||
|
|
0be1f2d1ef | ||
|
|
87e6dae115 | ||
|
|
1c45cfe14e | ||
|
|
f315bf9607 | ||
|
|
810d54bef5 | ||
|
|
48eafa1382 | ||
|
|
4b6c1e0f08 | ||
|
|
edfd857030 | ||
|
|
408a06d3eb |
@@ -16,7 +16,7 @@
|
||||
#
|
||||
|
||||
github:
|
||||
description: Apache HertzBeat(incubating) is a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities.
|
||||
description: Real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities.
|
||||
homepage: https://hertzbeat.apache.org/
|
||||
labels:
|
||||
- monitoring
|
||||
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
Apache HertzBeat (incubating) is an effort undergoing incubation at the Apache
|
||||
Software Foundation (ASF), sponsored by the Apache Incubator PMC.
|
||||
|
||||
Incubation is required of all newly accepted projects until a further review
|
||||
indicates that the infrastructure, communications, and decision making process
|
||||
have stabilized in a manner consistent with other successful ASF projects.
|
||||
|
||||
While incubation status is not necessarily a reflection of the completeness
|
||||
or stability of the code, it does indicate that the project has yet to be
|
||||
fully endorsed by the ASF.
|
||||
@@ -1,4 +1,4 @@
|
||||
Apache HertzBeat (incubating)
|
||||
Apache HertzBeat
|
||||
Copyright 2024-2025 The Apache Software Foundation
|
||||
|
||||
This product includes software developed at
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
## 🎡 <font color="green">Introduction</font>
|
||||
|
||||
[Apache HertzBeat](https://github.com/apache/hertzbeat) (incubating) is an easy-to-use, open source, real-time monitoring system with agentless, high performance cluster, prometheus-compatible, offers powerful custom monitoring and status page building capabilities.
|
||||
[Apache HertzBeat](https://github.com/apache/hertzbeat) is an easy-to-use, open source, real-time monitoring system with agentless, high performance cluster, prometheus-compatible, offers powerful custom monitoring and status page building capabilities.
|
||||
|
||||
### Features
|
||||
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
|
||||
## 🎡 <font color="green">介绍</font>
|
||||
|
||||
[Apache HertzBeat](https://github.com/apache/hertzbeat) (incubating)是一个易用友好的开源实时监控告警系统,无需 Agent,高性能集群,兼容 Prometheus,提供强大的自定义监控和状态页构建能力。
|
||||
[Apache HertzBeat](https://github.com/apache/hertzbeat) 是一个易用友好的开源实时监控告警系统,无需 Agent,高性能集群,兼容 Prometheus,提供强大的自定义监控和状态页构建能力。
|
||||
|
||||
### 特点
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.hertzbeat</groupId>
|
||||
<artifactId>hertzbeat</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>hertzbeat-ai-agent</artifactId>
|
||||
<version>${hertzbeat.version}</version>
|
||||
<properties>
|
||||
<spring-ai.version>1.0.1</spring-ai.version>
|
||||
<java.version>17</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-starter-mcp-server-webmvc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.platform</groupId>
|
||||
<artifactId>junit-platform-launcher</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-starter-model-openai</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.hertzbeat</groupId>
|
||||
<artifactId>hertzbeat-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.usthe.sureness</groupId>
|
||||
<artifactId>spring-boot3-starter-sureness</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-bom</artifactId>
|
||||
<version>${spring-ai.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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.ai.agent.adapters;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.apache.hertzbeat.common.entity.manager.Monitor;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Interface that provides access to monitor information by retrieving monitor data
|
||||
* through the underlying monitor service.
|
||||
*/
|
||||
public interface MonitorServiceAdapter {
|
||||
Page<Monitor> getMonitors(
|
||||
List<Long> ids,
|
||||
String app,
|
||||
String search,
|
||||
Byte status,
|
||||
String sort,
|
||||
String order,
|
||||
Integer pageIndex,
|
||||
Integer pageSize,
|
||||
String labels
|
||||
);
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* 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.ai.agent.adapters.impl;
|
||||
|
||||
import com.usthe.sureness.subject.SubjectSum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.hertzbeat.ai.agent.adapters.MonitorServiceAdapter;
|
||||
import org.apache.hertzbeat.ai.agent.config.McpContextHolder;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.apache.hertzbeat.common.entity.manager.Monitor;
|
||||
import org.apache.hertzbeat.common.support.SpringContextHolder;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Implementation of the MonitorServiceAdapter interface that provides access to monitor information
|
||||
* through reflection by invoking the underlying monitor service implementation.
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class MonitorServiceAdapterImpl implements MonitorServiceAdapter {
|
||||
|
||||
@Override
|
||||
public Page<Monitor> getMonitors(
|
||||
List<Long> ids,
|
||||
String app,
|
||||
String search,
|
||||
Byte status,
|
||||
String sort,
|
||||
String order,
|
||||
Integer pageIndex,
|
||||
Integer pageSize,
|
||||
String labels) {
|
||||
try {
|
||||
// Provide default values for all nullable parameters
|
||||
if (sort == null || sort.trim().isEmpty()) {
|
||||
sort = "gmtCreate";
|
||||
}
|
||||
if (order == null || order.trim().isEmpty()) {
|
||||
order = "desc";
|
||||
}
|
||||
if (pageIndex == null) {
|
||||
pageIndex = 0;
|
||||
}
|
||||
if (pageSize == null) {
|
||||
pageSize = 8;
|
||||
}
|
||||
|
||||
Object monitorService = null;
|
||||
SubjectSum subjectSum = McpContextHolder.getSubject();
|
||||
log.debug("Current security subject: {}", subjectSum);
|
||||
|
||||
try {
|
||||
monitorService = SpringContextHolder.getBean("monitorServiceImpl");
|
||||
} catch (Exception e) {
|
||||
log.debug("Could not find bean by name 'monitorServiceImpl', trying by class name");
|
||||
}
|
||||
|
||||
assert monitorService != null;
|
||||
log.debug("MonitorService bean found: {}", monitorService.getClass().getSimpleName());
|
||||
Method method = monitorService.getClass().getMethod(
|
||||
"getMonitors",
|
||||
List.class, String.class, String.class, Byte.class,
|
||||
String.class, String.class, int.class, int.class, String.class);
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Page<Monitor> result = (Page<Monitor>) method.invoke(
|
||||
monitorService,
|
||||
ids, app, search, status, sort, order, pageIndex, pageSize, labels);
|
||||
log.debug("MonitorServiceAdapter.getMonitors result: {}", result.getContent());
|
||||
return result;
|
||||
|
||||
} catch (NoSuchMethodException e) {
|
||||
throw new RuntimeException("Method not found: getMonitors", e);
|
||||
} catch (Exception e) {
|
||||
log.debug("Failed to invoke getMonitors via adapter", e);
|
||||
throw new RuntimeException("Failed to invoke getMonitors via adapter", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+246
@@ -0,0 +1,246 @@
|
||||
/*
|
||||
* 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.ai.agent.config;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.usthe.sureness.mgt.SurenessSecurityManager;
|
||||
import com.usthe.sureness.subject.SubjectSum;
|
||||
import io.modelcontextprotocol.spec.McpError;
|
||||
import io.modelcontextprotocol.spec.McpSchema;
|
||||
import io.modelcontextprotocol.spec.McpServerSession;
|
||||
import io.modelcontextprotocol.spec.McpServerTransport;
|
||||
import io.modelcontextprotocol.spec.McpServerTransportProvider;
|
||||
import io.modelcontextprotocol.util.Assert;
|
||||
import java.io.IOException;
|
||||
import java.time.Duration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.servlet.function.RouterFunction;
|
||||
import org.springframework.web.servlet.function.RouterFunctions;
|
||||
import org.springframework.web.servlet.function.ServerRequest;
|
||||
import org.springframework.web.servlet.function.ServerResponse;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* Custom Server-Sent Events transport provider for Model Context Protocol.
|
||||
*/
|
||||
@Slf4j
|
||||
public class CustomSseServerTransport implements McpServerTransportProvider {
|
||||
private final ObjectMapper objectMapper;
|
||||
private final String messageEndpoint;
|
||||
private final String sseEndpoint;
|
||||
private final String baseUrl;
|
||||
@Getter
|
||||
private final RouterFunction<ServerResponse> routerFunction;
|
||||
@Setter
|
||||
private McpServerSession.Factory sessionFactory;
|
||||
private final Map<String, Object> sessionRequest = new HashMap<>();
|
||||
private final ConcurrentHashMap<String, McpServerSession> sessions;
|
||||
private volatile boolean isClosing;
|
||||
|
||||
public CustomSseServerTransport(ObjectMapper objectMapper, String messageEndpoint) {
|
||||
this(objectMapper, messageEndpoint, "/sse");
|
||||
}
|
||||
|
||||
|
||||
public CustomSseServerTransport(ObjectMapper objectMapper, String messageEndpoint, String sseEndpoint) {
|
||||
this(objectMapper, "", messageEndpoint, sseEndpoint);
|
||||
}
|
||||
|
||||
public CustomSseServerTransport(ObjectMapper objectMapper, String baseUrl, String messageEndpoint, String sseEndpoint) {
|
||||
this.sessions = new ConcurrentHashMap();
|
||||
this.isClosing = false;
|
||||
Assert.notNull(objectMapper, "ObjectMapper must not be null");
|
||||
Assert.notNull(baseUrl, "Message base URL must not be null");
|
||||
Assert.notNull(messageEndpoint, "Message endpoint must not be null");
|
||||
Assert.notNull(sseEndpoint, "SSE endpoint must not be null");
|
||||
this.objectMapper = objectMapper;
|
||||
this.baseUrl = baseUrl;
|
||||
this.messageEndpoint = messageEndpoint;
|
||||
this.sseEndpoint = sseEndpoint;
|
||||
this.routerFunction = RouterFunctions.route().GET(this.sseEndpoint, this::handleSseConnection).POST(this.messageEndpoint, this::handleMessage).build();
|
||||
}
|
||||
|
||||
public Mono<Void> notifyClients(String method, Object params) {
|
||||
if (this.sessions.isEmpty()) {
|
||||
log.debug("No active sessions to broadcast message to");
|
||||
return Mono.empty();
|
||||
} else {
|
||||
log.debug("Attempting to broadcast message to {} active sessions", this.sessions.size());
|
||||
return Flux.fromIterable(this.sessions.values())
|
||||
.flatMap((session) -> session.sendNotification(method, params)
|
||||
.doOnError((e) -> log.error("Failed to send message to session {}: {}", session.getId(), e.getMessage()))
|
||||
.onErrorComplete())
|
||||
.then();
|
||||
}
|
||||
}
|
||||
|
||||
public Mono<Void> closeGracefully() {
|
||||
return Flux.fromIterable(this.sessions.values()).doFirst(() -> {
|
||||
this.isClosing = true;
|
||||
log.debug("Initiating graceful shutdown with {} active sessions", this.sessions.size());
|
||||
}).flatMap(McpServerSession::closeGracefully).then().doOnSuccess((v) -> log.debug("Graceful shutdown completed"));
|
||||
}
|
||||
|
||||
private ServerResponse handleSseConnection(ServerRequest request) {
|
||||
log.debug("Handling SSE connection for request: {}", request);
|
||||
HttpServletRequest servletRequest = request.servletRequest();
|
||||
|
||||
try {
|
||||
|
||||
log.debug("Processing SSE connection for servlet request: {}", servletRequest);
|
||||
log.debug("Authorization header: {}", servletRequest.getHeader("Authorization"));
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("Authentication failed for SSE connection: {}", e.getMessage());
|
||||
return ServerResponse.status(HttpStatus.UNAUTHORIZED).body("Unauthorized: " + e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (this.isClosing) {
|
||||
return ServerResponse.status(HttpStatus.SERVICE_UNAVAILABLE).body("Server is shutting down");
|
||||
} else {
|
||||
String sessionId = UUID.randomUUID().toString();
|
||||
log.debug("Generated session ID for SSE connection: {}", sessionId);
|
||||
log.debug("Creating new SSE connection for session: {}", sessionId);
|
||||
|
||||
|
||||
return ServerResponse.sse((sseBuilder) -> {
|
||||
sseBuilder.onComplete(() -> {
|
||||
log.debug("SSE connection completed for session: {}", sessionId);
|
||||
this.sessions.remove(sessionId);
|
||||
});
|
||||
sseBuilder.onTimeout(() -> {
|
||||
log.debug("SSE connection timed out for session: {}", sessionId);
|
||||
this.sessions.remove(sessionId);
|
||||
});
|
||||
CustomSseServerTransport.WebMvcMcpSessionTransport sessionTransport = new CustomSseServerTransport.WebMvcMcpSessionTransport(sessionId, sseBuilder);
|
||||
McpServerSession session = this.sessionFactory.create(sessionTransport);
|
||||
this.sessionRequest.put(sessionId, request.servletRequest());
|
||||
this.sessions.put(sessionId, session);
|
||||
|
||||
try {
|
||||
sseBuilder.id(sessionId).event("endpoint").data(this.baseUrl + this.messageEndpoint + "?sessionId=" + sessionId);
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to send initial endpoint event: {}", e.getMessage());
|
||||
sseBuilder.error(e);
|
||||
}
|
||||
|
||||
}, Duration.ZERO);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private ServerResponse handleMessage(ServerRequest request) {
|
||||
if (this.isClosing) {
|
||||
return ServerResponse.status(HttpStatus.SERVICE_UNAVAILABLE).body("Server is shutting down");
|
||||
} else if (request.param("sessionId").isEmpty()) {
|
||||
return ServerResponse.badRequest().body(new McpError("Session ID missing in message endpoint"));
|
||||
} else {
|
||||
String sessionId = (String) request.param("sessionId").get();
|
||||
McpServerSession session = (McpServerSession) this.sessions.get(sessionId);
|
||||
log.debug("Authorization header for message request: {}", request.servletRequest().getHeader("Authorization"));
|
||||
SubjectSum subject = SurenessSecurityManager.getInstance().checkIn(sessionRequest.get(sessionId));
|
||||
McpContextHolder.setSubject(subject);
|
||||
|
||||
|
||||
if (session == null) {
|
||||
return ServerResponse.status(HttpStatus.NOT_FOUND).body(new McpError("Session not found: " + sessionId));
|
||||
} else {
|
||||
try {
|
||||
String body = request.body(String.class);
|
||||
McpSchema.JSONRPCMessage message = McpSchema.deserializeJsonRpcMessage(this.objectMapper, body);
|
||||
session.handle(message).block();
|
||||
return ServerResponse.ok().build();
|
||||
} catch (IOException | IllegalArgumentException e) {
|
||||
log.error("Failed to deserialize message: {}", ((Exception) e).getMessage());
|
||||
return ServerResponse.badRequest().body(new McpError("Invalid message format"));
|
||||
} catch (Exception e) {
|
||||
log.error("Error handling message: {}", e.getMessage());
|
||||
return ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR).body(new McpError(e.getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class WebMvcMcpSessionTransport implements McpServerTransport {
|
||||
private final String sessionId;
|
||||
private final ServerResponse.SseBuilder sseBuilder;
|
||||
|
||||
WebMvcMcpSessionTransport(String sessionId, ServerResponse.SseBuilder sseBuilder) {
|
||||
this.sessionId = sessionId;
|
||||
this.sseBuilder = sseBuilder;
|
||||
log.debug("Session transport {} initialized with SSE builder", sessionId);
|
||||
}
|
||||
|
||||
public Mono<Void> sendMessage(McpSchema.JSONRPCMessage message) {
|
||||
return Mono.fromRunnable(() -> {
|
||||
try {
|
||||
String jsonText = CustomSseServerTransport.this.objectMapper.writeValueAsString(message);
|
||||
this.sseBuilder.id(this.sessionId).event("message").data(jsonText);
|
||||
log.debug("Message sent to session {}", this.sessionId);
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to send message to session {}: {}", this.sessionId, e.getMessage());
|
||||
this.sseBuilder.error(e);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public <T> T unmarshalFrom(Object data, TypeReference<T> typeRef) {
|
||||
return (T) CustomSseServerTransport.this.objectMapper.convertValue(data, typeRef);
|
||||
}
|
||||
|
||||
public Mono<Void> closeGracefully() {
|
||||
return Mono.fromRunnable(() -> {
|
||||
log.debug("Closing session transport: {}", this.sessionId);
|
||||
|
||||
try {
|
||||
this.sseBuilder.complete();
|
||||
log.debug("Successfully completed SSE builder for session {}", this.sessionId);
|
||||
} catch (Exception e) {
|
||||
log.warn("Failed to complete SSE builder for session {}: {}", this.sessionId, e.getMessage());
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void close() {
|
||||
try {
|
||||
this.sseBuilder.complete();
|
||||
log.debug("Successfully completed SSE builder for session {}", this.sessionId);
|
||||
} catch (Exception e) {
|
||||
log.warn("Failed to complete SSE builder for session {}: {}", this.sessionId, e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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.ai.agent.config;
|
||||
|
||||
import org.springframework.ai.chat.client.ChatClient;
|
||||
import org.springframework.ai.openai.OpenAiChatModel;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* Configuration class for Large Language Model (LLM) settings.
|
||||
*/
|
||||
|
||||
@Configuration
|
||||
public class LlmConfig {
|
||||
@Bean
|
||||
public ChatClient openAiChatClient(OpenAiChatModel chatModel) {
|
||||
return ChatClient.create(chatModel);
|
||||
}
|
||||
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.ai.agent.config;
|
||||
|
||||
import com.usthe.sureness.subject.SubjectSum;
|
||||
import org.springframework.core.NamedInheritableThreadLocal;
|
||||
|
||||
/**
|
||||
* Context holder for AI agent security context.
|
||||
*/
|
||||
public final class McpContextHolder {
|
||||
private static final ThreadLocal<SubjectSum> subjectHolder =
|
||||
new NamedInheritableThreadLocal<>("MCP Security and User Identification Context");
|
||||
|
||||
private McpContextHolder() {}
|
||||
|
||||
/**
|
||||
* Attaches the user's context to the current thread.
|
||||
*/
|
||||
public static void setSubject(SubjectSum subject) {
|
||||
subjectHolder.set(subject);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the context from the current thread.
|
||||
*/
|
||||
public static SubjectSum getSubject() {
|
||||
return subjectHolder.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the context from the thread to prevent memory leaks.
|
||||
*/
|
||||
public static void clear() {
|
||||
subjectHolder.remove();
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.ai.agent.config;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Provider for system prompts used in the AI agent
|
||||
*/
|
||||
|
||||
@Component
|
||||
public class PromptProvider {
|
||||
/**
|
||||
* Static version of the HertzBeat monitoring prompt
|
||||
*/
|
||||
public static final String HERTZBEAT_MONITORING_PROMPT = """
|
||||
You are an AI assistant specialized in monitoring infrastructure and applications with HertzBeat.
|
||||
Your role is to help users manage and analyze their monitoring data using the available tools.
|
||||
You have access to the following HertzBeat monitoring tools:
|
||||
- list_monitors: Query monitor information with flexible filtering and pagination
|
||||
- add_monitor: Add a new monitor to the system
|
||||
When users ask questions about their monitoring setup or data, identify which tool would be most helpful
|
||||
and use it to provide relevant information. Always provide clear explanations of the monitoring data and
|
||||
suggest next steps or insights based on the results.
|
||||
For monitoring-related queries:
|
||||
1. If users want to see their monitors, use list_monitors with appropriate filters
|
||||
2. If users want to add a new monitor, use add_monitor with the necessary details
|
||||
3. If the monitoring information shows potential issues, highlight them and suggest troubleshooting steps
|
||||
For parameters that accept specific values:
|
||||
- Monitor status values: 0 (no monitor), 1 (usable), 2 (disabled), 9 (all)
|
||||
- Sort fields typically include: name, host, app, gmtCreate
|
||||
- Sort order should be 'asc' or 'desc'
|
||||
Keep responses focused on monitoring topics and HertzBeat capabilities.
|
||||
If you're unsure about specific monitoring details, ask clarifying questions before using the tools.
|
||||
""";
|
||||
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* 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.ai.agent.controller;
|
||||
|
||||
import org.springframework.ai.chat.client.ChatClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
import org.apache.hertzbeat.ai.agent.pojo.dto.ChatRequestContext;
|
||||
import org.apache.hertzbeat.ai.agent.service.ChatClientProviderService;
|
||||
|
||||
|
||||
/**
|
||||
* Controller class for handling chat-related HTTP requests.
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/chat")
|
||||
public class ChatController {
|
||||
|
||||
private final ChatClientProviderService chatClientProviderService;
|
||||
|
||||
@Autowired
|
||||
public ChatController(@Qualifier("openAiChatClient") ChatClient openAiChatClient,
|
||||
ChatClientProviderService chatClientProviderService) {
|
||||
this.chatClientProviderService = chatClientProviderService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a message and get a streaming response
|
||||
*
|
||||
* @param context The chat request context containing message and optional
|
||||
* conversationId
|
||||
* @return SSE emitter for streaming response
|
||||
*/
|
||||
@PostMapping(value = "/stream", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
|
||||
public SseEmitter streamChat(@RequestBody ChatRequestContext context) {
|
||||
SseEmitter emitter = new SseEmitter();
|
||||
new Thread(() -> {
|
||||
try {
|
||||
String aiResponse = chatClientProviderService.streamChat(context);
|
||||
emitter.send(aiResponse);
|
||||
emitter.complete();
|
||||
} catch (Exception e) {
|
||||
emitter.completeWithError(e);
|
||||
}
|
||||
}).start();
|
||||
return emitter;
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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.ai.agent.controller;
|
||||
|
||||
/**
|
||||
* Controller for managing conversations.
|
||||
*/
|
||||
public class ConversationController {
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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.ai.agent.dao;
|
||||
|
||||
/**
|
||||
* Data Access Object interface for Conversation entities.
|
||||
*/
|
||||
public interface ConversationDao {
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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.ai.agent.dao;
|
||||
|
||||
/**
|
||||
* Data Access Object interface for Message entities.
|
||||
*/
|
||||
public interface MessageDao {
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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.ai.agent.dao;
|
||||
|
||||
/**
|
||||
* Data Access Object interface for UserPreference entities.
|
||||
*/
|
||||
public interface UserPreferenceDao {
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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.ai.agent.pojo.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* Chat request context for AI chat endpoint.
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ChatRequestContext {
|
||||
/**
|
||||
* The user's message (required)
|
||||
*/
|
||||
private String message;
|
||||
/**
|
||||
* Optional conversation ID for context
|
||||
*/
|
||||
private String conversationId;
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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.ai.agent.service;
|
||||
|
||||
/**
|
||||
* Service interface for agent operations.
|
||||
*/
|
||||
public interface AgentService {
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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.ai.agent.service;
|
||||
|
||||
import org.apache.hertzbeat.ai.agent.pojo.dto.ChatRequestContext;
|
||||
|
||||
/**
|
||||
* Service for interacting with LLM providers (like OpenAI, Anthropic, etc.)
|
||||
*/
|
||||
public interface ChatClientProviderService {
|
||||
|
||||
String complete(String message);
|
||||
|
||||
String streamChat(ChatRequestContext context);
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* 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.ai.agent.service;
|
||||
|
||||
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Service for managing chat conversations and interactions with LLM providers.
|
||||
*/
|
||||
public interface ConversationService {
|
||||
|
||||
/**
|
||||
* Send a message and receive a streaming response
|
||||
*
|
||||
* @param message The user's message
|
||||
* @param conversationId Optional conversation ID for continuing a chat
|
||||
* @return SseEmitter for streaming the response
|
||||
*/
|
||||
SseEmitter streamChat(String message, String conversationId);
|
||||
|
||||
/**
|
||||
* Send a message and get a complete response
|
||||
*
|
||||
* @param message The user's message
|
||||
* @param conversationId Optional conversation ID for continuing a chat
|
||||
* @return Response object containing the AI's response and conversation metadata
|
||||
*/
|
||||
Map<String, Object> chat(String message, String conversationId);
|
||||
|
||||
/**
|
||||
* Get conversation history for a specific conversation
|
||||
*
|
||||
* @param conversationId Conversation ID
|
||||
* @return Conversation data including messages
|
||||
*/
|
||||
Map<String, Object> getConversation(String conversationId);
|
||||
|
||||
/**
|
||||
* Get all conversations for the current user
|
||||
*
|
||||
* @return List of conversations
|
||||
*/
|
||||
List<Map<String, Object>> getAllConversations();
|
||||
|
||||
/**
|
||||
* Delete a conversation
|
||||
*
|
||||
* @param conversationId Conversation ID to delete
|
||||
*/
|
||||
void deleteConversation(String conversationId);
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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.ai.agent.service;
|
||||
|
||||
import org.springframework.ai.tool.ToolCallbackProvider;
|
||||
|
||||
/**
|
||||
* Service interface for MCP server operations.
|
||||
*/
|
||||
public interface McpServerService {
|
||||
ToolCallbackProvider hertzbeatTools();
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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.ai.agent.service.impl;
|
||||
|
||||
import org.apache.hertzbeat.ai.agent.service.AgentService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* Implementation of the AgentService interface.
|
||||
* This service provides functionality for handling AI agent operations.
|
||||
*/
|
||||
@Service
|
||||
public class AgentServiceImpl implements AgentService {
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* 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.ai.agent.service.impl;
|
||||
|
||||
import org.apache.hertzbeat.ai.agent.config.PromptProvider;
|
||||
import org.apache.hertzbeat.ai.agent.service.ChatClientProviderService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.apache.hertzbeat.ai.agent.pojo.dto.ChatRequestContext;
|
||||
import org.springframework.ai.chat.client.ChatClient;
|
||||
import org.springframework.ai.tool.ToolCallbackProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
||||
/**
|
||||
* Implementation of the {@link ChatClientProviderService}.
|
||||
* Provides functionality to interact with the ChatClient for handling chat
|
||||
* messages.
|
||||
*/
|
||||
@Service
|
||||
public class ChatClientProviderServiceImpl implements ChatClientProviderService {
|
||||
|
||||
private final ChatClient chatClient;
|
||||
|
||||
@Qualifier("hertzbeatTools")
|
||||
@Autowired
|
||||
private ToolCallbackProvider toolCallbackProvider;
|
||||
|
||||
@Autowired
|
||||
public ChatClientProviderServiceImpl(@Qualifier("openAiChatClient") ChatClient openAiChatClient) {
|
||||
this.chatClient = openAiChatClient;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String complete(String message) {
|
||||
return this.chatClient.prompt()
|
||||
.user(message)
|
||||
.call()
|
||||
.content();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String streamChat(ChatRequestContext context) {
|
||||
try {
|
||||
return this.chatClient.prompt(PromptProvider.HERTZBEAT_MONITORING_PROMPT)
|
||||
.user(context.getMessage())
|
||||
.toolCallbacks(toolCallbackProvider)
|
||||
.call()
|
||||
.content();
|
||||
} catch (Exception e) {
|
||||
return "Error: " + e.getMessage();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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.ai.agent.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* Implementation of the ConversationService interface for managing chat conversations.
|
||||
*/
|
||||
@Service
|
||||
public class ConversationServiceImpl {
|
||||
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* 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.ai.agent.service.impl;
|
||||
|
||||
import org.apache.hertzbeat.ai.agent.config.CustomSseServerTransport;
|
||||
import org.apache.hertzbeat.ai.agent.service.McpServerService;
|
||||
import org.springframework.ai.mcp.server.autoconfigure.McpServerProperties;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.apache.hertzbeat.ai.agent.tools.impl.MonitorToolsImpl;
|
||||
import org.springframework.ai.tool.ToolCallbackProvider;
|
||||
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.web.servlet.function.RouterFunction;
|
||||
import org.springframework.web.servlet.function.ServerResponse;
|
||||
|
||||
/**
|
||||
* Implementation of the McpServerService interface.
|
||||
* This service provides functionality for handling MCP server operations.
|
||||
*/
|
||||
@Service
|
||||
@Configuration
|
||||
public class McpServerServiceImpl implements McpServerService {
|
||||
@Autowired
|
||||
private MonitorToolsImpl monitorTools;
|
||||
|
||||
@Bean
|
||||
public ToolCallbackProvider hertzbeatTools() {
|
||||
return MethodToolCallbackProvider.builder().toolObjects(monitorTools).build();
|
||||
}
|
||||
/**
|
||||
* Provides a custom SSE server transport for the MCP server.
|
||||
*
|
||||
* @param objectMapper the ObjectMapper instance for JSON serialization
|
||||
* @param serverProperties the properties for the MCP server configuration
|
||||
* @return a CustomSseServerTransport instance configured with the provided properties
|
||||
*/
|
||||
|
||||
@Bean
|
||||
public CustomSseServerTransport webMvcSseServerTransportProvider(
|
||||
ObjectMapper objectMapper,
|
||||
McpServerProperties serverProperties
|
||||
) {
|
||||
return new CustomSseServerTransport(
|
||||
objectMapper,
|
||||
serverProperties.getBaseUrl(),
|
||||
serverProperties.getSseMessageEndpoint(),
|
||||
serverProperties.getSseEndpoint()
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Provides the MCP server transport bean.
|
||||
*
|
||||
* @param transport the custom SSE server transport
|
||||
* @return the MCP server transport instance
|
||||
*/
|
||||
|
||||
@Primary
|
||||
@Bean
|
||||
public RouterFunction<ServerResponse> mvcMcpRouterFunction(CustomSseServerTransport transport) {
|
||||
return transport.getRouterFunction();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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.ai.agent.tools;
|
||||
|
||||
/**
|
||||
* Tools for alert operations
|
||||
*/
|
||||
public interface AlertTools {
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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.ai.agent.tools;
|
||||
|
||||
/**
|
||||
* Tools for metrics operations
|
||||
*/
|
||||
public interface MetricsTools {
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 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.ai.agent.tools;
|
||||
|
||||
import org.springframework.ai.chat.model.ToolContext;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Interface for Monitoring Tools
|
||||
*/
|
||||
public interface MonitorTools {
|
||||
|
||||
String addMonitor(String name, ToolContext context);
|
||||
|
||||
/**
|
||||
* Query monitor information with flexible filtering and pagination.
|
||||
* Supports filtering by monitor IDs, type, status, host, labels, sorting, and
|
||||
* pagination.
|
||||
* Returns results as plain JSON.
|
||||
*/
|
||||
String listMonitors(
|
||||
List<Long> ids,
|
||||
String app,
|
||||
Byte status,
|
||||
String search,
|
||||
String labels,
|
||||
String sort,
|
||||
String order,
|
||||
Integer pageIndex,
|
||||
Integer pageSize,
|
||||
ToolContext context);
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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.ai.agent.tools.impl;
|
||||
|
||||
/**
|
||||
* Implementation of Alert Tools functionality
|
||||
*/
|
||||
public class AlertToolsImpl {
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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.ai.agent.tools.impl;
|
||||
|
||||
/**
|
||||
* Implementation of Metrics Tools functionality
|
||||
*/
|
||||
public class MetricsToolsImpl {
|
||||
}
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* 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.ai.agent.tools.impl;
|
||||
|
||||
import com.usthe.sureness.subject.SubjectSum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.hertzbeat.ai.agent.adapters.MonitorServiceAdapter;
|
||||
import org.apache.hertzbeat.ai.agent.config.McpContextHolder;
|
||||
import org.springframework.ai.chat.model.ToolContext;
|
||||
import org.springframework.ai.tool.annotation.Tool;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.apache.hertzbeat.ai.agent.tools.MonitorTools;
|
||||
import org.springframework.ai.tool.annotation.ToolParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.apache.hertzbeat.common.entity.manager.Monitor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Implementation of Monitoring Tools functionality
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MonitorToolsImpl implements MonitorTools {
|
||||
|
||||
@Autowired
|
||||
private MonitorServiceAdapter monitorServiceAdapter;
|
||||
|
||||
|
||||
/**
|
||||
* Tool to query monitor information with flexible filtering and pagination.
|
||||
* Supports filtering by monitor IDs, type, status, host, labels, sorting, and
|
||||
* pagination.
|
||||
* Returns monitor names as string.
|
||||
*/
|
||||
@Override
|
||||
@Tool(name = "list_monitors", returnDirect = true, description = """
|
||||
Query monitor information with flexible filtering and pagination.
|
||||
Supports filtering by monitor IDs, type, status, host, labels, sorting, and pagination.
|
||||
Returns results as String. When no parameters are available, pass the default value as mentioned below. If the user doesn't provide any specific parameter, the default value will be used.
|
||||
""")
|
||||
public String listMonitors(
|
||||
@ToolParam(description = "List of monitor IDs to filter (default: empty list)", required = false) List<Long> ids,
|
||||
@ToolParam(description = "Monitor type, e.g., 'linux' (default: null)", required = false) String app,
|
||||
@ToolParam(description = "Monitor status (0: no monitor, 1: usable, 2: disabled, 9: all) (default: null)", required = false) Byte status,
|
||||
@ToolParam(description = "Fuzzy search for host or name (default: null)", required = false) String search,
|
||||
@ToolParam(description = "Monitor labels, e.g., 'env:prod,instance:22' (default: null)", required = false) String labels,
|
||||
@ToolParam(description = "Sort field, e.g., 'name' (default: gmtCreate)", required = false) String sort,
|
||||
@ToolParam(description = "Sort order, 'asc' or 'desc' (default: desc)", required = false) String order,
|
||||
@ToolParam(description = "Page index (default: 0)", required = false) Integer pageIndex,
|
||||
@ToolParam(description = "Page size (default: 8)", required = false) Integer pageSize,
|
||||
ToolContext context) {
|
||||
try {
|
||||
Page<Monitor> result = monitorServiceAdapter.getMonitors(ids, app, search, status, sort, order, pageIndex, pageSize, labels);
|
||||
log.debug("MonitorServiceAdapter.getMonitors result: {}", result);
|
||||
return result.getContent().stream().map(Monitor::getName).toList().toString();
|
||||
} catch (Exception e) {
|
||||
return "error is" + e.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Tool(name = "add_monitor", description = "Add a new monitor")
|
||||
public String addMonitor(@ToolParam(description = "Name of the monitor") String name, ToolContext context) {
|
||||
log.debug("Adding monitor with name: {}", name);
|
||||
SubjectSum subjectSum = McpContextHolder.getSubject();
|
||||
log.debug("Current subject in tool: {}", subjectSum);
|
||||
return "Monitor added: " + name;
|
||||
}
|
||||
|
||||
}
|
||||
+1
-5
@@ -128,11 +128,7 @@ public class DashboardService {
|
||||
? 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("^/", "") : "");
|
||||
String fullDashboardUrl = grafanaProperties.exposeUrl().replaceAll("/$", "") + relativeDashboardUrl;
|
||||
|
||||
grafanaDashboard.setUrl(fullDashboardUrl + KIOSK + REFRESH + INSTANCE + monitorId + useDatasource);
|
||||
|
||||
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* 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.grafana.service;
|
||||
|
||||
import org.apache.hertzbeat.common.entity.grafana.GrafanaDashboard;
|
||||
import org.apache.hertzbeat.grafana.config.GrafanaProperties;
|
||||
import org.apache.hertzbeat.grafana.dao.DashboardDao;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* Test case for {@link DashboardService}
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class DashboardServiceTest {
|
||||
|
||||
@Mock
|
||||
private ServiceAccountService serviceAccountService;
|
||||
|
||||
@Mock
|
||||
private DashboardDao dashboardDao;
|
||||
|
||||
@Mock
|
||||
private GrafanaProperties grafanaProperties;
|
||||
|
||||
@Mock
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
@Mock
|
||||
private DatasourceService datasourceService;
|
||||
|
||||
@InjectMocks
|
||||
private DashboardService dashboardService;
|
||||
|
||||
static final String GRAFANA_API_RESULT = "{"
|
||||
+ " \"folderUid\": \"\","
|
||||
+ " \"id\": 3,"
|
||||
+ " \"slug\": \"prometheus-dashboard\","
|
||||
+ " \"status\": \"success\","
|
||||
+ " \"uid\": \"5d7d89b0-b273-40fe-bb30-d652b82f47eb\","
|
||||
+ " \"url\": \"/d/5d7d89b0-b273-40fe-bb30-d652b82f47eb/prometheus-dashboard\","
|
||||
+ " \"version\": 3"
|
||||
+ "}";
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
when(datasourceService.getCurrentDatasourceName()).thenReturn("hertzbeat-vm-localhost-8428");
|
||||
when(grafanaProperties.enabled()).thenReturn(Boolean.TRUE);
|
||||
when(grafanaProperties.getPrefix()).thenReturn("");
|
||||
when(grafanaProperties.getUrl()).thenReturn("http://127.0.0.1:3000");
|
||||
when(grafanaProperties.exposeUrl()).thenReturn("http://127.0.0.1:3000");
|
||||
when(serviceAccountService.getToken()).thenReturn("test-token");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void testCreateOrUpdateDashboard() {
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>(GRAFANA_API_RESULT, HttpStatus.OK);
|
||||
|
||||
when(restTemplate.postForEntity(
|
||||
eq("http://127.0.0.1:3000/api/dashboards/db"), any(HttpEntity.class), eq(String.class)
|
||||
)).thenReturn(responseEntity);
|
||||
|
||||
ArgumentCaptor<GrafanaDashboard> dashboardCaptor = ArgumentCaptor.forClass(GrafanaDashboard.class);
|
||||
dashboardService.createOrUpdateDashboard("{\"id\":11}", 1L);
|
||||
verify(dashboardDao).save(dashboardCaptor.capture());
|
||||
|
||||
GrafanaDashboard savedDashboard = dashboardCaptor.getValue();
|
||||
assertNotNull(savedDashboard);
|
||||
assertNotNull(savedDashboard.getUrl());
|
||||
|
||||
String expectedBaseUrl = "http://127.0.0.1:3000/d/5d7d89b0-b273-40fe-bb30-d652b82f47eb";
|
||||
|
||||
// Verify that the URL begins with the expected base URL.
|
||||
assertTrue(savedDashboard.getUrl().startsWith(expectedBaseUrl), "URL should start with: " + expectedBaseUrl + ", but was: " + savedDashboard.getUrl());
|
||||
|
||||
assertTrue(savedDashboard.getUrl().contains("kiosk=tv"), "URL should contain kiosk parameter");
|
||||
assertTrue(savedDashboard.getUrl().contains("refresh=15s"), "URL should contain refresh parameter");
|
||||
assertTrue(savedDashboard.getUrl().contains("var-instance=1"), "URL should contain instance parameter");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCreateOrUpdateDashboardWithTrailingSlash() {
|
||||
when(grafanaProperties.exposeUrl()).thenReturn("http://127.0.0.1:3000/");
|
||||
|
||||
ResponseEntity<String> responseEntity = new ResponseEntity<>(GRAFANA_API_RESULT, HttpStatus.OK);
|
||||
|
||||
when(restTemplate.postForEntity(
|
||||
eq("http://127.0.0.1:3000/api/dashboards/db"), any(HttpEntity.class), eq(String.class)
|
||||
)).thenReturn(responseEntity);
|
||||
|
||||
ArgumentCaptor<GrafanaDashboard> dashboardCaptor = ArgumentCaptor.forClass(GrafanaDashboard.class);
|
||||
dashboardService.createOrUpdateDashboard("{\"id\":11}", 1L);
|
||||
verify(dashboardDao).save(dashboardCaptor.capture());
|
||||
|
||||
GrafanaDashboard savedDashboard = dashboardCaptor.getValue();
|
||||
assertNotNull(savedDashboard);
|
||||
assertNotNull(savedDashboard.getUrl());
|
||||
|
||||
String expectedBaseUrl = "http://127.0.0.1:3000/d/5d7d89b0-b273-40fe-bb30-d652b82f47eb";
|
||||
|
||||
// Verify that the URL begins with the expected base URL.
|
||||
assertTrue(savedDashboard.getUrl().startsWith(expectedBaseUrl), "URL should start with: " + expectedBaseUrl + ", but was: " + savedDashboard.getUrl());
|
||||
|
||||
assertTrue(savedDashboard.getUrl().contains("kiosk=tv"), "URL should contain kiosk parameter");
|
||||
assertTrue(savedDashboard.getUrl().contains("refresh=15s"), "URL should contain refresh parameter");
|
||||
assertTrue(savedDashboard.getUrl().contains("var-instance=1"), "URL should contain instance parameter");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -210,6 +210,11 @@
|
||||
<groupId>org.apache.arrow</groupId>
|
||||
<artifactId>arrow-memory-netty</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.hertzbeat</groupId>
|
||||
<artifactId>hertzbeat-ai-agent</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-registry-prometheus</artifactId>
|
||||
@@ -288,6 +293,21 @@
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>make-docker-zip</id>
|
||||
<!--Bound maven operation-->
|
||||
<phase>package</phase>
|
||||
<!--Run once-->
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>../dist</outputDirectory>
|
||||
<descriptors>
|
||||
<descriptor>../script/assembly/server/assembly-docker.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>make-docker-compose-script</id>
|
||||
<!--Bound maven operation-->
|
||||
|
||||
@@ -52,4 +52,4 @@ public class Manager {
|
||||
public void init() {
|
||||
System.setProperty("jdk.jndi.object.factoriesFilter", "!com.zaxxer.hikari.HikariJNDIFactory");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,33 @@ spring:
|
||||
name: ${HOSTNAME:@hertzbeat@}${PID}
|
||||
profiles:
|
||||
active: prod
|
||||
ai:
|
||||
mcp:
|
||||
server:
|
||||
enabled: true
|
||||
stdio: false
|
||||
name: sse-mcp-server
|
||||
version: 1.0.0
|
||||
resource-change-notification: true
|
||||
tool-change-notification: true
|
||||
prompt-change-notification: true
|
||||
sse-endpoint: /api/sse
|
||||
sse-message-endpoint: /api/mcp/message
|
||||
type: SYNC
|
||||
capabilities:
|
||||
tool: true
|
||||
resource: true
|
||||
prompt: true
|
||||
completion: true
|
||||
chat:
|
||||
client:
|
||||
enabled: false
|
||||
openai:
|
||||
api-key: OPENAI_API_KEY
|
||||
chat:
|
||||
options:
|
||||
model: gpt-4.1-nano-2025-04-14
|
||||
|
||||
mvc:
|
||||
static-path-pattern: /**
|
||||
jackson:
|
||||
@@ -38,6 +65,7 @@ spring:
|
||||
max-file-size: 100MB
|
||||
max-request-size: 100MB
|
||||
|
||||
|
||||
management:
|
||||
health:
|
||||
mail:
|
||||
|
||||
@@ -0,0 +1,619 @@
|
||||
# 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: bigdata
|
||||
# The monitoring type eg: linux windows tomcat mysql aws...
|
||||
app: dolphinscheduler
|
||||
# The monitoring i18n name
|
||||
name:
|
||||
zh-CN: Apache DolphinScheduler
|
||||
en-US: Apache DolphinScheduler
|
||||
ja-JP: Apache DolphinScheduler
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: Hertzbeat 对 Apache DolphinScheduler (支持v3.3.0或更高版本)通用指标进行测量监控。<br>您可以点击 “<i>新建 Apache DolphinScheduler</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: Hertzbeat measures and monitors the general metrics of Apache DolphinScheduler (support v3.3.0 or later).<br>You can click on “<i>Create New Apache DolphinScheduler</i>” to configure it, or select “<i>More Actions</i>” to import an existing configuration.
|
||||
ja-JP: Hertzbeat は Apache DolphinScheduler(v3.3.0+)の一般的なメトリクスを監視します。<br>「<i>新規 Apache DolphinScheduler</i>」をクリックしてパラメタを設定した後、新規することができます。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/dolphinscheduler
|
||||
en-US: https://hertzbeat.apache.org/docs/help/dolphinscheduler
|
||||
# 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: 目標ホスト
|
||||
# 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: ポート
|
||||
# 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: 12345
|
||||
# field-param field key
|
||||
- field: timeout
|
||||
# name-param field display i18n name
|
||||
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
|
||||
required: false
|
||||
# hide param-true or false
|
||||
hide: true
|
||||
# default value
|
||||
defaultValue: 6000
|
||||
# field-param field key
|
||||
- field: ssl
|
||||
# name-param field display i18n name
|
||||
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
|
||||
required: true
|
||||
- field: token
|
||||
# name-param field display i18n name
|
||||
name:
|
||||
zh-CN: 令牌
|
||||
en-US: Token
|
||||
ja-JP: トークン
|
||||
type: text
|
||||
limit: 100
|
||||
required: true
|
||||
|
||||
# collect metrics config list
|
||||
metrics:
|
||||
- name: master
|
||||
i18n:
|
||||
zh-CN: Master
|
||||
en-US: Master
|
||||
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
|
||||
# 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: host
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 主机地址
|
||||
en-US: Host
|
||||
ja-JP: ホスト
|
||||
- field: port
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
- field: serverStatus
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 状态
|
||||
en-US: Server Status
|
||||
ja-JP: サーバーステータス
|
||||
- field: processId
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 进程 ID
|
||||
en-US: Process Id
|
||||
ja-JP: プロセスID
|
||||
- field: runningTime
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 运行时间
|
||||
en-US: Up Time
|
||||
ja-JP: アップタイム
|
||||
- field: cpuUsage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 处理器使用量
|
||||
en-US: CPU Usage
|
||||
ja-JP: CPU使用率
|
||||
- field: memoryUsage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存使用量
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
- field: diskUsage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 磁盘使用量
|
||||
en-US: Disk Usage
|
||||
ja-JP: ディスク使用率
|
||||
- field: jvmCpuUsage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: JVM CPU 使用量
|
||||
en-US: JVM CPU Usage
|
||||
ja-JP: Java仮想マシンのCPU使用率
|
||||
- field: jvmMemoryUsage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: JVM 内存 使用量
|
||||
en-US: JVM Memory Usage
|
||||
ja-JP: Java仮想マシンのメモリ使用率
|
||||
- field: jvmHeapUsed
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM 已使用的堆内存大小
|
||||
en-US: JVM Heap Used
|
||||
ja-JP: Java仮想マシンが使用したヒープメモリのサイズ
|
||||
- field: jvmNonHeapUsed
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM 已使用的非堆内存大小
|
||||
en-US: JVM NonHeap Used
|
||||
ja-JP: Java仮想マシンが使用したノンヒープメモリのサイズ
|
||||
- field: jvmHeapMax
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM 配置的最大堆内存大小
|
||||
en-US: JVM Heap Max
|
||||
ja-JP: Java仮想マシンのヒープメモリの最大値
|
||||
- field: jvmNonHeapMax
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM 配置的最大非堆内存大小
|
||||
en-US: JVM NonHeap Max
|
||||
ja-JP: Java仮想マシンのノンヒープメモリの最大値
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- $.heartBeatInfo
|
||||
# mapping and conversion expressions, use these and aliasField above to calculate metrics value
|
||||
# eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime
|
||||
calculates:
|
||||
- host=json:apply($.heartBeatInfo).host
|
||||
- port=json:apply($.heartBeatInfo).port
|
||||
- serverStatus=json:apply($.heartBeatInfo).serverStatus
|
||||
- processId=json:apply($.heartBeatInfo).processId
|
||||
- runningTime=(now()-json:apply($.heartBeatInfo).startupTime)/86400000
|
||||
- cpuUsage=json:apply($.heartBeatInfo).cpuUsage * 100
|
||||
- memoryUsage=json:apply($.heartBeatInfo).memoryUsage * 100
|
||||
- diskUsage=json:apply($.heartBeatInfo).diskUsage * 100
|
||||
- jvmCpuUsage=json:apply($.heartBeatInfo).jvmCpuUsage
|
||||
- jvmMemoryUsage=json:apply($.heartBeatInfo).jvmMemoryUsage
|
||||
- jvmHeapUsed=json:apply($.heartBeatInfo).jvmHeapUsed
|
||||
- jvmNonHeapUsed=json:apply($.heartBeatInfo).jvmNonHeapUsed
|
||||
- jvmHeapMax=json:apply($.heartBeatInfo).jvmHeapMax
|
||||
- jvmNonHeapMax=json:apply($.heartBeatInfo).jvmNonHeapMax
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: http
|
||||
# the config content when protocol is http
|
||||
http:
|
||||
# http host: ipv4 ipv6 domain
|
||||
host: ^_^host^_^
|
||||
# http port
|
||||
port: ^_^port^_^
|
||||
# http url
|
||||
url: /dolphinscheduler/monitor/MASTER
|
||||
# http method: GET POST PUT DELETE PATCH
|
||||
method: GET
|
||||
# if enabled https
|
||||
ssl: ^_^ssl^_^
|
||||
# http request header content
|
||||
headers:
|
||||
token: ^_^token^_^
|
||||
# http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, prometheus-prometheus exporter rule
|
||||
parseType: jsonPath
|
||||
parseScript: '$.data[*]'
|
||||
|
||||
- name: worker
|
||||
i18n:
|
||||
zh-CN: Worker
|
||||
en-US: Worker
|
||||
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
|
||||
# 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: host
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 主机地址
|
||||
en-US: Host
|
||||
ja-JP: ホスト
|
||||
- field: port
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
- field: serverStatus
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 状态
|
||||
en-US: Server Status
|
||||
ja-JP: サーバーステータス
|
||||
- field: processId
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 进程 ID
|
||||
en-US: Process Id
|
||||
ja-JP: プロセスID
|
||||
- field: runningTime
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 运行时间
|
||||
en-US: Up Time
|
||||
ja-JP: アップタイム
|
||||
- field: cpuUsage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 处理器使用量
|
||||
en-US: CPU Usage
|
||||
ja-JP: CPU使用率
|
||||
- field: memoryUsage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存使用量
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
- field: diskUsage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 磁盘使用量
|
||||
en-US: Disk Usage
|
||||
ja-JP: ディスク使用率
|
||||
- field: jvmCpuUsage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: JVM CPU 使用量
|
||||
en-US: JVM CPU Usage
|
||||
ja-JP: Java仮想マシンのCPU使用率
|
||||
- field: jvmMemoryUsage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: JVM 内存 使用量
|
||||
en-US: JVM Memory Usage
|
||||
ja-JP: Java仮想マシンのメモリ使用率
|
||||
- field: jvmHeapUsed
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM 已使用的堆内存大小
|
||||
en-US: JVM Heap Used
|
||||
ja-JP: Java仮想マシンが使用したヒープメモリのサイズ
|
||||
- field: jvmNonHeapUsed
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM 已使用的非堆内存大小
|
||||
en-US: JVM NonHeap Used
|
||||
ja-JP: Java仮想マシンが使用したノンヒープメモリのサイズ
|
||||
- field: jvmHeapMax
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM 配置的最大堆内存大小
|
||||
en-US: JVM Heap Max
|
||||
ja-JP: Java仮想マシンのヒープメモリの最大値
|
||||
- field: jvmNonHeapMax
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM 配置的最大非堆内存大小
|
||||
en-US: JVM NonHeap Max
|
||||
ja-JP: Java仮想マシンのノンヒープメモリの最大値
|
||||
- field: workerHostWeight
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 权重
|
||||
en-US: Weight
|
||||
ja-JP: ウェイト
|
||||
- field: threadPoolUsage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 线程池使用量
|
||||
en-US: Thread Pool Usage
|
||||
ja-JP: スレッドプールの使用率
|
||||
- field: workerGroup
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Worker 组
|
||||
en-US: Worker Group
|
||||
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:
|
||||
- $.heartBeatInfo
|
||||
# mapping and conversion expressions, use these and aliasField above to calculate metrics value
|
||||
# eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime
|
||||
calculates:
|
||||
- host=json:apply($.heartBeatInfo).host
|
||||
- port=json:apply($.heartBeatInfo).port
|
||||
- serverStatus=json:apply($.heartBeatInfo).serverStatus
|
||||
- processId=json:apply($.heartBeatInfo).processId
|
||||
- runningTime=(now()-json:apply($.heartBeatInfo).startupTime)/86400000
|
||||
- cpuUsage=json:apply($.heartBeatInfo).cpuUsage * 100
|
||||
- memoryUsage=json:apply($.heartBeatInfo).memoryUsage * 100
|
||||
- diskUsage=json:apply($.heartBeatInfo).diskUsage * 100
|
||||
- jvmCpuUsage=json:apply($.heartBeatInfo).jvmCpuUsage
|
||||
- jvmMemoryUsage=json:apply($.heartBeatInfo).jvmMemoryUsage
|
||||
- jvmHeapUsed=json:apply($.heartBeatInfo).jvmHeapUsed
|
||||
- jvmNonHeapUsed=json:apply($.heartBeatInfo).jvmNonHeapUsed
|
||||
- jvmHeapMax=json:apply($.heartBeatInfo).jvmHeapMax
|
||||
- jvmNonHeapMax=json:apply($.heartBeatInfo).jvmNonHeapMax
|
||||
- workerHostWeight=json:apply($.heartBeatInfo).workerHostWeight
|
||||
- threadPoolUsage=json:apply($.heartBeatInfo).threadPoolUsage
|
||||
- workerGroup=json:apply($.heartBeatInfo).workerGroup
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: http
|
||||
# the config content when protocol is http
|
||||
http:
|
||||
# http host: ipv4 ipv6 domain
|
||||
host: ^_^host^_^
|
||||
# http port
|
||||
port: ^_^port^_^
|
||||
# http url
|
||||
url: /dolphinscheduler/monitor/WORKER
|
||||
# http method: GET POST PUT DELETE PATCH
|
||||
method: GET
|
||||
# if enabled https
|
||||
ssl: ^_^ssl^_^
|
||||
# http request header content
|
||||
headers:
|
||||
token: ^_^token^_^
|
||||
# http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, prometheus-prometheus exporter rule
|
||||
parseType: jsonPath
|
||||
parseScript: '$.data[*]'
|
||||
|
||||
- name: alert-server
|
||||
i18n:
|
||||
zh-CN: Alert Server
|
||||
en-US: Alert Server
|
||||
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
|
||||
# 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: host
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 主机地址
|
||||
en-US: Host
|
||||
ja-JP: ホスト
|
||||
- field: port
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 端口
|
||||
en-US: Port
|
||||
ja-JP: ポート
|
||||
- field: serverStatus
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 状态
|
||||
en-US: Server Status
|
||||
ja-JP: サーバーステータス
|
||||
- field: processId
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 进程 ID
|
||||
en-US: Process Id
|
||||
ja-JP: プロセスID
|
||||
- field: runningTime
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 运行时间
|
||||
en-US: Up Time
|
||||
ja-JP: アップタイム
|
||||
- field: cpuUsage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 处理器使用量
|
||||
en-US: CPU Usage
|
||||
ja-JP: CPU使用率
|
||||
- field: memoryUsage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 内存使用量
|
||||
en-US: Memory Usage
|
||||
ja-JP: メモリ使用率
|
||||
- field: diskUsage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: 磁盘使用量
|
||||
en-US: Disk Usage
|
||||
ja-JP: ディスク使用率
|
||||
- field: jvmCpuUsage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: JVM CPU 使用量
|
||||
en-US: JVM CPU Usage
|
||||
ja-JP: Java仮想マシンのCPU使用率
|
||||
- field: jvmMemoryUsage
|
||||
type: 0
|
||||
unit: '%'
|
||||
i18n:
|
||||
zh-CN: JVM 内存 使用量
|
||||
en-US: JVM Memory Usage
|
||||
ja-JP: Java仮想マシンのメモリ使用率
|
||||
- field: jvmHeapUsed
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM 已使用的堆内存大小
|
||||
en-US: JVM Heap Used
|
||||
ja-JP: Java仮想マシンが使用したヒープメモリのサイズ
|
||||
- field: jvmNonHeapUsed
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM 已使用的非堆内存大小
|
||||
en-US: JVM NonHeap Used
|
||||
ja-JP: Java仮想マシンが使用したノンヒープメモリのサイズ
|
||||
- field: jvmHeapMax
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM 配置的最大堆内存大小
|
||||
en-US: JVM Heap Max
|
||||
ja-JP: Java仮想マシンのヒープメモリの最大値
|
||||
- field: jvmNonHeapMax
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: JVM 配置的最大非堆内存大小
|
||||
en-US: JVM NonHeap Max
|
||||
ja-JP: Java仮想マシンのノンヒープメモリの最大値
|
||||
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
|
||||
aliasFields:
|
||||
- $.heartBeatInfo
|
||||
# mapping and conversion expressions, use these and aliasField above to calculate metrics value
|
||||
# eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime
|
||||
calculates:
|
||||
- host=json:apply($.heartBeatInfo).host
|
||||
- port=json:apply($.heartBeatInfo).port
|
||||
- serverStatus=json:apply($.heartBeatInfo).serverStatus
|
||||
- processId=json:apply($.heartBeatInfo).processId
|
||||
- runningTime=(now()-json:apply($.heartBeatInfo).startupTime)/86400000
|
||||
- cpuUsage=json:apply($.heartBeatInfo).cpuUsage * 100
|
||||
- memoryUsage=json:apply($.heartBeatInfo).memoryUsage * 100
|
||||
- diskUsage=json:apply($.heartBeatInfo).diskUsage * 100
|
||||
- jvmCpuUsage=json:apply($.heartBeatInfo).jvmCpuUsage
|
||||
- jvmMemoryUsage=json:apply($.heartBeatInfo).jvmMemoryUsage
|
||||
- jvmHeapUsed=json:apply($.heartBeatInfo).jvmHeapUsed
|
||||
- jvmNonHeapUsed=json:apply($.heartBeatInfo).jvmNonHeapUsed
|
||||
- jvmHeapMax=json:apply($.heartBeatInfo).jvmHeapMax
|
||||
- jvmNonHeapMax=json:apply($.heartBeatInfo).jvmNonHeapMax
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: http
|
||||
# the config content when protocol is http
|
||||
http:
|
||||
# http host: ipv4 ipv6 domain
|
||||
host: ^_^host^_^
|
||||
# http port
|
||||
port: ^_^port^_^
|
||||
# http url
|
||||
url: /dolphinscheduler/monitor/ALERT_SERVER
|
||||
# http method: GET POST PUT DELETE PATCH
|
||||
method: GET
|
||||
# if enabled https
|
||||
ssl: ^_^ssl^_^
|
||||
# http request header content
|
||||
headers:
|
||||
token: ^_^token^_^
|
||||
# http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, prometheus-prometheus exporter rule
|
||||
parseType: jsonPath
|
||||
parseScript: '$.data[*]'
|
||||
|
||||
- name: database
|
||||
i18n:
|
||||
zh-CN: 数据库
|
||||
en-US: Database
|
||||
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
|
||||
# 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: dbType
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 数据库类型
|
||||
en-US: Database Type
|
||||
ja-JP: データベースのタイプ
|
||||
- field: state
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 状态
|
||||
en-US: State
|
||||
ja-JP: 状態
|
||||
- field: maxConnections
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大连接数
|
||||
en-US: Max Connections
|
||||
ja-JP: 最大接続数
|
||||
- field: threadsConnections
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 当前连接数
|
||||
en-US: Threads Connections
|
||||
ja-JP: 現在接続数
|
||||
- field: threadsRunningConnections
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 当前活跃连接数
|
||||
en-US: Threads Running Connections
|
||||
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:
|
||||
- dbType
|
||||
- state
|
||||
- maxConnections
|
||||
- threadsConnections
|
||||
- threadsRunningConnections
|
||||
# mapping and conversion expressions, use these and aliasField above to calculate metrics value
|
||||
# eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime
|
||||
calculates:
|
||||
- dbType=dbType
|
||||
- state=state
|
||||
- maxConnections=maxConnections
|
||||
- threadsConnections=threadsConnections
|
||||
- threadsRunningConnections=threadsRunningConnections
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: http
|
||||
# the config content when protocol is http
|
||||
http:
|
||||
# http host: ipv4 ipv6 domain
|
||||
host: ^_^host^_^
|
||||
# http port
|
||||
port: ^_^port^_^
|
||||
# http url
|
||||
url: /dolphinscheduler/monitor/databases
|
||||
# http method: GET POST PUT DELETE PATCH
|
||||
method: GET
|
||||
# if enabled https
|
||||
ssl: ^_^ssl^_^
|
||||
# http request header content
|
||||
headers:
|
||||
token: ^_^token^_^
|
||||
# http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, prometheus-prometheus exporter rule
|
||||
parseType: jsonPath
|
||||
parseScript: '$.data[0]'
|
||||
@@ -62,6 +62,7 @@ params:
|
||||
type: number
|
||||
required: false
|
||||
hide: true
|
||||
defaultValue: 6000
|
||||
- field: authType
|
||||
name:
|
||||
zh-CN: 认证方式
|
||||
@@ -125,7 +126,7 @@ metrics:
|
||||
zh-CN: 状态
|
||||
en-US: Status
|
||||
ja-JP: ステータス
|
||||
- field: size
|
||||
- field: Size
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 数量
|
||||
@@ -137,6 +138,18 @@ metrics:
|
||||
zh-CN: 可用数量
|
||||
en-US: Available Size
|
||||
ja-JP: 利用可能なサイズ
|
||||
aliasFields:
|
||||
- $.app
|
||||
- $.category
|
||||
- $.status
|
||||
- $.size
|
||||
- $.availableSize
|
||||
calculates:
|
||||
- app=$.app
|
||||
- category=$.category
|
||||
- status=$.status
|
||||
- Size=$.size
|
||||
- availableSize=$.availableSize
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk, we use HTTP protocol here
|
||||
protocol: http
|
||||
# the config content when protocol is http
|
||||
@@ -228,7 +241,7 @@ metrics:
|
||||
priority: 1
|
||||
fields:
|
||||
- field: state
|
||||
type: 2
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 状态
|
||||
en-US: State
|
||||
|
||||
@@ -160,7 +160,7 @@ metrics:
|
||||
zh-CN: 状态
|
||||
en-US: Status
|
||||
ja-JP: ステータス
|
||||
- field: size
|
||||
- field: Size
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 数量
|
||||
@@ -172,6 +172,18 @@ metrics:
|
||||
zh-CN: 可用数量
|
||||
en-US: Available Size
|
||||
ja-JP: 利用可能なサイズ
|
||||
aliasFields:
|
||||
- $.app
|
||||
- $.category
|
||||
- $.status
|
||||
- $.size
|
||||
- $.availableSize
|
||||
calculates:
|
||||
- app=$.app
|
||||
- category=$.category
|
||||
- status=$.status
|
||||
- Size=$.size
|
||||
- availableSize=$.availableSize
|
||||
protocol: http
|
||||
http:
|
||||
host: ^_^host^_^
|
||||
|
||||
@@ -185,7 +185,7 @@ metrics:
|
||||
# SQL Query Method:oneRow, multiRow, columns
|
||||
queryType: oneRow
|
||||
# sql
|
||||
sql: select * from sys.v_$instance
|
||||
sql: "select * from sys.v_$instance"
|
||||
# JDBC url
|
||||
url: ^_^url^_^
|
||||
|
||||
@@ -246,7 +246,7 @@ metrics:
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
queryType: multiRow
|
||||
sql: select file_id, file_name, tablespace_name, status, bytes / 1024 / 1024 as bytes, blocks from dba_data_files
|
||||
sql: "select file_id, file_name, tablespace_name, status, bytes / 1024 / 1024 as bytes, blocks from dba_data_files"
|
||||
url: ^_^url^_^
|
||||
|
||||
- name: total_sessions
|
||||
@@ -273,7 +273,7 @@ metrics:
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
queryType: oneRow
|
||||
sql: select count(*) as count from v$session
|
||||
sql: "select count(*) as count from v$session"
|
||||
url: ^_^url^_^
|
||||
|
||||
- name: active_sessions
|
||||
@@ -300,7 +300,7 @@ metrics:
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
queryType: oneRow
|
||||
sql: select count(*) as count from v$session where username is not null and status = 'ACTIVE'
|
||||
sql: "select count(*) as count from v$session where username is not null and status = 'ACTIVE'"
|
||||
url: ^_^url^_^
|
||||
|
||||
- name: background_sessions
|
||||
@@ -327,7 +327,7 @@ metrics:
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
queryType: oneRow
|
||||
sql: select count(*) as count from v$session where username is null
|
||||
sql: "select count(*) as count from v$session where username is null"
|
||||
url: ^_^url^_^
|
||||
|
||||
- name: connection
|
||||
@@ -361,7 +361,7 @@ metrics:
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
queryType: oneRow
|
||||
sql: SELECT username, count( username ) as count FROM v$session WHERE username IS NOT NULL GROUP BY username
|
||||
sql: "SELECT username, count( username ) as count FROM v$session WHERE username IS NOT NULL GROUP BY username"
|
||||
url: ^_^url^_^
|
||||
|
||||
- name: performance
|
||||
@@ -411,13 +411,13 @@ metrics:
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
queryType: columns
|
||||
sql: select metric_name, value from gv$sysmetric where metric_name = 'I/O Megabytes per Second' or metric_name = 'User Transaction Per Sec' or metric_name = 'I/O Requests per Second'
|
||||
sql: "select metric_name, value from gv$sysmetric where metric_name = 'I/O Megabytes per Second' or metric_name = 'User Transaction Per Sec' or metric_name = 'I/O Requests per Second'"
|
||||
url: ^_^url^_^
|
||||
|
||||
|
||||
- name: percentage
|
||||
i18n:
|
||||
zh-CN: 百分比
|
||||
zh-CN: 表空间百分比
|
||||
en-US: Percentage
|
||||
ja-JP: パーセント
|
||||
priority: 7
|
||||
@@ -499,7 +499,7 @@ metrics:
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
queryType: oneRow
|
||||
sql: select count(*) as process_count from v$process
|
||||
sql: "select count(*) as process_count from v$process"
|
||||
url: ^_^url^_^
|
||||
|
||||
- name: transaction
|
||||
@@ -540,7 +540,7 @@ metrics:
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
queryType: columns
|
||||
sql: select metric_name, value from gv$sysmetric where metric_name = 'User Commits Per Sec' or metric_name = 'User Rollbacks Per Sec'
|
||||
sql: "select metric_name, value from gv$sysmetric where metric_name = 'User Commits Per Sec' or metric_name = 'User Rollbacks Per Sec'"
|
||||
url: ^_^url^_^
|
||||
|
||||
- name: wait
|
||||
@@ -635,7 +635,7 @@ metrics:
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
queryType: columns
|
||||
sql: select wait_class, sum(time_waited) total_wait_time from v$active_session_history where session_state = 'WAITING' GROUP BY wait_class ORDER BY total_wait_time DESC
|
||||
sql: "select wait_class, sum(time_waited) total_wait_time from v$active_session_history where session_state = 'WAITING' GROUP BY wait_class ORDER BY total_wait_time DESC"
|
||||
url: ^_^url^_^
|
||||
|
||||
- name: cpu_stats
|
||||
@@ -669,7 +669,7 @@ metrics:
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
queryType: multiRow
|
||||
sql: select stat_name as type, value as num from v$osstat where stat_name like '%CPU%' or stat_name like '%TIME'
|
||||
sql: "select stat_name as type, value as num from v$osstat where stat_name like '%CPU%' or stat_name like '%TIME'"
|
||||
url: ^_^url^_^
|
||||
|
||||
- name: mem_stats
|
||||
@@ -703,7 +703,7 @@ metrics:
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
queryType: multiRow
|
||||
sql: select stat_name as type, value as num from v$osstat where stat_name like '%BYTES'
|
||||
sql: "select stat_name as type, value as num from v$osstat where stat_name like '%BYTES'"
|
||||
url: ^_^url^_^
|
||||
|
||||
- name: cache_hit_ratio
|
||||
@@ -742,7 +742,7 @@ metrics:
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
queryType: columns
|
||||
sql: select metric_name, value from gv$sysmetric where metric_name like '%Cache Hit Ratio' order by end_time asc
|
||||
sql: "select metric_name, value from gv$sysmetric where metric_name like '%Cache Hit Ratio' order by end_time asc"
|
||||
url: ^_^url^_^
|
||||
|
||||
- name: slow_query
|
||||
@@ -832,5 +832,69 @@ metrics:
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
queryType: multiRow
|
||||
sql: SELECT * FROM (SELECT sql_id, child_number, executions, ROUND(CASE WHEN executions = 0 THEN NULL ELSE elapsed_time / (executions*1000000) END,4) AS per_secs, cpu_time / 1000000 AS cpu_secs, buffer_gets, disk_reads, fetches, parse_calls, optimizer_cost, sql_text FROM v$sql ) where rownum <= 10 ORDER BY per_secs DESC
|
||||
sql: "SELECT * FROM (SELECT sql_id, child_number, executions, ROUND(CASE WHEN executions = 0 THEN NULL ELSE elapsed_time / (executions*1000000) END,4) AS per_secs, cpu_time / 1000000 AS cpu_secs, buffer_gets, disk_reads, fetches, parse_calls, optimizer_cost, sql_text FROM v$sql ) where rownum <= 10 ORDER BY per_secs DESC"
|
||||
url: ^_^url^_^
|
||||
|
||||
- name: users
|
||||
i18n:
|
||||
zh-CN: 用户信息
|
||||
en-US: Users
|
||||
ja-JP: スロークエリ
|
||||
priority: 15
|
||||
fields:
|
||||
- field: username
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 用户名
|
||||
en-US: User Name
|
||||
ja-JP: ユーザー名
|
||||
- field: account_status
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 账号状态
|
||||
en-US: Account Status
|
||||
ja-JP: アカウントのステータス
|
||||
- field: lock_date
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 锁定时间
|
||||
en-US: Lock Date
|
||||
ja-JP: ロック日付
|
||||
- field: expiry_date
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 密码失效时间
|
||||
en-US: Password Expiry Date
|
||||
ja-JP: パスワードの有効期限
|
||||
- field: expiry_seconds
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 密码剩余有效时间
|
||||
en-US: Password Validity Period Remaining
|
||||
ja-JP: パスワードの有効期間残り
|
||||
unit: 秒
|
||||
- field: created
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 创建时间
|
||||
en-US: Creation Date
|
||||
ja-JP: 作成日
|
||||
- field: authentication_type
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 认证类型
|
||||
en-US: Authentication Type
|
||||
ja-JP: 認証タイプ
|
||||
protocol: jdbc
|
||||
jdbc:
|
||||
host: ^_^host^_^
|
||||
port: ^_^port^_^
|
||||
platform: oracle
|
||||
username: ^_^username^_^
|
||||
password: ^_^password^_^
|
||||
database: ^_^database^_^
|
||||
timeout: ^_^timeout^_^
|
||||
reuseConnection: ^_^reuseConnection^_^
|
||||
queryType: multiRow
|
||||
sql: "SELECT username,account_status,lock_date,expiry_date,ceil((expiry_date-sysdate)* 24 * 60 * 60) as expiry_seconds,created,authentication_type FROM DBA_USERS ORDER BY expiry_date ASC"
|
||||
url: ^_^url^_^
|
||||
|
||||
@@ -651,7 +651,7 @@ metrics:
|
||||
zh-CN: 次数
|
||||
en-US: Num
|
||||
ja-JP: 数量
|
||||
- field: size
|
||||
- field: Size
|
||||
type: 0
|
||||
unit: B
|
||||
i18n:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -21,11 +21,13 @@ app: redis_sentinel
|
||||
name:
|
||||
zh-CN: Redis Sentinel
|
||||
en-US: Redis Sentinel
|
||||
ja-JP: Redis Sentinel
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: Hertzbeat 对 Redis Sentinel 的通用指标进行采集监控。<br>您可以点击 “<i>新建 Redis Cluster</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: Hertzbeat monitors Redis Database Sentinel's general performance metrics. You could click the "<i>New Redis Cluster</i>" button and proceed with the configuration or import an existing setup through the "<i>More Actions</i>" menu.
|
||||
zh-TW: Hertzbeat 對 Redis Sentinel 的通用指標進行采集監控。<br>您可以點擊 “<i>新建 Redis Cluster</i>” 並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
|
||||
zh-CN: Hertzbeat 对 Redis Sentinel 的通用指标进行采集监控。<br>您可以点击 “<i>新建 Redis Sentinel</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
|
||||
en-US: Hertzbeat monitors Redis Database Sentinel's general performance metrics. You could click the "<i>New Redis Sentinel</i>" button and proceed with the configuration or import an existing setup through the "<i>More Actions</i>" menu.
|
||||
zh-TW: Hertzbeat 對 Redis Sentinel 的通用指標進行采集監控。<br>您可以點擊 “<i>新建 Redis Sentinel</i>” 並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
|
||||
ja-JP: Hertzbeat は Redis Sentinel の一般的なパフォーマンスのメトリクスを監視します。<br>「<i>新規 Redis Sentinel</i>」をクリックしてパラメタを設定した後、新規することができます。
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/influxdb_promql
|
||||
en-US: https://hertzbeat.apache.org/docs/help/influxdb_promql
|
||||
@@ -37,6 +39,7 @@ 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
|
||||
@@ -46,6 +49,7 @@ 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
|
||||
@@ -60,6 +64,7 @@ params:
|
||||
name:
|
||||
zh-CN: 查询超时时间(ms)
|
||||
en-US: Query Timeout(ms)
|
||||
ja-JP: クエリタイムアウト(ms)
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# when type is number, range is required
|
||||
@@ -74,6 +79,7 @@ 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
|
||||
@@ -86,6 +92,7 @@ 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
|
||||
@@ -96,6 +103,7 @@ params:
|
||||
name:
|
||||
zh-CN: 模式
|
||||
en-US: Pattern
|
||||
ja-JP: パターン
|
||||
# type-param field type(most mapping the html input type)
|
||||
type: number
|
||||
# required-true or false
|
||||
@@ -108,6 +116,7 @@ params:
|
||||
name:
|
||||
zh-CN: 是否启用SSH隧道
|
||||
en-US: Enable SSH Tunnel
|
||||
ja-JP: SSHトンネルの有効化
|
||||
type: boolean
|
||||
required: true
|
||||
hide: true
|
||||
@@ -115,6 +124,7 @@ params:
|
||||
name:
|
||||
zh-CN: SSH Host
|
||||
en-US: SSH Host
|
||||
ja-JP: SSHホスト
|
||||
type: text
|
||||
required: false
|
||||
placeholder: 'When Enable SSH Tunnel'
|
||||
@@ -123,6 +133,7 @@ params:
|
||||
name:
|
||||
zh-CN: SSH端口
|
||||
en-US: SSH Port
|
||||
ja-JP: SSHポート
|
||||
type: number
|
||||
range: '[0,65535]'
|
||||
required: false
|
||||
@@ -133,6 +144,7 @@ params:
|
||||
name:
|
||||
zh-CN: SSH超时时间(ms)
|
||||
en-US: SSH Timeout(ms)
|
||||
ja-JP: SSHタイムアウト(ms)
|
||||
type: number
|
||||
required: false
|
||||
range: '[400,200000]'
|
||||
@@ -142,6 +154,7 @@ params:
|
||||
name:
|
||||
zh-CN: SSH用户名
|
||||
en-US: SSH Username
|
||||
ja-JP: SSHユーザー名
|
||||
type: text
|
||||
required: false
|
||||
placeholder: 'When Enable SSH tunnel'
|
||||
@@ -150,6 +163,7 @@ params:
|
||||
name:
|
||||
zh-CN: SSH密码
|
||||
en-US: SSH Password
|
||||
ja-JP: SSHパスワード
|
||||
type: password
|
||||
required: false
|
||||
hide: true
|
||||
@@ -157,6 +171,7 @@ params:
|
||||
name:
|
||||
zh-CN: 是否共享SSH连接
|
||||
en-US: Share SSH Connection
|
||||
ja-JP: SSH接続共有
|
||||
type: boolean
|
||||
required: true
|
||||
defaultValue: true
|
||||
@@ -165,6 +180,7 @@ params:
|
||||
name:
|
||||
zh-CN: SSH私钥
|
||||
en-US: SSH PrivateKey
|
||||
ja-JP: SSH秘密鍵
|
||||
type: textarea
|
||||
placeholder: -----BEGIN RSA PRIVATE KEY-----
|
||||
required: false
|
||||
@@ -173,6 +189,7 @@ params:
|
||||
name:
|
||||
zh-CN: SSH密钥短语
|
||||
en-US: SSH PrivateKey PassPhrase
|
||||
ja-JP: SSH秘密鍵フレーズ
|
||||
type: password
|
||||
required: false
|
||||
hide: true
|
||||
@@ -181,6 +198,7 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 服务器
|
||||
en-US: Server
|
||||
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
|
||||
@@ -191,121 +209,145 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 标识
|
||||
en-US: Identity
|
||||
ja-JP: ID
|
||||
- field: redis_version
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Redis 版本
|
||||
en-US: Redis Version
|
||||
ja-JP: Redisバージョン
|
||||
- field: redis_git_sha1
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Redis Git SHA1
|
||||
en-US: Redis Git SHA1
|
||||
ja-JP: Redis Git SHA1
|
||||
- field: redis_git_dirty
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Redis Git Dirty
|
||||
en-US: Redis Git Dirty
|
||||
ja-JP: RedisサーバーのGitリポジトリ状態
|
||||
- field: redis_build_id
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Redis Build ID
|
||||
en-US: Redis Build ID
|
||||
ja-JP: Redis ビルド Id
|
||||
- field: redis_mode
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: Redis 模式
|
||||
en-US: Redis Mode
|
||||
ja-JP: Redis モード
|
||||
- field: os
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 操作系统
|
||||
en-US: Operating System
|
||||
ja-JP: オーエス
|
||||
- field: arch_bits
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 架构位数
|
||||
en-US: Architecture Bits
|
||||
ja-JP: アーキテクチャ
|
||||
- field: multiplexing_api
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 多路复用 API
|
||||
en-US: Multiplexing API
|
||||
ja-JP: IO多重化API
|
||||
- field: atomicvar_api
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 原子变量 API
|
||||
en-US: Atomicvar API
|
||||
ja-JP: 原子操作API
|
||||
- field: gcc_version
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: GCC 版本
|
||||
en-US: GCC Version
|
||||
ja-JP: GCC バージョン
|
||||
- field: process_id
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 进程 ID
|
||||
en-US: Process ID
|
||||
ja-JP: プロセスID
|
||||
- field: process_supervised
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 进程监控
|
||||
en-US: Process Supervised
|
||||
ja-JP: プロセスの監視方法
|
||||
- field: run_id
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 运行 ID
|
||||
en-US: Run ID
|
||||
ja-JP: Run ID
|
||||
- field: tcp_port
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: TCP 端口
|
||||
en-US: TCP Port
|
||||
ja-JP: TCP ポート
|
||||
- field: server_time_usec
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 基于纪元的系统时间
|
||||
en-US: Server Time Usec
|
||||
ja-JP: サーバーのタイムスタンプ
|
||||
- field: uptime_in_seconds
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 运行时间(秒)
|
||||
en-US: Uptime In Seconds
|
||||
ja-JP: アップタイム(秒)
|
||||
- field: uptime_in_days
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 运行时间(天)
|
||||
en-US: Uptime In Days
|
||||
ja-JP: アップタイム(日)
|
||||
- field: hz
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 定时器频率
|
||||
en-US: Hz
|
||||
ja-JP: イベントの実行頻度
|
||||
- field: configured_hz
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 配置定时器频率
|
||||
en-US: Configured Hz
|
||||
ja-JP: 設定されたイベントの実行頻度
|
||||
- field: lru_clock
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: LRU 时钟
|
||||
en-US: LRU Clock
|
||||
ja-JP: LRU クロック
|
||||
- field: executable
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 可执行文件
|
||||
en-US: Executable
|
||||
ja-JP: サーバーの実行パス
|
||||
- field: config_file
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 配置文件
|
||||
en-US: Config File
|
||||
ja-JP: 設定されたサーバーの実行ファイル
|
||||
- field: io_threads_active
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 活动 IO 线程
|
||||
en-US: IO Threads Active
|
||||
ja-JP: 活動中のスレッド数
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: redis
|
||||
# the config content when protocol is redis
|
||||
@@ -336,6 +378,7 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 客户端
|
||||
en-US: Clients
|
||||
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
|
||||
@@ -346,41 +389,49 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 已连接客户端
|
||||
en-US: Connected Clients
|
||||
ja-JP: 現在接続されているクライアントの数
|
||||
- field: cluster_connections
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 集群连接
|
||||
en-US: Cluster Connections
|
||||
ja-JP: クラスター内の接続数
|
||||
- field: maxclients
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最大客户端数
|
||||
en-US: Maxclients
|
||||
ja-JP: 最大クライアント数
|
||||
- field: client_recent_max_input_buffer
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 客户端最近最大输入缓冲区
|
||||
en-US: Client Recent Max Input Buffer
|
||||
ja-JP: クライアントの最近の最大入力バッファサイズ
|
||||
- field: client_recent_max_output_buffer
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 客户端最近最大输出缓冲区
|
||||
en-US: Client Recent Max Output Buffer
|
||||
ja-JP: クライアントの最近の最大出力バッファサイズ
|
||||
- field: blocked_clients
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 阻塞客户端
|
||||
en-US: Blocked Clients
|
||||
ja-JP: ブロックされたクライアント数
|
||||
- field: tracking_clients
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 跟踪客户端
|
||||
en-US: Tracking Clients
|
||||
ja-JP: トラッキングを使用するクライアントの数
|
||||
- field: clients_in_timeout_table
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 超时表中的客户端
|
||||
en-US: Clients In Timeout Table
|
||||
ja-JP: タイムアウトテーブル内のクライアント数
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: redis
|
||||
# the config content when protocol is redis
|
||||
@@ -411,6 +462,7 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 统计
|
||||
en-US: Stats
|
||||
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
|
||||
@@ -421,191 +473,229 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 收到总连接数
|
||||
en-US: Total Connections Received
|
||||
ja-JP: サーバーの起動後に受信された合計接続数
|
||||
- field: total_commands_processed
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 处理总命令数
|
||||
en-US: Total Commands Processed
|
||||
ja-JP: サーバーの起動後に処理した総コマンド数
|
||||
- field: instantaneous_ops_per_sec
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 瞬时每秒操作数
|
||||
en-US: Instantaneous Ops Per Sec
|
||||
ja-JP: 1秒当たりに処理されたコマンドの数
|
||||
- field: total_net_input_bytes
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 总网络输入字节
|
||||
en-US: Total Net Input Bytes
|
||||
ja-JP: 受信されたネットワークバイトの合計数
|
||||
- field: total_net_output_bytes
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 总网络输出字节
|
||||
en-US: Total Net Output Bytes
|
||||
ja-JP: 転送されたネットワークバイトの合計数
|
||||
- field: instantaneous_input_kbps
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 瞬时的输入 kbps
|
||||
en-US: Instantaneous Input Kbps
|
||||
ja-JP: 瞬間入力速度(kbps)
|
||||
- field: instantaneous_output_kbps
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 瞬时输出 kbps
|
||||
en-US: Instantaneous Output Kbps
|
||||
ja-JP: 瞬間出力速度(kbps)
|
||||
- field: rejected_connections
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 拒绝连接数
|
||||
en-US: Rejected Connections
|
||||
ja-JP: maxclients制限で拒否された接続数
|
||||
- field: sync_full
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 全量同步
|
||||
en-US: Sync Full
|
||||
ja-JP: 完全同期の回数
|
||||
- field: sync_partial_ok
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 部分同步成功
|
||||
en-US: Sync Partial Ok
|
||||
ja-JP: 部分同期の回数
|
||||
- field: sync_partial_err
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 部分同步失败
|
||||
en-US: Sync Partial Err
|
||||
ja-JP: 部分同期のエラー回数
|
||||
- field: expired_keys
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 过期键
|
||||
en-US: Expired Keys
|
||||
ja-JP: expireコマンドで削除されたキーの数
|
||||
- field: expired_stale_perc
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 过期key占比
|
||||
en-US: Expired Stale Perc
|
||||
ja-JP: 期限切れのステイルキーの比率
|
||||
- field: expired_time_cap_reached_count
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 达到过期时间上限计数
|
||||
en-US: Expired Time Cap Reached Count
|
||||
ja-JP: 満了時間の制限に達した回数
|
||||
- field: expire_cycle_cpu_milliseconds
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 过期周期 CPU 毫秒
|
||||
en-US: Expire Cycle CPU Milliseconds
|
||||
ja-JP: 満了サイクルでかかったCPU時間(ms)
|
||||
- field: evicted_keys
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 逐出键
|
||||
en-US: Evicted Keys
|
||||
ja-JP: メモリ不足で追放されたキーの数
|
||||
- field: keyspace_hits
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 命中键
|
||||
en-US: Keyspace Hits
|
||||
ja-JP: キースペースのヒット数
|
||||
- field: keyspace_misses
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 未命中键
|
||||
en-US: Keyspace Misses
|
||||
ja-JP: キースペースのミス数
|
||||
- field: pubsub_channels
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 发布订阅频道
|
||||
en-US: Pubsub Channels
|
||||
ja-JP: 有効になっているPub/Subチャネルに接続されているチャネルの数
|
||||
- field: pubsub_patterns
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 发布订阅模式
|
||||
en-US: Pubsub Patterns
|
||||
ja-JP: 有効になっているPub/Subパターンで接続されたパターンチャネルの数
|
||||
- field: latest_fork_usec
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 最新 fork 毫秒
|
||||
en-US: Latest Fork Usec
|
||||
ja-JP: 最後のフォーク作業にかかった時間
|
||||
- field: total_forks
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 总 fork 数
|
||||
en-US: Total Forks
|
||||
ja-JP: 実行されたフォーク作業の合計数
|
||||
- field: migrate_cached_sockets
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 迁移缓存套接字
|
||||
en-US: Migrate Cached Sockets
|
||||
ja-JP: マイグレーションされたソケット数
|
||||
- field: slave_expires_tracked_keys
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 从节点过期跟踪键
|
||||
en-US: Slave Expires Tracked Keys
|
||||
ja-JP: スレーブで満了した、トラッキングされたキーの数
|
||||
- field: active_defrag_hits
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 活跃碎片整理命中
|
||||
en-US: Active Defrag Hits
|
||||
ja-JP: アクティブなデフラグ操作中に発生したヒットの数
|
||||
- field: active_defrag_misses
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 活跃碎片整理未命中
|
||||
en-US: Active Defrag Misses
|
||||
ja-JP: アクティブなデフラグ操作中に見逃したヒットの数
|
||||
- field: active_defrag_key_hits
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 活跃碎片整理键命中
|
||||
en-US: Active Defrag Key Hits
|
||||
ja-JP: デフラグ操作でヒットしたキーの数
|
||||
- field: active_defrag_key_misses
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 活跃碎片整理键未命中
|
||||
en-US: Active Defrag Key Misses
|
||||
ja-JP: デフラグ操作で見逃したキーの数
|
||||
- field: tracking_total_keys
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 跟踪键总数
|
||||
en-US: Tracking Total Keys
|
||||
ja-JP: トラッキングされたキーの合計数
|
||||
- field: tracking_total_items
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 跟踪项总数
|
||||
en-US: Tracking Total Items
|
||||
ja-JP: トラッキングされたアイテムの合計数
|
||||
- field: tracking_total_prefixes
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 跟踪前缀总数
|
||||
en-US: Tracking Total Prefixes
|
||||
ja-JP: トラッキングされたプレフィックスの合計数
|
||||
- field: unexpected_error_replies
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 意外错误回复
|
||||
en-US: Unexpected Error Replies
|
||||
ja-JP: 予期しないエラー応答の数
|
||||
- field: total_error_replies
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 总错误回复
|
||||
en-US: Total Error Replies
|
||||
ja-JP: 発生したエラーの合計応答の数
|
||||
- field: dump_payload_sanitizations
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 转储有效负载深度完整性验证的总数
|
||||
en-US: Dump Payload Sanitizations
|
||||
ja-JP: ダンプペイロードで実行された整理作業の数
|
||||
- field: total_reads_processed
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 总读取处理
|
||||
en-US: Total Reads Processed
|
||||
ja-JP: 処理された読み取り作業の合計数
|
||||
- field: total_writes_processed
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 总写入处理
|
||||
en-US: Total Writes Processed
|
||||
ja-JP: 処理された書き込み作業の合計数
|
||||
- field: io_threaded_reads_processed
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: IO 线程读取处理
|
||||
en-US: Io Threaded Reads Processed
|
||||
ja-JP: I/Oスレッドで処理された読み取り作業の数
|
||||
- field: io_threaded_writes_processed
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: IO 线程写入处理
|
||||
en-US: Io Threaded Writes Processed
|
||||
ja-JP: I/Oスレッドで処理された書き込み作業の数
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: redis
|
||||
# the config content when protocol is redis
|
||||
@@ -636,6 +726,7 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: CPU
|
||||
en-US: CPU
|
||||
ja-JP: CPU情報
|
||||
# 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
|
||||
@@ -646,31 +737,37 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 系统已使用 CPU
|
||||
en-US: Sys CPU Used
|
||||
ja-JP: システムモードで使用されたCPUの合計時間
|
||||
- field: used_cpu_user
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 用户已使用 CPU
|
||||
en-US: User CPU Used
|
||||
ja-JP: ユーザーモードで使用されたCPUの合計時間
|
||||
- field: used_cpu_sys_children
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: Sys 子进程已使用 CPU
|
||||
en-US: Sys Children CPU Used
|
||||
ja-JP: 子プロセスがシステムモードで使用したCPU時間
|
||||
- field: used_cpu_user_children
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 用户子进程已使用 CPU
|
||||
en-US: User Children CPU Used
|
||||
ja-JP: 子プロセスがユーザーモードで使用したCPU時間
|
||||
- field: used_cpu_sys_main_thread
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 系统主线程已使用 CPU
|
||||
en-US: Sys Main Thread CPU Used
|
||||
ja-JP: プロセスがシステムモードで使用したCPU時間
|
||||
- field: used_cpu_user_main_thread
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 用户主线程已使用 CPU
|
||||
en-US: User Main Thread CPU Used
|
||||
ja-JP: プロセスがユーザーモードで使用したCPU時間
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: redis
|
||||
# the config content when protocol is redis
|
||||
@@ -701,6 +798,7 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 哨兵
|
||||
en-US: Sentinel
|
||||
ja-JP: Sentinel
|
||||
# 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
|
||||
@@ -711,26 +809,31 @@ metrics:
|
||||
i18n:
|
||||
zh-CN: 主节点
|
||||
en-US: Masters
|
||||
ja-JP: マスターノード
|
||||
- field: sentinel_tilt
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 倾斜
|
||||
en-US: Tilt
|
||||
ja-JP: マスターをダウン状態としてマークする前の待機時間
|
||||
- field: sentinel_running_scripts
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 运行脚本
|
||||
en-US: Running Scripts
|
||||
ja-JP: 実行するスクリプト
|
||||
- field: sentinel_scripts_queue_length
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 脚本队列长度
|
||||
en-US: Scripts Queue Length
|
||||
ja-JP: 実行するスクリプトのキューの長さ
|
||||
- field: sentinel_simulate_failure_flags
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 模拟失败标志
|
||||
en-US: Simulate Failure Flags
|
||||
ja-JP: フェイルオーバー機能をテスト用のフラグ
|
||||
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
|
||||
protocol: redis
|
||||
# the config content when protocol is redis
|
||||
|
||||
@@ -19,15 +19,15 @@ category: mid
|
||||
app: spring_gateway
|
||||
# The monitoring i18n name
|
||||
name:
|
||||
zh-CN: SpringGateway
|
||||
en-US: SpringGateway
|
||||
ja-JP: SpringGateway
|
||||
zh-CN: Spring Cloud Gateway
|
||||
en-US: Spring Cloud Gateway
|
||||
ja-JP: Spring Cloud Gateway
|
||||
# The description and help of this monitoring type
|
||||
help:
|
||||
zh-CN: HertzBeat 对 <a class='help_module_content' href='https://www.tutorialspoint.com/spring_boot/spring_boot_actuator.htm'> SpringBoot Actuator </a> 暴露的通用性能指标(globalfilters、routefilters、refresh、routes)进行采集监控。<span class='help_module_span'>注意⚠️:如果要监控 SpringGateway 中的信息,需要您的 SpringGateway 应用集成并开启 SpringBoot Actuator, <a class='help_module_content' href='https://cloud.spring.io/spring-cloud-gateway/multi/multi__actuator_api.html'>点击查看具体步骤</a>。</span>
|
||||
en-US: HertzBeat collect and monitors SpringGateway through general performance metric that exposed by the SpringBoot Actuator. <br><span class='help_module_span'><br>Note⚠️:You should make sure that your SpringGateway application have already integrated and enabled the SpringBoot Actuator, <a class='help_module_content' href='https://cloud.spring.io/spring-cloud-gateway/multi/multi__actuator_api.html'>click here to see the specific steps.</a></span>
|
||||
zh-TW: HertzBeat 對 <a class='help_module_content' href='https://www.tutorialspoint.com/spring_boot/spring_boot_actuator.htm'> SpringBoot Actuator </a>暴露的通用性能指標(globalfilters、routefilters、refresh、routes)進行採集監控。<span class='help_module_span'>注意⚠️:如果要監控SpringGateway中的指標,需要您的SpringGateway應用集成並開啟SpringBoot Actuator,<a class='help_module_content' href='https://cloud.spring.io/spring-cloud-gateway/multi/multi__actuator_api.html'>點擊查看具體步驟</a>。</span>
|
||||
ja-JP: HertzBeat は <a class='help_module_content' href='https://www.tutorialspoint.com/spring_boot/spring_boot_actuator.htm'> SpringBoot Actuator </a> の一般的なパフォーマンスのメトリクスを監視します。<span class='help_module_span'>⚠️注意:SpringGateway で SpringBoot Actuatorを有効にする必要があります。<a class='help_module_content' href='https://cloud.spring.io/spring-cloud-gateway/multi/multi__actuator_api.html'>クリックしてガイドを見ます</a>。</span>
|
||||
zh-CN: HertzBeat 对 <a class='help_module_content' href='https://www.tutorialspoint.com/spring_boot/spring_boot_actuator.htm'> SpringBoot Actuator </a> 暴露的通用性能指标(globalfilters、routefilters、refresh、routes)进行采集监控。<span class='help_module_span'>注意⚠️:如果要监控 Spring Cloud Gateway 中的信息,需要您的 Spring Cloud Gateway 应用集成并开启 SpringBoot Actuator, <a class='help_module_content' href='https://cloud.spring.io/spring-cloud-gateway/multi/multi__actuator_api.html'>点击查看具体步骤</a>。</span>
|
||||
en-US: HertzBeat collect and monitors SpringGateway through general performance metric that exposed by the SpringBoot Actuator. <br><span class='help_module_span'><br>Note⚠️:You should make sure that your Spring Cloud Gateway application have already integrated and enabled the SpringBoot Actuator, <a class='help_module_content' href='https://cloud.spring.io/spring-cloud-gateway/multi/multi__actuator_api.html'>click here to see the specific steps.</a></span>
|
||||
zh-TW: HertzBeat 對 <a class='help_module_content' href='https://www.tutorialspoint.com/spring_boot/spring_boot_actuator.htm'> SpringBoot Actuator </a>暴露的通用性能指標(globalfilters、routefilters、refresh、routes)進行採集監控。<span class='help_module_span'>注意⚠️:如果要監控 Spring Cloud Gateway 中的指標,需要您的 Spring Cloud Gateway 應用集成並開啟SpringBoot Actuator,<a class='help_module_content' href='https://cloud.spring.io/spring-cloud-gateway/multi/multi__actuator_api.html'>點擊查看具體步驟</a>。</span>
|
||||
ja-JP: HertzBeat は <a class='help_module_content' href='https://www.tutorialspoint.com/spring_boot/spring_boot_actuator.htm'> SpringBoot Actuator </a> の一般的なパフォーマンスのメトリクスを監視します。<span class='help_module_span'>⚠️注意:Spring Cloud Gateway で SpringBoot Actuatorを有効にする必要があります。<a class='help_module_content' href='https://cloud.spring.io/spring-cloud-gateway/multi/multi__actuator_api.html'>クリックしてガイドを見ます</a>。</span>
|
||||
helpLink:
|
||||
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/spring_gateway
|
||||
en-US: https://hertzbeat.apache.org/docs/help/spring_gateway
|
||||
@@ -284,7 +284,7 @@ metrics:
|
||||
en-US: State
|
||||
ja-JP: 状態
|
||||
label: true
|
||||
- field: size
|
||||
- field: Size
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 数量
|
||||
@@ -294,7 +294,7 @@ metrics:
|
||||
- $.measurements[?(@.statistic == "VALUE")].value
|
||||
calculates:
|
||||
- state='^o^state^o^'
|
||||
- size=$.measurements[?(@.statistic == "VALUE")].value
|
||||
- Size=$.measurements[?(@.statistic == "VALUE")].value
|
||||
protocol: http
|
||||
http:
|
||||
host: ^_^host^_^
|
||||
|
||||
@@ -316,7 +316,7 @@ metrics:
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 编号
|
||||
en-US: 编号
|
||||
en-US: Index
|
||||
- field: hrSWInstalledName
|
||||
type: 1
|
||||
i18n:
|
||||
@@ -357,14 +357,14 @@ metrics:
|
||||
type: 0
|
||||
i18n:
|
||||
zh-CN: 编号
|
||||
en-US: 编号
|
||||
en-US: Index
|
||||
- field: descr
|
||||
type: 1
|
||||
i18n:
|
||||
zh-CN: 存储描述
|
||||
en-US: Storage Description
|
||||
label: true
|
||||
- field: size
|
||||
- field: Size
|
||||
i18n:
|
||||
zh-CN: 存储大小
|
||||
en-US: Storage Size
|
||||
@@ -400,7 +400,7 @@ metrics:
|
||||
calculates:
|
||||
- index=hrStorageIndex
|
||||
- descr=hrStorageDescr
|
||||
- size=hrStorageSize * hrStorageAllocationUnits
|
||||
- Size=hrStorageSize * hrStorageAllocationUnits
|
||||
- free=(hrStorageSize - hrStorageUsed) * hrStorageAllocationUnits
|
||||
- used=hrStorageUsed * hrStorageAllocationUnits
|
||||
- usage= hrStorageUsed / hrStorageSize * 100
|
||||
|
||||
@@ -66,7 +66,8 @@ resourceRole:
|
||||
- /api/bulletin/**===post===[admin,user]
|
||||
- /api/bulletin/**===put===[admin,user]
|
||||
- /api/bulletin/**===delete===[admin]
|
||||
|
||||
- /api/sse/**===get===[admin,user]
|
||||
- /api/sse/**===post===[admin,user]
|
||||
# config the resource restful api that need bypass auth protection
|
||||
# rule: api===method
|
||||
# eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth.
|
||||
|
||||
+42
-14
@@ -36,6 +36,7 @@ import java.util.Map;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
@@ -106,8 +107,8 @@ public class VictoriaMetricsDataStorage extends AbstractHistoryDataStorage {
|
||||
private final BlockingQueue<VictoriaMetricsDataStorage.VictoriaMetricsContent> metricsBufferQueue;
|
||||
|
||||
private HashedWheelTimer metricsFlushTimer = null;
|
||||
private MetricsFlushTask metricsFlushtask = null;
|
||||
private final VictoriaMetricsProperties.InsertConfig insertConfig;
|
||||
private final AtomicBoolean draining = new AtomicBoolean(false);
|
||||
|
||||
public VictoriaMetricsDataStorage(VictoriaMetricsProperties victoriaMetricsProperties, RestTemplate restTemplate) {
|
||||
if (victoriaMetricsProperties == null) {
|
||||
@@ -129,8 +130,8 @@ public class VictoriaMetricsDataStorage extends AbstractHistoryDataStorage {
|
||||
thread.setDaemon(true);
|
||||
return thread;
|
||||
}, 1, TimeUnit.SECONDS, 512);
|
||||
metricsFlushtask = new MetricsFlushTask();
|
||||
this.metricsFlushTimer.newTimeout(metricsFlushtask, 0, TimeUnit.SECONDS);
|
||||
// start flush interval timer
|
||||
this.metricsFlushTimer.newTimeout(new MetricsFlushTask(null), insertConfig.flushInterval(), TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
private boolean checkVictoriaMetricsDatasourceAvailable() {
|
||||
@@ -591,36 +592,63 @@ public class VictoriaMetricsDataStorage extends AbstractHistoryDataStorage {
|
||||
}
|
||||
}
|
||||
// Refresh in advance to avoid waiting
|
||||
if (metricsBufferQueue.size() >= insertConfig.bufferSize() * 0.8) {
|
||||
if (metricsBufferQueue.size() >= insertConfig.bufferSize() * 0.8
|
||||
&& draining.compareAndSet(false, true)) {
|
||||
triggerImmediateFlush();
|
||||
}
|
||||
}
|
||||
|
||||
private void triggerImmediateFlush() {
|
||||
metricsFlushTimer.newTimeout(metricsFlushtask, 0, TimeUnit.MILLISECONDS);
|
||||
List<VictoriaMetricsDataStorage.VictoriaMetricsContent> batch = new ArrayList<>(insertConfig.bufferSize());
|
||||
metricsBufferQueue.drainTo(batch, insertConfig.bufferSize());
|
||||
draining.set(false);
|
||||
if (!batch.isEmpty()) {
|
||||
metricsFlushTimer.newTimeout(new MetricsFlushTask(batch), 0, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Regularly refresh the buffer queue to the vm
|
||||
*/
|
||||
private class MetricsFlushTask implements TimerTask {
|
||||
private final List<VictoriaMetricsDataStorage.VictoriaMetricsContent> batch;
|
||||
|
||||
public MetricsFlushTask(List<VictoriaMetricsDataStorage.VictoriaMetricsContent> batch) {
|
||||
this.batch = batch;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(Timeout timeout) {
|
||||
try {
|
||||
List<VictoriaMetricsDataStorage.VictoriaMetricsContent> batch = new ArrayList<>(insertConfig.bufferSize());
|
||||
metricsBufferQueue.drainTo(batch, insertConfig.bufferSize());
|
||||
if (!batch.isEmpty()) {
|
||||
doSaveData(batch);
|
||||
log.debug("[Victoria Metrics] Flushed {} metrics items", batch.size());
|
||||
}
|
||||
if (metricsFlushTimer != null && !metricsFlushTimer.isStop()) {
|
||||
metricsFlushTimer.newTimeout(this, insertConfig.flushInterval(), TimeUnit.SECONDS);
|
||||
log.debug("[Victoria Metrics] Rescheduled next flush task in {} seconds.", insertConfig.flushInterval());
|
||||
if (batch == null) {
|
||||
// If the batch is null, it means that the timer is triggered by flush interval timer
|
||||
List<VictoriaMetricsDataStorage.VictoriaMetricsContent> batchT = new ArrayList<>(insertConfig.bufferSize());
|
||||
metricsBufferQueue.drainTo(batchT, insertConfig.bufferSize());
|
||||
triggerDoSaveData(batchT);
|
||||
// Reschedule the next flush task
|
||||
triggerIntervalFlushTimer();
|
||||
} else {
|
||||
// If the batch is not null, it means that the timer is triggered by the immediate flush
|
||||
triggerDoSaveData(batch);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("[VictoriaMetrics] flush task error: {}", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private void triggerDoSaveData(List<VictoriaMetricsContent> batch) {
|
||||
if (!batch.isEmpty()) {
|
||||
doSaveData(batch);
|
||||
log.debug("[Victoria Metrics] Flushed {} metrics items", batch.size());
|
||||
}
|
||||
}
|
||||
|
||||
private void triggerIntervalFlushTimer() {
|
||||
if (metricsFlushTimer != null && !metricsFlushTimer.isStop()) {
|
||||
metricsFlushTimer.newTimeout(new MetricsFlushTask(null), insertConfig.flushInterval(), TimeUnit.SECONDS);
|
||||
log.debug("[Victoria Metrics] Rescheduled next flush task in {} seconds.", insertConfig.flushInterval());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+70
-46
@@ -21,9 +21,8 @@ import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.startsWith;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import org.apache.arrow.vector.types.pojo.ArrowType;
|
||||
import org.apache.arrow.vector.types.pojo.Field;
|
||||
@@ -53,6 +52,7 @@ import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* Test case for {@link VictoriaMetricsDataStorage}
|
||||
@@ -72,18 +72,33 @@ class VictoriaMetricsDataStorageTest {
|
||||
|
||||
private VictoriaMetricsDataStorage victoriaMetricsDataStorage;
|
||||
|
||||
private final AtomicInteger postForEntityCount = new AtomicInteger(0);
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
when(victoriaMetricsProperties.enabled()).thenReturn(true);
|
||||
when(victoriaMetricsProperties.url()).thenReturn("http://localhost:8428");
|
||||
when(victoriaMetricsProperties.username()).thenReturn("root");
|
||||
when(victoriaMetricsProperties.password()).thenReturn("root");
|
||||
|
||||
// on successful write, VictoriaMetrics returns HTTP 204 (No Content)
|
||||
when(responseEntity.getStatusCode()).thenReturn(HttpStatus.NO_CONTENT);
|
||||
when(restTemplate.exchange(anyString(), eq(HttpMethod.GET), any(HttpEntity.class), eq(String.class)))
|
||||
.thenReturn(responseEntity);
|
||||
when(restTemplate.postForEntity(anyString(), any(HttpEntity.class), eq(String.class)))
|
||||
.thenReturn(responseEntity);
|
||||
|
||||
when(restTemplate.exchange(
|
||||
anyString(),
|
||||
eq(HttpMethod.GET),
|
||||
any(HttpEntity.class),
|
||||
eq(String.class)
|
||||
)).thenReturn(responseEntity);
|
||||
|
||||
when(restTemplate.postForEntity(
|
||||
startsWith(victoriaMetricsProperties.url()),
|
||||
any(HttpEntity.class),
|
||||
eq(String.class)
|
||||
)).thenAnswer(invocation -> {
|
||||
postForEntityCount.incrementAndGet();
|
||||
return responseEntity;
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -92,14 +107,11 @@ class VictoriaMetricsDataStorageTest {
|
||||
victoriaMetricsDataStorage = new VictoriaMetricsDataStorage(victoriaMetricsProperties, restTemplate);
|
||||
// execute one-time data insertion
|
||||
victoriaMetricsDataStorage.saveData(generateMockedMetricsData());
|
||||
// wait for the timer's first insertion task execution and verify if it was called once
|
||||
Awaitility.await().atMost(5, TimeUnit.SECONDS).untilAsserted(() ->
|
||||
verify(restTemplate, times(1)).postForEntity(
|
||||
startsWith(victoriaMetricsProperties.url()),
|
||||
any(HttpEntity.class),
|
||||
eq(String.class)
|
||||
)
|
||||
);
|
||||
// wait for the timer's first insertion task execution and verify if it was called once (default 3 seconds)
|
||||
Awaitility.await()
|
||||
.pollInterval(2, TimeUnit.SECONDS)
|
||||
.atMost(7, TimeUnit.SECONDS)
|
||||
.untilAsserted(() -> assertThat(postForEntityCount.get()).isEqualTo(1));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -109,28 +121,15 @@ class VictoriaMetricsDataStorageTest {
|
||||
10, Integer.MAX_VALUE, new VictoriaMetricsProperties.Compression(false)));
|
||||
victoriaMetricsDataStorage = new VictoriaMetricsDataStorage(victoriaMetricsProperties, restTemplate);
|
||||
|
||||
victoriaMetricsDataStorage.saveData(generateMockedMetricsData());
|
||||
// wait for the timer to execute its first insertion task
|
||||
Awaitility.await().atMost(5, TimeUnit.SECONDS).untilAsserted(() ->
|
||||
verify(restTemplate, times(1)).postForEntity(
|
||||
startsWith(victoriaMetricsProperties.url()),
|
||||
any(HttpEntity.class),
|
||||
eq(String.class)
|
||||
)
|
||||
);
|
||||
|
||||
// triggers the buffer size insertion condition
|
||||
for (int i = 0; i < 10 * 0.8; i++) {
|
||||
victoriaMetricsDataStorage.saveData(generateMockedMetricsData());
|
||||
}
|
||||
// wait for the timer to execute the task again
|
||||
Awaitility.await().atMost(5, TimeUnit.SECONDS).untilAsserted(() ->
|
||||
verify(restTemplate, times(2)).postForEntity(
|
||||
startsWith(victoriaMetricsProperties.url()),
|
||||
any(HttpEntity.class),
|
||||
eq(String.class)
|
||||
)
|
||||
);
|
||||
// wait for the timer to execute the task
|
||||
Awaitility.await()
|
||||
.pollInterval(1, TimeUnit.SECONDS)
|
||||
.atMost(5, TimeUnit.SECONDS)
|
||||
.untilAsserted(() -> assertThat(postForEntityCount.get()).isEqualTo(1));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -142,22 +141,47 @@ class VictoriaMetricsDataStorageTest {
|
||||
|
||||
victoriaMetricsDataStorage.saveData(generateMockedMetricsData());
|
||||
// wait for the timer to execute its first insertion task
|
||||
Awaitility.await().atMost(5, TimeUnit.SECONDS).untilAsserted(() ->
|
||||
verify(restTemplate, times(1)).postForEntity(
|
||||
startsWith(victoriaMetricsProperties.url()),
|
||||
any(HttpEntity.class),
|
||||
eq(String.class)
|
||||
)
|
||||
);
|
||||
Awaitility.await()
|
||||
.pollInterval(500, TimeUnit.MILLISECONDS)
|
||||
.atMost(5, TimeUnit.SECONDS)
|
||||
.untilAsserted(() -> assertThat(postForEntityCount.get()).isEqualTo(1));
|
||||
|
||||
victoriaMetricsDataStorage.saveData(generateMockedMetricsData());
|
||||
// wait for the flush interval to be triggered
|
||||
Awaitility.await().atMost(5, TimeUnit.SECONDS).untilAsserted(() ->
|
||||
verify(restTemplate, times(2)).postForEntity(
|
||||
startsWith(victoriaMetricsProperties.url()),
|
||||
any(),
|
||||
eq(String.class)
|
||||
));
|
||||
// wait for the flush interval to be triggered again
|
||||
Awaitility.await()
|
||||
.pollInterval(500, TimeUnit.MILLISECONDS)
|
||||
.atMost(5, TimeUnit.SECONDS)
|
||||
.untilAsserted(() -> assertThat(postForEntityCount.get()).isEqualTo(2));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testMultiThreadSaveDataBySize() {
|
||||
int threadCount = 100;
|
||||
int bufferSize = 10;
|
||||
int writeSize = (int) (bufferSize * 0.8);
|
||||
|
||||
// verify insert process for buffer size, with the flush interval defined as an unreachable state
|
||||
when(victoriaMetricsProperties.insert()).thenReturn(new VictoriaMetricsProperties.InsertConfig(
|
||||
bufferSize, Integer.MAX_VALUE, new VictoriaMetricsProperties.Compression(false)));
|
||||
victoriaMetricsDataStorage = new VictoriaMetricsDataStorage(victoriaMetricsProperties, restTemplate);
|
||||
|
||||
for (int i = 0; i < threadCount; i++) {
|
||||
new Thread(() -> {
|
||||
// triggers the buffer size insertion condition
|
||||
for (int j = 0; j < writeSize; j++) {
|
||||
victoriaMetricsDataStorage.saveData(generateMockedMetricsData());
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
// wait for the timer to execute the task
|
||||
Awaitility.await()
|
||||
.pollInterval(3, TimeUnit.SECONDS)
|
||||
.atMost(15, TimeUnit.SECONDS)
|
||||
.untilAsserted(() ->
|
||||
assertThat(postForEntityCount.get())
|
||||
// minimum flushes: ensure all data is processed (threadCount * writeSize / bufferSize)
|
||||
.isGreaterThanOrEqualTo(threadCount * writeSize / bufferSize));
|
||||
}
|
||||
|
||||
@AfterEach
|
||||
|
||||
@@ -22,7 +22,7 @@ We warmly welcome everyone to join the HertzBeat community. The community accept
|
||||
|
||||
## What is HertzBeat
|
||||
|
||||
[Apache HertzBeat](https://github.com/apache/hertzbeat) (incubating) is an easy-to-use, open source, real-time monitoring system with agentless, high performance cluster, prometheus-compatible, offers powerful custom monitoring and status page building capabilities.
|
||||
[Apache HertzBeat](https://github.com/apache/hertzbeat) is an easy-to-use, open source, real-time monitoring system with agentless, high performance cluster, prometheus-compatible, offers powerful custom monitoring and status page building capabilities.
|
||||
|
||||
### Features
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ tags: [opensource, practice]
|
||||
keywords: [open source, monitoring, alerting]
|
||||
---
|
||||
|
||||
**Hi guys, We are excited to announce that Apache HertzBeat (incubating) has released its first Apache version v1.6.0! 🎉.**
|
||||
**Hi guys, We are excited to announce that Apache HertzBeat has released its first Apache version v1.6.0! 🎉.**
|
||||
|
||||
Through nearly five months of community development iteration and two months of Apache Incubator incubation process, Apache HertzBeat (incubating) v1.6.0 is finally out.
|
||||
Through nearly five months of community development iteration and two months of Apache Incubator incubation process, Apache HertzBeat v1.6.0 is finally out.
|
||||
In this version, we added monitoring for OpenAi, Redfish protocol servers, plugin mechanism, and support for NebulaGraph, Apache Yarn, HDFS, Hbase, Storm, and more functional features.
|
||||
Due to license compatibility issues, we replaced multiple dependencies at the bottom layer, Hibernate -> EclipseLink, which is also a rare migration pitfall practice in the JPA ecosystem.
|
||||
At the same time, some bugs were fixed and some functions were optimized, and more complete documents. Welcome everyone to try to use, put forward valuable opinions and suggestions, and promote the development of HertzBeat together.
|
||||
@@ -23,7 +23,7 @@ Upgrade Guide: <https://hertzbeat.apache.org/blog/2024/06/11/hertzbeat-v1.6.0-up
|
||||
|
||||
## What is HertzBeat?
|
||||
|
||||
[Apache HertzBeat](https://github.com/apache/hertzbeat) (incubating) is an easy-to-use, open source, real-time monitoring system with agentless, high performance cluster, prometheus-compatible, offers powerful custom monitoring and status page building capabilities.
|
||||
[Apache HertzBeat](https://github.com/apache/hertzbeat) is an easy-to-use, open source, real-time monitoring system with agentless, high performance cluster, prometheus-compatible, offers powerful custom monitoring and status page building capabilities.
|
||||
|
||||
## Features
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ title: Quick Tutorial Customize and adapt a monitoring based on HTTP protocol
|
||||
sidebar_label: Tutorial Case
|
||||
---
|
||||
|
||||
Through this tutorial, we describe step by step how to customize and adapt a monitoring type based on the http protocol under the Apache HertzBeat (incubating).
|
||||
Through this tutorial, we describe step by step how to customize and adapt a monitoring type based on the http protocol under the Apache HertzBeat.
|
||||
|
||||
Before reading this tutorial, we hope that you are familiar with how to customize types, metrics, protocols, etc. from [Custom Monitoring](extend-point) and [Http Protocol Customization](extend-http).
|
||||
|
||||
|
||||
@@ -61,9 +61,8 @@ writing documentation, maintaining issues boards, code review, or answering
|
||||
community questions) to HertzBeat either by contributing to the codebase
|
||||
of the main website or HertzBeat's GitHub repositories.
|
||||
|
||||
- +3 months with light activity and engagement.
|
||||
- +2 months of medium activity and engagement.
|
||||
- +1 month with solid activity and engagement.
|
||||
- 3+ months with activity and engagement.
|
||||
- 20+ pr coding, document, test or other contributions.
|
||||
|
||||
### Quality of contributions
|
||||
|
||||
|
||||
@@ -61,9 +61,7 @@ writing documentation, maintaining issues boards, code review, or answering
|
||||
community questions) to HertzBeat either by contributing to the codebase
|
||||
of the main website or HertzBeat's GitHub repositories.
|
||||
|
||||
- +5 months with light activity and engagement.
|
||||
- +4 months of medium activity and engagement.
|
||||
- +3 month with solid activity and engagement.
|
||||
- 12+ months with activity and engagement.
|
||||
|
||||
### Quality of contributions
|
||||
|
||||
|
||||
@@ -213,9 +213,9 @@ mvn clean package -Pcluster
|
||||
|
||||
The release package are here:
|
||||
|
||||
- `dist/apache-hertzbeat-{version}-incubating-bin.tar.gz`
|
||||
- `dist/apache-hertzbeat-collector-{version}-incubating-bin.tar.gz`
|
||||
- `dist/apache-hertzbeat-{version}-incubating-docker-compose.tar.gz`
|
||||
- `dist/apache-hertzbeat-{version}-bin.tar.gz`
|
||||
- `dist/apache-hertzbeat-collector-{version}-bin.tar.gz`
|
||||
- `dist/apache-hertzbeat-{version}-docker-compose.tar.gz`
|
||||
|
||||
#### 3.4 Package the source code
|
||||
|
||||
@@ -224,12 +224,12 @@ The release package are here:
|
||||
```shell
|
||||
git archive \
|
||||
--format=tar.gz \
|
||||
--output="dist/apache-hertzbeat-1.6.0-incubating-src.tar.gz" \
|
||||
--prefix=apache-hertzbeat-1.6.0-incubating-src/ \
|
||||
--output="dist/apache-hertzbeat-1.6.0-src.tar.gz" \
|
||||
--prefix=apache-hertzbeat-1.6.0-src/ \
|
||||
release-1.6.0-rc1
|
||||
```
|
||||
|
||||
The archive package is here `dist/apache-hertzbeat-1.6.0-incubating-src.tar.gz`
|
||||
The archive package is here `dist/apache-hertzbeat-1.6.0-src.tar.gz`
|
||||
|
||||
### Sign package
|
||||
|
||||
@@ -252,18 +252,18 @@ for i in *.tar.gz; do echo $i; sha512sum $i > $i.sha512 ; done
|
||||
> The final file list is as follows
|
||||
|
||||
```text
|
||||
apache-hertzbeat-1.6.0-incubating-src.tar.gz
|
||||
apache-hertzbeat-1.6.0-incubating-src.tar.gz.asc
|
||||
apache-hertzbeat-1.6.0-incubating-src.tar.gz.sha512
|
||||
apache-hertzbeat-1.6.0-incubating-bin.tar.gz
|
||||
apache-hertzbeat-1.6.0-incubating-bin.tar.gz.asc
|
||||
apache-hertzbeat-1.6.0-incubating-bin.tar.gz.sha512
|
||||
apache-hertzbeat-1.6.0-incubating-docker-compose.tar.gz
|
||||
apache-hertzbeat-1.6.0-incubating-docker-compose.tar.gz.asc
|
||||
apache-hertzbeat-1.6.0-incubating-docker-compose.tar.gz.sha512
|
||||
apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz
|
||||
apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz.asc
|
||||
apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz.sha512
|
||||
apache-hertzbeat-1.6.0-src.tar.gz
|
||||
apache-hertzbeat-1.6.0-src.tar.gz.asc
|
||||
apache-hertzbeat-1.6.0-src.tar.gz.sha512
|
||||
apache-hertzbeat-1.6.0-bin.tar.gz
|
||||
apache-hertzbeat-1.6.0-bin.tar.gz.asc
|
||||
apache-hertzbeat-1.6.0-bin.tar.gz.sha512
|
||||
apache-hertzbeat-1.6.0-docker-compose.tar.gz
|
||||
apache-hertzbeat-1.6.0-docker-compose.tar.gz.asc
|
||||
apache-hertzbeat-1.6.0-docker-compose.tar.gz.sha512
|
||||
apache-hertzbeat-collector-1.6.0-bin.tar.gz
|
||||
apache-hertzbeat-collector-1.6.0-bin.tar.gz.asc
|
||||
apache-hertzbeat-collector-1.6.0-bin.tar.gz.sha512
|
||||
```
|
||||
|
||||
#### 3.6 Verify signature
|
||||
@@ -274,15 +274,15 @@ $ cd dist
|
||||
# Verify signature
|
||||
$ for i in *.tar.gz; do echo $i; gpg --verify $i.asc $i ; done
|
||||
|
||||
apache-hertzbeat-1.6.0-incubating-src.tar.gz
|
||||
apache-hertzbeat-1.6.0-src.tar.gz
|
||||
gpg: Signature made Tue May 2 12:16:35 2023 CST
|
||||
gpg: using RSA key 85778A4CE4DD04B7E07813ABACFB69E705016886
|
||||
gpg: Good signature from "muchunjin (apache key) <muchunjin@apache.org>" [ultimate]
|
||||
apache-hertzbeat_2.11-1.6.0-incubating-bin.tar.gz
|
||||
apache-hertzbeat_2.11-1.6.0-bin.tar.gz
|
||||
gpg: Signature made Tue May 2 12:16:36 2023 CST
|
||||
gpg: using RSA key 85778A4CE4DD04B7E07813ABACFB69E705016886
|
||||
gpg: Good signature from "muchunjin (apache key) <muchunjin@apache.org>" [ultimate]
|
||||
apache-hertzbeat_2.12-1.6.0-incubating-bin.tar.gz
|
||||
apache-hertzbeat_2.12-1.6.0-bin.tar.gz
|
||||
gpg: Signature made Tue May 2 12:16:37 2023 CST
|
||||
gpg: using RSA key 85778A4CE4DD04B7E07813ABACFB69E705016886
|
||||
gpg: BAD signature from "muchunjin (apache key) <muchunjin@apache.org>" [ultimate]
|
||||
@@ -290,14 +290,14 @@ gpg: BAD signature from "muchunjin (apache key) <muchunjin@apache.org>" [ultimat
|
||||
# Verify SHA512
|
||||
$ for i in *.tar.gz; do echo $i; sha512sum --check $i.sha512; done
|
||||
|
||||
apache-hertzbeat-1.6.0-incubating-src.tar.gz
|
||||
apache-hertzbeat-1.6.0-incubating-src.tar.gz: OK
|
||||
apache-hertzbeat-1.6.0-incubating-bin.tar.gz
|
||||
apache-hertzbeat-1.6.0-incubating-bin.tar.gz: OK
|
||||
apache-hertzbeat-1.6.0-incubating-docker-compose.tar.gz
|
||||
apache-hertzbeat-1.6.0-incubating-docker-compose.tar.gz: OK
|
||||
apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz
|
||||
apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz: OK
|
||||
apache-hertzbeat-1.6.0-src.tar.gz
|
||||
apache-hertzbeat-1.6.0-src.tar.gz: OK
|
||||
apache-hertzbeat-1.6.0-bin.tar.gz
|
||||
apache-hertzbeat-1.6.0-bin.tar.gz: OK
|
||||
apache-hertzbeat-1.6.0-docker-compose.tar.gz
|
||||
apache-hertzbeat-1.6.0-docker-compose.tar.gz: OK
|
||||
apache-hertzbeat-collector-1.6.0-bin.tar.gz
|
||||
apache-hertzbeat-collector-1.6.0-bin.tar.gz: OK
|
||||
```
|
||||
|
||||
#### 3.7 Publish the dev directory of the Apache SVN material package
|
||||
@@ -350,13 +350,13 @@ svn commit -m "release for HertzBeat 1.6.0"
|
||||
Send a voting email in the community requires at least three `+1` and no `-1`.
|
||||
|
||||
> `Send to`: <dev@hertzbeat.apache.org> <br />
|
||||
> `Title`: [VOTE] Release Apache HertzBeat (incubating) 1.6.0 rc1 <br />
|
||||
> `Title`: [VOTE] Release Apache HertzBeat 1.6.0 rc1 <br />
|
||||
> `Body`:
|
||||
|
||||
```text
|
||||
Hello HertzBeat Community:
|
||||
|
||||
This is a call for vote to release Apache HertzBeat (incubating) version release-1.6.0-RC1.
|
||||
This is a call for vote to release Apache HertzBeat version release-1.6.0-RC1.
|
||||
|
||||
Apache HertzBeat - a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities.
|
||||
|
||||
@@ -406,13 +406,13 @@ Thanks!
|
||||
After 72 hours, the voting results will be counted, and the voting result email will be sent, as follows.
|
||||
|
||||
> `Send to`: <dev@hertzbeat.apache.org> <br />
|
||||
> `Title`: [RESULT]\[VOTE\] Release Apache HertzBeat (incubating) 1.6.0-rc1 <br />
|
||||
> `Title`: [RESULT]\[VOTE\] Release Apache HertzBeat 1.6.0-rc1 <br />
|
||||
> `Body`:
|
||||
|
||||
```text
|
||||
Dear HertzBeat community,
|
||||
|
||||
Thanks for your review and vote for "Release Apache HertzBeat (incubating) 1.6.0-rc1"
|
||||
Thanks for your review and vote for "Release Apache HertzBeat 1.6.0-rc1"
|
||||
I'm happy to announce the vote has passed:
|
||||
---
|
||||
4 binding +1, from:
|
||||
@@ -441,14 +441,14 @@ One item of the email content is `Vote thread`, and the link is obtained here: <
|
||||
Send a voting email in the incubator community requires at least three `+1` and no `-1`.
|
||||
|
||||
> `Send to`: <general@incubator.apache.org> <br />
|
||||
> `Title`: [VOTE] Release Apache HertzBeat (incubating) 1.6.0-rc1 <br />
|
||||
> `Title`: [VOTE] Release Apache HertzBeat 1.6.0-rc1 <br />
|
||||
> `Body`:
|
||||
|
||||
```text
|
||||
Hello Incubator Community:
|
||||
|
||||
This is a call for a vote to release Apache HertzBeat (incubating) version 1.6.0-RC1.
|
||||
The Apache HertzBeat community has voted on and approved a proposal to release Apache HertzBeat (incubating) version 1.6.0-RC1.
|
||||
This is a call for a vote to release Apache HertzBeat version 1.6.0-RC1.
|
||||
The Apache HertzBeat community has voted on and approved a proposal to release Apache HertzBeat version 1.6.0-RC1.
|
||||
We now kindly request the Incubator PPMC members review and vote on this incubator release.
|
||||
Apache HertzBeat, a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities.
|
||||
|
||||
@@ -486,7 +486,7 @@ https://hertzbeat.apache.org/docs/community/development/#build-hertzbeat-binary-
|
||||
---
|
||||
Thanks,
|
||||
|
||||
On behalf of Apache HertzBeat (incubating) community
|
||||
On behalf of Apache HertzBeat community
|
||||
---
|
||||
Best,
|
||||
ChunJin Mu
|
||||
@@ -507,13 +507,13 @@ Chunjin Mu
|
||||
Then the voting results will be counted, and the voting result email will be sent, as follows.
|
||||
|
||||
> `Send to`: <general@incubator.apache.org> <br />
|
||||
> `Title`: [RESULT]\[VOTE\] Release Apache HertzBeat (incubating) 1.6.0-rc1 <br />
|
||||
> `Title`: [RESULT]\[VOTE\] Release Apache HertzBeat 1.6.0-rc1 <br />
|
||||
> `Body`:
|
||||
|
||||
```text
|
||||
Hi Incubator Community,
|
||||
|
||||
The vote to release Apache HertzBeat (incubating) 1.6.0-rc4 has passed with 3 +1 binding and no +0 or -1 votes.
|
||||
The vote to release Apache HertzBeat 1.6.0-rc4 has passed with 3 +1 binding and no +0 or -1 votes.
|
||||
|
||||
3 binding votes, no +0 or -1 votes.
|
||||
|
||||
@@ -584,13 +584,13 @@ The rename the release-1.6.0-rc1 branch to release-1.6.0.
|
||||
|
||||
> `Send to`: <general@incubator.apache.org> <br />
|
||||
> `cc`: <dev@hertzbeat.apache.org> <br />
|
||||
> `Title`: [ANNOUNCE] Apache HertzBeat (incubating) 1.6.0 released <br />
|
||||
> `Title`: [ANNOUNCE] Apache HertzBeat 1.6.0 released <br />
|
||||
> `Body`:
|
||||
|
||||
```text
|
||||
Hi Community,
|
||||
|
||||
We are glad to announce the release of Apache HertzBeat (incubating) 1.6.0.
|
||||
We are glad to announce the release of Apache HertzBeat 1.6.0.
|
||||
Thanks again for your help.
|
||||
|
||||
Apache HertzBeat (https://hertzbeat.apache.org/) - a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities.
|
||||
|
||||
@@ -91,7 +91,7 @@ check result
|
||||
> If something like the following appears, it means the signature is correct. Keyword: **`Good signature`**
|
||||
|
||||
```shell
|
||||
apache-hertzbeat-xxx-incubating-src.tar.gz
|
||||
apache-hertzbeat-xxx-src.tar.gz
|
||||
gpg: Signature made XXXX
|
||||
gpg: using RSA key XXXXX
|
||||
gpg: Good signature from "xxx @apache.org>"
|
||||
@@ -105,18 +105,16 @@ for i in *.tar.gz; do echo $i; sha512sum --check $i.sha512; done
|
||||
|
||||
#### 2.4 Check the binary package
|
||||
|
||||
unzip `apache-hertzbeat-${release.version}-incubating-bin.tar.gz`
|
||||
unzip `apache-hertzbeat-${release.version}-bin.tar.gz`
|
||||
|
||||
```shell
|
||||
tar -xzvf apache-hertzbeat-${release.version}-incubating-bin.tar.gz
|
||||
tar -xzvf apache-hertzbeat-${release.version}-bin.tar.gz
|
||||
```
|
||||
|
||||
check as follows:
|
||||
|
||||
- [ ] Check whether the source package contains unnecessary files, which makes the tar package too large
|
||||
- [ ] Folder contains the word `incubating`
|
||||
- [ ] There are `LICENSE` and `NOTICE` files
|
||||
- [ ] There is a `DISCLAIMER` or `DISCLAIMER-WIP` file
|
||||
- [ ] The year in the `NOTICE` file is correct
|
||||
- [ ] Only text files exist, not binary files
|
||||
- [ ] All files have ASF license at the beginning
|
||||
@@ -127,10 +125,10 @@ check as follows:
|
||||
|
||||
> If the binary/web-binary package is uploaded, check the binary package.
|
||||
|
||||
Unzip `apache-hertzbeat-${release_version}-incubating-src.tar.gz`
|
||||
Unzip `apache-hertzbeat-${release_version}-src.tar.gz`
|
||||
|
||||
```shell
|
||||
cd apache-hertzbeat-${release_version}-incubating-src
|
||||
cd apache-hertzbeat-${release_version}-src
|
||||
```
|
||||
|
||||
compile the source code: [Build HertzBeat Binary Package](https://hertzbeat.apache.org/docs/community/development/#build-hertzbeat-binary-package)
|
||||
@@ -138,7 +136,6 @@ compile the source code: [Build HertzBeat Binary Package](https://hertzbeat.apac
|
||||
and check as follows:
|
||||
|
||||
- [ ] There are `LICENSE` and `NOTICE` files
|
||||
- [ ] There is a `DISCLAIMER` or `DISCLAIMER-WIP` file
|
||||
- [ ] The year in the `NOTICE` file is correct
|
||||
- [ ] All text files have ASF license at the beginning
|
||||
- [ ] Check the third-party dependent license:
|
||||
|
||||
@@ -273,7 +273,7 @@ Subject: [ANNOUNCE] New committer: ${NEW_COMMITTER_NAME}
|
||||
```text
|
||||
Hello Community,
|
||||
|
||||
The Podling Project Management Committee (PPMC) for Apache HertzBeat (incubating)
|
||||
The Podling Project Management Committee (PPMC) for Apache HertzBeat
|
||||
has invited ${NEW_COMMITTER_NAME} to become a committer and we are pleased to
|
||||
announce that he has accepted.
|
||||
|
||||
|
||||
@@ -280,5 +280,5 @@ submission process. This should enable better productivity.
|
||||
A PPMC member helps manage and guide the direction of the project.
|
||||
|
||||
Thanks,
|
||||
On behalf of the Apache HertzBeat (incubating) PPMC
|
||||
On behalf of the Apache HertzBeat PPMC
|
||||
```
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
id: download
|
||||
title: Download Apache HertzBeat (incubating)
|
||||
title: Download Apache HertzBeat
|
||||
sidebar_label: Download
|
||||
---
|
||||
|
||||
> **Here is the Apache HertzBeat (incubating) official download page.**
|
||||
> **Here is the Apache HertzBeat official download page.**
|
||||
> **Please choose version to download from the following tables. It is recommended use the latest.**
|
||||
|
||||
:::tip
|
||||
|
||||
@@ -5,7 +5,7 @@ sidebar_label: Collector
|
||||
keywords: [monitoring, observability, collector, metrics]
|
||||
---
|
||||
|
||||
> HertzBeat Collector is a lightweight data collection module that enables metrics collection, high availability deployments, and cloud-edge collaboration in Apache HertzBeat (incubating).
|
||||
> HertzBeat Collector is a lightweight data collection module that enables metrics collection, high availability deployments, and cloud-edge collaboration in Apache HertzBeat.
|
||||
|
||||
## Introduction
|
||||
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
---
|
||||
id: dolphinscheduler
|
||||
title: Monitoring: Apache DolphinScheduler
|
||||
sidebar_label: Apache DolphinScheduler
|
||||
keywords: [ Open Source Monitoring System, Monitor Apache DolphinScheduler ]
|
||||
---
|
||||
|
||||
> Collect monitoring metrics for Apache DolphinScheduler.
|
||||
|
||||
## Pre-monitoring operations
|
||||
|
||||
> Support Apache DolphinScheduler version 3.3.0 or later
|
||||
|
||||
You need to create a token in Apache DolphinScheduler.
|
||||
|
||||
Please refer to [Open API](https://dolphinscheduler.apache.org/zh-cn/docs/3.2.2/guide/api/open-api) to create a new token.The main steps are as follows
|
||||
|
||||
1. Log in to the Apache DolphinScheduler system, click "Security", then click "Token manage" on the left, and click "Create token" to create a token.
|
||||
2. Select the "Expiration time" (Token validity time), select "User" (choose the specified user to perform the API operation), click "Generate token", copy the Token string, and click "Submit".
|
||||
|
||||
## Configuration Parameters
|
||||
|
||||
| Parameter Name | Parameter Help Description |
|
||||
|---------------------|-----------------------------------------------------------------------------------------------------------------|
|
||||
| Target Host | The monitored endpoint's IPV4, IPV6, or domain name. Note ⚠️ no protocol header (e.g., https://, http://). |
|
||||
| Task Name | The name that identifies this monitoring task, which needs to be unique. |
|
||||
| Port | The monitoring port opened by DolphinScheduler, default value: 12345. |
|
||||
| SSL | Whether SSL is enabled for connecting to DolphinScheduler. |
|
||||
| Token | Apache DolphinScheduler token string. |
|
||||
| Query Timeout | Set the timeout for unresponsive queries, in milliseconds (ms), default 6000 ms. |
|
||||
| Collection Interval | The interval time for periodic data collection, in seconds; the minimum interval that can be set is 30 seconds. |
|
||||
| Binding Tags | Used for categorizing and managing monitoring resources. |
|
||||
| Description Notes | Additional identification and description notes for this monitoring; users can add notes here. |
|
||||
|
||||
## Collected Metrics
|
||||
|
||||
### Metric Set: Master
|
||||
|
||||
| Metric Name | Metric Unit | Metric Help Description |
|
||||
|----------------|---------------|-------------------------|
|
||||
| host | None | Host |
|
||||
| port | None | Port |
|
||||
| serverStatus | None | Server Status |
|
||||
| processId | None | Process Id |
|
||||
| runningTime | Day | Running Time |
|
||||
| cpuUsage | Percentage(%) | CPU Usage |
|
||||
| memoryUsage | Percentage(%) | Memory Usage |
|
||||
| diskUsage | Percentage(%) | Disk Usage |
|
||||
| jvmCpuUsage | Percentage(%) | JVM CPU Usage |
|
||||
| jvmMemoryUsage | Percentage(%) | JVM Memory Usage |
|
||||
| jvmHeapUsed | None | JVM Heap Used |
|
||||
| jvmNonHeapUsed | None | JVM NonHeap Used |
|
||||
| jvmHeapMax | None | JVM Heap Max |
|
||||
| jvmNonHeapMax | None | JVM NonHeap Max |
|
||||
|
||||
### Metric Set: Worker
|
||||
|
||||
| Metric Name | Metric Unit | Metric Help Description |
|
||||
|------------------|---------------|-------------------------|
|
||||
| host | None | Host |
|
||||
| port | None | Port |
|
||||
| serverStatus | None | Server Status |
|
||||
| processId | None | Process Id |
|
||||
| runningTime | Day | Running Time |
|
||||
| cpuUsage | Percentage(%) | CPU Usage |
|
||||
| memoryUsage | Percentage(%) | Memory Usage |
|
||||
| diskUsage | Percentage(%) | Disk Usage |
|
||||
| jvmCpuUsage | Percentage(%) | JVM CPU Usage |
|
||||
| jvmMemoryUsage | Percentage(%) | JVM Memory Usage |
|
||||
| jvmHeapUsed | None | JVM Heap Used |
|
||||
| jvmNonHeapUsed | None | JVM NonHeap Used |
|
||||
| jvmHeapMax | None | JVM Heap Max |
|
||||
| jvmNonHeapMax | None | JVM NonHeap Max |
|
||||
| workerHostWeight | None | Weight |
|
||||
| threadPoolUsage | None | Thread Pool Usage |
|
||||
| workerGroup | None | Worker Group |
|
||||
|
||||
### Metric Set: Alert Server
|
||||
|
||||
| Metric Name | Metric Unit | Metric Help Description |
|
||||
|----------------|---------------|-------------------------|
|
||||
| host | None | Host |
|
||||
| port | None | Port |
|
||||
| serverStatus | None | Server Status |
|
||||
| processId | None | Process Id |
|
||||
| runningTime | Day | Running Time |
|
||||
| cpuUsage | Percentage(%) | CPU Usage |
|
||||
| memoryUsage | Percentage(%) | Memory Usage |
|
||||
| diskUsage | Percentage(%) | Disk Usage |
|
||||
| jvmCpuUsage | Percentage(%) | JVM CPU Usage |
|
||||
| jvmMemoryUsage | Percentage(%) | JVM Memory Usage |
|
||||
| jvmHeapUsed | None | JVM Heap Used |
|
||||
| jvmNonHeapUsed | None | JVM NonHeap Used |
|
||||
| jvmHeapMax | None | JVM Heap Max |
|
||||
| jvmNonHeapMax | None | JVM NonHeap Max |
|
||||
|
||||
### Metric Set: Database
|
||||
|
||||
| Metric Name | Metric Unit | Metric Help Description |
|
||||
|---------------------------|-------------|-----------------------------|
|
||||
| dbType | None | Database Type |
|
||||
| state | None | State |
|
||||
| maxConnections | None | Max Connections |
|
||||
| threadsConnections | None | Threads Connections |
|
||||
| threadsRunningConnections | Day | Threads Running Connections |
|
||||
@@ -0,0 +1,72 @@
|
||||
---
|
||||
id: mcp_sse_server
|
||||
title: MCP SSE Server
|
||||
sidebar_label: MCP SSE Server
|
||||
keywords: [MCP, SSE, streaming, server]
|
||||
---
|
||||
|
||||
This page explains how connect to the HertzBeat MCP SSE server. The MCP server auto starts on the default port 1157 when you start the HertzBeat server.
|
||||
|
||||
### Overview
|
||||
|
||||
- Provides a Server‑Sent Events (SSE) stream for tool calling.
|
||||
- Intended for MCP integrations and clients that consume streaming events.
|
||||
|
||||
### Connect to the MCP server
|
||||
|
||||
Make sure that hertzbeat server is up and running. If you are using any other port than 1157, replace the following accordingly
|
||||
|
||||
- URL: `http://localhost:1157/api/sse`
|
||||
|
||||
### Authentication
|
||||
|
||||
You must authenticate each request using one of the following methods:
|
||||
|
||||
- JWT bearer token
|
||||
|
||||
- Header: `Authorization: Bearer <your-jwt-token>`
|
||||
|
||||
- Basic authentication
|
||||
- Header: `Authorization: Basic <base64(username:password)>`
|
||||
|
||||
### Cursor MCP configuration
|
||||
|
||||
Create or edit `.cursor/mcp.json` in your home directory or project root.
|
||||
|
||||
Basic auth:
|
||||
|
||||
```json
|
||||
{
|
||||
"Hertzbeat-MCP": {
|
||||
"url": "http://localhost:1157/api/sse",
|
||||
"headers": {
|
||||
"Authorization": "Basic <base64(username:password)>"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
JWT bearer:
|
||||
|
||||
```json
|
||||
{
|
||||
"Hertzbeat-MCP": {
|
||||
"url": "http://localhost:1157/api/sse",
|
||||
"headers": {
|
||||
"Authorization": "Bearer <your-jwt-token>"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
After saving, reload MCP in Cursor or restart the editor.
|
||||
|
||||
### Tools available
|
||||
|
||||
- list_monitors: Returns the list of names of all configured monitors.
|
||||
|
||||
More tools are coming soon to expand management and query capabilities.
|
||||
|
||||
### Notes
|
||||
|
||||
- If the connection drops, reconnect using the same headers.
|
||||
+108
-5
@@ -15,13 +15,13 @@ keywords: [open source monitoring tool, open source database monitoring tool, mo
|
||||
|
||||
### Configuration parameter
|
||||
|
||||
| Parameter name | Parameter help description |
|
||||
| Parameter name | Parameter help description |
|
||||
|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Monitoring Host | Monitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://) |
|
||||
| Monitoring name | Identify the name of this monitoring. The name needs to be unique |
|
||||
| Port | Port provided by the database. The default is 1521 |
|
||||
| Query timeout | Set the timeout time when SQL query does not respond to data, unit: ms, default: 3000ms |
|
||||
| Database name | Database instance name, optional |
|
||||
| Database name | Database instance name, optionalIf you need to use a dba user, you can fill in like "sys as sysdba". |
|
||||
| Username | Database connection user name, optional |
|
||||
| Password | Database connection password, optional |
|
||||
| URL | Database connection URL,optional,If configured, the database name, user name, password and other parameters in the URL will overwrite the above configured parameters |
|
||||
@@ -36,7 +36,6 @@ keywords: [open source monitoring tool, open source database monitoring tool, mo
|
||||
| Metric name | Metric unit | Metric help description |
|
||||
|------------------|-------------|-------------------------|
|
||||
| database_version | none | Database version |
|
||||
| database_type | none | Database type |
|
||||
| hostname | none | Host name |
|
||||
| instance_name | none | Database instance name |
|
||||
| startup_time | none | Database start time |
|
||||
@@ -53,13 +52,31 @@ keywords: [open source monitoring tool, open source database monitoring tool, mo
|
||||
| bytes | MB | Size |
|
||||
| blocks | none | Number of blocks |
|
||||
|
||||
#### Metric set:user_connect
|
||||
#### Metric set:total_sessions
|
||||
|
||||
| Metric name | Metric unit | Metric help description |
|
||||
|-------------|-------------|---------------------------|
|
||||
| username | none | Username |
|
||||
| counts | number | Current connection counts |
|
||||
|
||||
#### Metric set:active_sessions
|
||||
|
||||
| Metric name | Metric unit | Metric help description |
|
||||
|-------------|-------------|-------------------------|
|
||||
| counts | number | Active sessions counts |
|
||||
|
||||
#### Metric set:background_sessions
|
||||
|
||||
| Metric name | Metric unit | Metric help description |
|
||||
|-------------|-------------|----------------------------|
|
||||
| counts | number | Background sessions counts |
|
||||
|
||||
#### Metric set:connection
|
||||
|
||||
| Metric name | Metric unit | Metric help description |
|
||||
|-------------|-------------|-------------------------|
|
||||
| username | none | User name |
|
||||
| counts | number | User sessions counts |
|
||||
|
||||
#### Metric set:performance
|
||||
|
||||
| Metric name | Metric unit | Metric help description |
|
||||
@@ -67,3 +84,89 @@ keywords: [open source monitoring tool, open source database monitoring tool, mo
|
||||
| qps | QPS | I/O Requests per second |
|
||||
| tps | TPS | User transaction per second |
|
||||
| mbps | MBPS | I/O Megabytes per second |
|
||||
|
||||
#### Metric set:percentage
|
||||
|
||||
| Metric name | Metric unit | Metric help description |
|
||||
|-----------------|---------------|-------------------------|
|
||||
| tablespace_name | none | Tablespace name |
|
||||
| total | none | Total |
|
||||
| used | none | Used |
|
||||
| free | none | Free |
|
||||
| used_percentage | percentage(%) | Used Percentage |
|
||||
| free_percentage | percentage(%) | Free Percentage |
|
||||
|
||||
#### Metric set:process
|
||||
|
||||
| Metric name | Metric unit | Metric help description |
|
||||
|---------------|-------------|-------------------------|
|
||||
| process_count | none | Process count |
|
||||
|
||||
#### Metric set:transaction
|
||||
|
||||
| Metric name | Metric unit | Metric help description |
|
||||
|-------------|-------------|-------------------------|
|
||||
| commits | t/s | User Commits Per Sec |
|
||||
| rollbacks | t/s | User Rollbacks Per Sec |
|
||||
|
||||
#### Metric set:wait
|
||||
|
||||
| Metric name | Metric unit | Metric help description |
|
||||
|----------------------|-------------|-------------------------|
|
||||
| concurrent_wait_time | ms | Concurrent Wait Time |
|
||||
| commit_wait_time | ms | Commit Wait Time |
|
||||
| app_wait_time | ms | Application Wait Time |
|
||||
| network_wait_time | ms | Network Wait Time |
|
||||
| system_io_wait_time | ms | System I/O Wait Time |
|
||||
| user_io_wait_time | ms | User I/O Wait Time |
|
||||
| configure_wait_time | ms | Configure Wait Time |
|
||||
| scheduler_wait_time | ms | Scheduler Wait Time |
|
||||
|
||||
#### Metric set:cpu_stats
|
||||
|
||||
| Metric name | Metric unit | Metric help description |
|
||||
|-------------|-------------|-------------------------|
|
||||
| type | none | Type |
|
||||
| num | none | Num |
|
||||
|
||||
#### Metric set:mem_stats
|
||||
|
||||
| Metric name | Metric unit | Metric help description |
|
||||
|-------------|-------------|-------------------------|
|
||||
| type | none | Type |
|
||||
| num | none | Num |
|
||||
|
||||
#### Metric set:cache_hit_ratio
|
||||
|
||||
| Metric name | Metric unit | Metric help description |
|
||||
|------------------------|-------------|-------------------------|
|
||||
| lib_cache_hit_ratio | none | Library Cache Hit Ratio |
|
||||
| buffer_cache_hit_ratio | none | Buffer Cache Hit Ratio |
|
||||
|
||||
#### Metric set:slow_query
|
||||
|
||||
| Metric name | Metric unit | Metric help description |
|
||||
|----------------|-------------|-------------------------|
|
||||
| sql_id | none | SQL ID |
|
||||
| child_number | none | Child Number |
|
||||
| executions | none | EXECUTIONS |
|
||||
| per_secs | seconds | Per Secs |
|
||||
| cpu_secs | seconds | CPU Secs |
|
||||
| buffer_gets | none | Buffer Gets |
|
||||
| disk_reads | none | Disk Reads |
|
||||
| fetches | none | Fetches |
|
||||
| parse_calls | none | Parse Calls |
|
||||
| optimizer_cost | none | Optimizer Cost |
|
||||
| sql_text | none | SQL Text |
|
||||
|
||||
#### Metric set:users
|
||||
|
||||
| Metric name | Metric unit | Metric help description |
|
||||
|---------------------|-------------|---------------------------------------------------------------------------------------------------|
|
||||
| username | none | User Name |
|
||||
| account_status | none | Account Status |
|
||||
| lock_date | none | If the account status is LOCKED, the date and time when the account was locked will be displayed. |
|
||||
| expiry_date | none | Password Expiry Date |
|
||||
| expiry_seconds | seconds | Password Validity Period Remaining |
|
||||
| created | none | Creation Date |
|
||||
| authentication_type | none | Authentication Type |
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
---
|
||||
id: spring_gateway
|
||||
Title: Monitoring Spring Gateway
|
||||
sidebar_label: Spring Gateway
|
||||
keywords: [open source monitoring tool, open source spring gateway monitoring tool, monitoring spring gateway metrics]
|
||||
Title: Monitoring Spring Cloud Gateway
|
||||
sidebar_label: Spring Cloud Gateway
|
||||
keywords: [open source monitoring tool, open source Spring Cloud Gateway monitoring tool, monitoring Spring Cloud Gateway metrics]
|
||||
---
|
||||
|
||||
> Collect and monitor the general performance metrics exposed by the SpringBoot actuator.
|
||||
|
||||
## Pre-monitoring operations
|
||||
|
||||
If you want to monitor information in 'Spring Gateway' with this monitoring type, you need to integrate your SpringBoot application and enable the SpringBoot Actuator.
|
||||
If you want to monitor information in `Spring Cloud Gateway` with this monitoring type, you need to integrate your `Spring Cloud Gateway` application and enable the SpringBoot Actuator.
|
||||
|
||||
**1、Add POM .XML dependencies:**
|
||||
|
||||
@@ -26,25 +26,26 @@ If you want to monitor information in 'Spring Gateway' with this monitoring type
|
||||
management:
|
||||
endpoint:
|
||||
gateway:
|
||||
enabled: true # default value
|
||||
enabled: true
|
||||
env:
|
||||
show-values: ALWAYS
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
enabled-by-default: on
|
||||
include: "*"
|
||||
```
|
||||
|
||||
### Configure parameters
|
||||
|
||||
| Parameter name | Parameter Help describes the |
|
||||
|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|
|
||||
| Monitor Host | THE MONITORED PEER IPV4, IPV6 OR DOMAIN NAME. Note ⚠️ that there are no protocol headers (eg: https://, http://). |
|
||||
| Monitoring Name | A name that identifies this monitoring that needs to be unique. |
|
||||
| Port | The default port provided by the database is 8080. |
|
||||
| Enable HTTPS | Whether to access the website through HTTPS, please note that ⚠️ when HTTPS is enabled, the default port needs to be changed to 443 |
|
||||
| The acquisition interval is | Monitor the periodic data acquisition interval, in seconds, and the minimum interval that can be set is 30 seconds |
|
||||
| Whether to probe the | Whether to check the availability of the monitoring before adding a monitoring is successful, and the new modification operation | will continue only if the probe is successful |
|
||||
| Description Comment | For more information identifying and describing the remarks for this monitoring, users can remark the information here |
|
||||
| Parameter name | Parameter Help describes the |
|
||||
|-----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Monitor Host | THE MONITORED PEER IPV4, IPV6 OR DOMAIN NAME. Note ⚠️ that there are no protocol headers (eg: https://, http://). |
|
||||
| Monitoring Name | A name that identifies this monitoring that needs to be unique. |
|
||||
| Port | The default port provided by the database is 8080. |
|
||||
| Enable HTTPS | Whether to access the website through HTTPS, please note that ⚠️ when HTTPS is enabled, the default port needs to be changed to 443 |
|
||||
| The acquisition interval is | Monitor the periodic data acquisition interval, in seconds, and the minimum interval that can be set is 30 seconds |
|
||||
| Whether to probe the | Whether to check the availability of the monitoring before adding a monitoring is successful, and the new modification operation will continue only if the probe is successful |
|
||||
| Description Comment | For more information identifying and describing the remarks for this monitoring, users can remark the information here |
|
||||
|
||||
### Collect metrics
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ The fields that need to be filled in are as follows:
|
||||
| Field Name | Field Description | Example |
|
||||
|--------------------------|----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Organization Name | Name of the organization | HertzBeat |
|
||||
| Organization Description | Detailed description of the organization | Apache HertzBeat (incubating) is an easy-to-use and user-friendly open-source real-time monitoring and alerting system, no agent required, high-performance cluster, compatible with Prometheus, providing powerful custom monitoring and status page building capabilities. |
|
||||
| Organization Description | Detailed description of the organization | Apache HertzBeat is an easy-to-use and user-friendly open-source real-time monitoring and alerting system, no agent required, high-performance cluster, compatible with Prometheus, providing powerful custom monitoring and status page building capabilities. |
|
||||
| Website Link | URL of the organization's website for more information | <https://hertzbeat.apache.org/> |
|
||||
| Logo Image | Path or URL of the organization's official logo image, preferably in .svg format | <https://hertzbeat.apache.org/zh-cn/img/hertzbeat-logo.svg> |
|
||||
| Feedback Address | Address to receive feedback | <https://github.com/apache/hertzbeat/issues> |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: introduce
|
||||
title: Apache HertzBeat (incubating)
|
||||
title: Apache HertzBeat
|
||||
sidebar_label: Introduce
|
||||
slug: /
|
||||
---
|
||||
@@ -11,7 +11,7 @@ slug: /
|
||||
|
||||
## 🎡 <font color="green">Introduction</font>
|
||||
|
||||
[Apache HertzBeat](https://github.com/apache/hertzbeat) (incubating) is an easy-to-use, open source, real-time monitoring system with agentless, high performance cluster, prometheus-compatible, offers powerful custom monitoring and status page building capabilities.
|
||||
[Apache HertzBeat](https://github.com/apache/hertzbeat) is an easy-to-use, open source, real-time monitoring system with agentless, high performance cluster, prometheus-compatible, offers powerful custom monitoring and status page building capabilities.
|
||||
|
||||
### Features
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ sidebar_label: Update Account Secret
|
||||
|
||||
## Update Account
|
||||
|
||||
Apache HertzBeat (incubating) default built-in three user accounts, respectively admin/hertzbeat tom/hertzbeat guest/hertzbeat
|
||||
Apache HertzBeat default built-in three user accounts, respectively admin/hertzbeat tom/hertzbeat guest/hertzbeat
|
||||
If you need add, delete or modify account or password, configure `sureness.yml`. Ignore this step without this demand.
|
||||
Modify the following **part parameters** in sureness.yml:**[Note⚠️Other default sureness configuration parameters should be retained]**
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ title: Use aaPanel Deploy HertzBeat
|
||||
sidebar_label: Install via aaPanel
|
||||
---
|
||||
|
||||
Apache HertzBeat (incubating) supports one-click deployment in the `Docker` application store of the aaPanel.
|
||||
Apache HertzBeat supports one-click deployment in the `Docker` application store of the aaPanel.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
|
||||
@@ -15,13 +15,13 @@ Run the `docker compose version` command to check if you have a Docker Compose e
|
||||
|
||||
1. Download the startup script package
|
||||
|
||||
Download the installation script package `apache-hertzbeat-xxx-incubating-docker-compose.tar.gz` from the [download](/docs/download)
|
||||
Download the installation script package `apache-hertzbeat-xxx-docker-compose.tar.gz` from the [download](/docs/download)
|
||||
|
||||
2. Choose to use the HertzBeat + PostgreSQL + VictoriaMetrics solution
|
||||
|
||||
:::tip
|
||||
|
||||
- `apache-hertzbeat-xxx-incubating-docker-compose.tar.gz` contains multiple deployment solutions after decompression. Here we recommend choosing the `hertzbeat-postgresql-victoria-metrics` solution.
|
||||
- `apache-hertzbeat-xxx-docker-compose.tar.gz` contains multiple deployment solutions after decompression. Here we recommend choosing the `hertzbeat-postgresql-victoria-metrics` solution.
|
||||
- Other deployment methods, please read the README.md file of each deployment solution in detail. The MySQL solution requires you to prepare the MySQL driver package yourself.
|
||||
|
||||
:::
|
||||
@@ -29,13 +29,13 @@ Run the `docker compose version` command to check if you have a Docker Compose e
|
||||
- Unzip the script package
|
||||
|
||||
```shell
|
||||
tar zxvf apache-hertzbeat-1.6.0-incubating-docker-compose.tar.gz
|
||||
tar zxvf apache-hertzbeat-1.6.0-docker-compose.tar.gz
|
||||
```
|
||||
|
||||
- Enter the decompression directory and select `HertzBeat + PostgreSQL + VictoriaMetrics` for one-click deployment
|
||||
|
||||
```shell
|
||||
cd apache-hertzbeat-1.6.0-incubating-docker-compose
|
||||
cd apache-hertzbeat-1.6.0-docker-compose
|
||||
cd hertzbeat-postgresql-victoria-metrics
|
||||
```
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ title: Use Time Series Database Greptime to Store Metrics Data (Recommended)
|
||||
sidebar_label: Metrics Store Greptime (Recommended)
|
||||
---
|
||||
|
||||
Apache HertzBeat (incubating)'s historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment)
|
||||
Apache HertzBeat's historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment)
|
||||
|
||||
> It is recommended to use Greptime as metrics storage.
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ title: Use Time Series Database InfluxDB to Store Metrics Data (Optional)
|
||||
sidebar_label: Metrics Store InfluxDB
|
||||
---
|
||||
|
||||
Apache HertzBeat (incubating)'s historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment)
|
||||
Apache HertzBeat's historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment)
|
||||
|
||||
> It is recommended to use VictoriaMetrics as metrics storage.
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ title: Use Time Series Database IoTDB to Store Metrics Data (Optional)
|
||||
sidebar_label: Metrics Store IoTDB
|
||||
---
|
||||
|
||||
Apache HertzBeat (incubating)'s historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment)
|
||||
Apache HertzBeat's historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment)
|
||||
|
||||
> It is recommended to use VictoriaMetrics as metrics storage.
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ title: Use MYSQL Replace H2 Database to Store Metadata(Optional)
|
||||
sidebar_label: Meta Store MYSQL
|
||||
---
|
||||
|
||||
MYSQL is a reliable relational database. In addition to default built-in H2 database, Apache HertzBeat (incubating) allow you to use MYSQL to store structured relational data such as monitoring information, alarm information and configuration information.
|
||||
MYSQL is a reliable relational database. In addition to default built-in H2 database, Apache HertzBeat allow you to use MYSQL to store structured relational data such as monitoring information, alarm information and configuration information.
|
||||
|
||||
> If you already have a MySQL environment and the MySQL version meets the requirements, you can skip directly to the database creation step.
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ sidebar_label: Install via Package
|
||||
---
|
||||
|
||||
:::tip
|
||||
You can install and run Apache HertzBeat (incubating) on Linux Windows Mac system, and CPU supports X86/ARM64.
|
||||
You can install and run Apache HertzBeat on Linux Windows Mac system, and CPU supports X86/ARM64.
|
||||
Since version 1.6.0 uses `Java 17` and the installation package no longer provides a built-in JDK version, use the new Hertzbeat according to the following situations:
|
||||
|
||||
- When the default environment variable on your server is `Java 17`, you do not need to take any action for this step.
|
||||
@@ -18,7 +18,7 @@ Since version 1.6.0 uses `Java 17` and the installation package no longer provid
|
||||
|
||||
1. Download installation package
|
||||
|
||||
Download installation package `apache-hertzbeat-xxx-incubating-bin.tar.gz` corresponding to your system environment
|
||||
Download installation package `apache-hertzbeat-xxx-bin.tar.gz` corresponding to your system environment
|
||||
- [Download Page](/docs/download)
|
||||
|
||||
2. Configure HertzBeat's configuration file(optional)
|
||||
@@ -26,7 +26,7 @@ Since version 1.6.0 uses `Java 17` and the installation package no longer provid
|
||||
Unzip the installation package to the host eg: /opt/hertzbeat
|
||||
|
||||
```shell
|
||||
tar zxvf apache-hertzbeat-xxx-incubating-bin.tar.gz
|
||||
tar zxvf apache-hertzbeat-xxx-bin.tar.gz
|
||||
```
|
||||
|
||||
:::tip
|
||||
@@ -68,7 +68,7 @@ Deploying multiple HertzBeat Collectors can achieve high availability, load bala
|
||||
|
||||
1. Download installation package
|
||||
|
||||
Download installation package `apache-hertzbeat-collector-xxx-incubating-bin.tar.gz` corresponding to your system environment
|
||||
Download installation package `apache-hertzbeat-collector-xxx-bin.tar.gz` corresponding to your system environment
|
||||
- [Download Page](/docs/download)
|
||||
|
||||
2. Configure the collector configuration file
|
||||
@@ -76,7 +76,7 @@ Deploying multiple HertzBeat Collectors can achieve high availability, load bala
|
||||
Unzip the installation package to the host eg: /opt/hertzbeat-collector
|
||||
|
||||
```shell
|
||||
tar zxvf apache-hertzbeat-collector-xxx-incubating-bin.tar.gz
|
||||
tar zxvf apache-hertzbeat-collector-xxx-bin.tar.gz
|
||||
```
|
||||
|
||||
Configure the collector configuration yml file `config/application.yml`: unique `identity` name, running `mode` (public or private), hertzbeat `manager-host`, hertzbeat `manager-port`
|
||||
|
||||
@@ -4,7 +4,7 @@ title: Use PostgreSQL Replace H2 Database to Store Metadata(Recommended)
|
||||
sidebar_label: Meta Store PostgreSQL (Recommended)
|
||||
---
|
||||
|
||||
PostgreSQL is a RDBMS emphasizing extensibility and SQL compliance. In addition to default built-in H2 database, Apache HertzBeat (incubating) allow you to use PostgreSQL to store structured relational data such as monitoring information, alarm information and configuration information.
|
||||
PostgreSQL is a RDBMS emphasizing extensibility and SQL compliance. In addition to default built-in H2 database, Apache HertzBeat allow you to use PostgreSQL to store structured relational data such as monitoring information, alarm information and configuration information.
|
||||
|
||||
> If you have the PostgreSQL environment, can be directly to database creation step.
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ sidebar_label: Quick Start
|
||||
|
||||
### 🐕 Quick Start
|
||||
|
||||
- If you wish to deploy Apache HertzBeat (incubating) locally, please refer to the following Deployment Documentation for instructions.
|
||||
- If you wish to deploy Apache HertzBeat locally, please refer to the following Deployment Documentation for instructions.
|
||||
|
||||
#### 🍞 Install HertzBeat
|
||||
|
||||
> Apache HertzBeat (incubating) supports installation through source code, docker or package, cpu support X86/ARM64.
|
||||
> Apache HertzBeat supports installation through source code, docker or package, cpu support X86/ARM64.
|
||||
|
||||
##### 1:Install quickly via docker
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ title: Use Rainbond Deploy HertzBeat
|
||||
sidebar_label: Install via Rainbond
|
||||
---
|
||||
|
||||
If you are unfamiliar with Kubernetes, and want to install Apache HertzBeat (incubating) in Kubernetes, you can use Rainbond to deploy. Rainbond is a cloud-native application management platform built on Kubernetes and simplifies the application deployment to Kubernetes.
|
||||
If you are unfamiliar with Kubernetes, and want to install Apache HertzBeat in Kubernetes, you can use Rainbond to deploy. Rainbond is a cloud-native application management platform built on Kubernetes and simplifies the application deployment to Kubernetes.
|
||||
|
||||
## Rainbond Cloud deployment
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ title: Use Time Series Database TDengine to Store Metrics Data (Optional)
|
||||
sidebar_label: Metrics Store TDengine
|
||||
---
|
||||
|
||||
Apache HertzBeat (incubating)'s historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment)
|
||||
Apache HertzBeat's historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment)
|
||||
|
||||
> It is recommended to use VictoriaMetrics as metrics storage.
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ sidebar_label: Version Upgrade Guide
|
||||
- [Github Release](https://github.com/apache/hertzbeat/releases)
|
||||
- [DockerHub Release](https://hub.docker.com/r/apache/hertzbeat/tags)
|
||||
|
||||
Apache HertzBeat (incubating)'s metadata information is stored in H2 or Mysql, PostgreSQL relational databases, and the collected metric data is stored in time series databases such as TDengine and IotDB.
|
||||
Apache HertzBeat's metadata information is stored in H2 or Mysql, PostgreSQL relational databases, and the collected metric data is stored in time series databases such as TDengine and IotDB.
|
||||
|
||||
**You need to save and back up the data files of the database and monitoring templates yml files before upgrading**
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ The production environment recommends a complete deployment method, refer [Insta
|
||||
|
||||
### 1. Click Add Linux Operating System Monitor
|
||||
|
||||
> HertzBeat Page -> Monitors Menu -> New Monitor -> OS Monitor -> Add OS Linux
|
||||
> HertzBeat Page -> Monitors -> New Monitor -> OS Monitor -> Add OS Linux
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ This article introduces an integrated solution using the HertzBeat monitoring sy
|
||||
|
||||
## What is HertzBeat
|
||||
|
||||
Apache HertzBeat (incubating) is a real-time monitoring tool with powerful custom monitoring capabilities without Agent. Website monitoring, PING connectivity, port availability, database, operating system, middleware, API monitoring, threshold alarms, alarm notification (email, WeChat, Ding Ding Feishu).
|
||||
Apache HertzBeat is a real-time monitoring tool with powerful custom monitoring capabilities without Agent. Website monitoring, PING connectivity, port availability, database, operating system, middleware, API monitoring, threshold alarms, alarm notification (email, WeChat, Ding Ding Feishu).
|
||||
|
||||
**github: <https://github.com/apache/hertzbeat>**
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ This article introduces how to use the hertzbeat monitoring tool to detect the v
|
||||
|
||||
## What is HertzBeat
|
||||
|
||||
Apache HertzBeat (incubating) is a real-time monitoring tool with powerful custom monitoring capabilities without Agent. Website monitoring, PING connectivity, port availability, database, operating system, middleware, API monitoring, threshold alarms, alarm notification (email, WeChat, Ding Ding Feishu).
|
||||
Apache HertzBeat is a real-time monitoring tool with powerful custom monitoring capabilities without Agent. Website monitoring, PING connectivity, port availability, database, operating system, middleware, API monitoring, threshold alarms, alarm notification (email, WeChat, Ding Ding Feishu).
|
||||
|
||||
github: <https://github.com/apache/hertzbeat>
|
||||
|
||||
@@ -32,7 +32,7 @@ The production environment recommends a complete deployment method, refer <https
|
||||
|
||||
1. Click Add SSL Certificate Monitor
|
||||
|
||||
> HertzBeat Page -> Monitors Menu -> New Monitor -> Service Monitor -> Add SSL Certificate
|
||||
> HertzBeat Page -> Monitors -> New Monitor -> Service Monitor -> Add SSL Certificate
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ title: Use Time Series Database VictoriaMetrics to Store Metrics Data (Recommend
|
||||
sidebar_label: Metrics Store VictoriaMetrics (Recommended)
|
||||
---
|
||||
|
||||
Apache HertzBeat (incubating)'s historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment)
|
||||
Apache HertzBeat's historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment)
|
||||
|
||||
> It is recommended to use VictoriaMetrics as metrics storage.
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ title: Monitoring Template Here
|
||||
sidebar_label: Monitoring Template
|
||||
---
|
||||
|
||||
> Apache HertzBeat (incubating) is an open source, real-time monitoring tool with custom-monitor and agentLess.
|
||||
> Apache HertzBeat is an open source, real-time monitoring tool with custom-monitor and agentLess.
|
||||
>
|
||||
> We make protocols such as `Http, Jmx, Ssh, Snmp, Jdbc, Prometheus` configurable, and you only need to configure `YML` online to collect any metrics you want.
|
||||
> Do you believe that you can immediately adapt a new monitoring type such as K8s or Docker just by configuring online?
|
||||
|
||||
@@ -2,7 +2,7 @@ const path = require('path')
|
||||
|
||||
const organizationName = 'apache' // Usually your GitHub name.
|
||||
const projectName = 'hertzbeat' // Usually your repo name.
|
||||
const deploymentBranch = 'asf-site'
|
||||
const deploymentBranch = 'asf-site'
|
||||
const branch = 'master'
|
||||
const repoUrl = `https://github.com/apache/${projectName}`
|
||||
const cdnUrl = null
|
||||
@@ -16,8 +16,8 @@ module.exports = {
|
||||
onBrokenMarkdownLinks: 'throw',
|
||||
favicon: '/img/hertzbeat-logo.svg',
|
||||
organizationName,
|
||||
projectName,
|
||||
deploymentBranch,
|
||||
projectName,
|
||||
deploymentBranch,
|
||||
customFields: {
|
||||
repoUrl,
|
||||
cdnUrl,
|
||||
@@ -206,22 +206,22 @@ module.exports = {
|
||||
{
|
||||
type: 'localeDropdown',
|
||||
position: 'right',
|
||||
},
|
||||
},
|
||||
{
|
||||
href: repoUrl,
|
||||
position: 'right',
|
||||
className: 'header-github-link'
|
||||
},
|
||||
},
|
||||
{
|
||||
href: 'https://x.com/hertzbeat1024',
|
||||
position: 'right',
|
||||
className: 'header-twitter-link'
|
||||
},
|
||||
},
|
||||
{
|
||||
href: 'https://www.youtube.com/channel/UCri75zfWX0GHqJFPENEbLow',
|
||||
position: 'right',
|
||||
className: 'header-youtube-link'
|
||||
},
|
||||
},
|
||||
{
|
||||
href: 'https://discord.gg/Fb6M73htGr',
|
||||
position: 'right',
|
||||
|
||||
@@ -263,13 +263,13 @@
|
||||
"message": "Makes protocols such as Http, Jmx, Ssh, Snmp, Jdbc configurable, you can collect any metrics by simply configuring the yml online. {br} High performance, supports horizontal expansion of multi-collector clusters, multi-isolated network monitoring and cloud-edge collaboration. {br} Flexible threshold rules and timely notifications delivered via discord slack email webhook more."
|
||||
},
|
||||
"opensource-content": {
|
||||
"message": "Apache HertzBeat (incubating) is open source, has an inclusive and open community. Unlimited and anyone who are interested in it are very welcome to contribute. No matter how small the contribution is, whether it is a code document or a typo, respect everyone and grow together. {br} Our code is being deployed on thousands of machines worldwide.{github}"
|
||||
"message": "Apache HertzBeat is open source, has an inclusive and open community. Unlimited and anyone who are interested in it are very welcome to contribute. No matter how small the contribution is, whether it is a code document or a typo, respect everyone and grow together. {br} Our code is being deployed on thousands of machines worldwide.{github}"
|
||||
},
|
||||
"slogan": {
|
||||
"message": "Open Source Real-time Monitoring System"
|
||||
},
|
||||
"Who uses HertzBeat?": {
|
||||
"message": "Who uses Apache HertzBeat (incubating)?"
|
||||
"message": "Who uses Apache HertzBeat?"
|
||||
},
|
||||
"theme.admonition.note": {
|
||||
"message": "note",
|
||||
@@ -490,7 +490,7 @@
|
||||
"description": "The title of the tag list page"
|
||||
},
|
||||
"team.name": {
|
||||
"message": "Apache HertzBeat (incubating) Team"
|
||||
"message": "Apache HertzBeat Team"
|
||||
},
|
||||
"team.desc": {
|
||||
"message": "The HertzBeat team is composed of contributors from various fields around the world. We embrace the community philosophy of openness and collaboration, welcoming👏 more people to join us and grow together with the community."
|
||||
|
||||
@@ -437,7 +437,7 @@
|
||||
"message": "将 Http,Jmx,Ssh,Snmp,Jdbc 等协议规范可配置模板化,只需在线配置YML就可自定义监控指标。{br} 高性能,支持多采集器集群横向扩展,支持多隔离网络监控,云边协同。{br}灵活的告警阈值规则,邮箱,短信,钉钉,企业微信,飞书,Webhook等消息及时送达。{br} 您相信只需配置下就能适配新K8s监控类型吗?"
|
||||
},
|
||||
"opensource-content": {
|
||||
"message": "Apache HertzBeat (incubating) 是开源的,拥有一个包容开放的社区。{br}欢迎任何对此有兴趣的同学参与其中,无论是代码文档或者错别字,尊重社区的每一位,一起进步成长。{br}我们的代码正被部署到全球成千上万机器上。{github}"
|
||||
"message": "Apache HertzBeat 是开源的,拥有一个包容开放的社区。{br}欢迎任何对此有兴趣的同学参与其中,无论是代码文档或者错别字,尊重社区的每一位,一起进步成长。{br}我们的代码正被部署到全球成千上万机器上。{github}"
|
||||
},
|
||||
"slogan": {
|
||||
"message": "易用友好的开源实时监控系统"
|
||||
@@ -464,7 +464,7 @@
|
||||
"message": "快速开始"
|
||||
},
|
||||
"Who uses HertzBeat?": {
|
||||
"message": "谁在使用 Apache HertzBeat (incubating)"
|
||||
"message": "谁在使用 Apache HertzBeat"
|
||||
},
|
||||
"Support HertzBeat": {
|
||||
"message": "Support HertzBeat"
|
||||
@@ -493,7 +493,7 @@
|
||||
"description": "The title of the tag list page"
|
||||
},
|
||||
"team.name": {
|
||||
"message": "Apache HertzBeat (incubating) 团队"
|
||||
"message": "Apache HertzBeat 团队"
|
||||
},
|
||||
"team.desc": {
|
||||
"message": "HertzBeat 团队由来自全球各个领域的贡献者组成。践行 开放,协作 的社区理念,欢迎👏更多的人加入我们,和社区一同成长。"
|
||||
|
||||
@@ -36,7 +36,7 @@ gitee: <https://gitee.com/hertzbeat/hertzbeat>
|
||||
|
||||
1. 点击新增SSL证书监控
|
||||
|
||||
> 系统页面 -> 监控菜单 -> SSL证书 -> 新增SSL证书
|
||||
> 系统页面 -> 监控中心 -> SSL证书 -> 新增SSL证书
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ tags: [opensource, practice]
|
||||
keywords: [open source, monitoring, alerting]
|
||||
---
|
||||
|
||||
**Hi 朋友们,我们很高兴地宣布,Apache HertzBeat (incubating) 的了第一个Apache版本 v1.6.0 发布啦!🎉.**
|
||||
**Hi 朋友们,我们很高兴地宣布,Apache HertzBeat 的了第一个Apache版本 v1.6.0 发布啦!🎉.**
|
||||
|
||||
经过近五个月的社区开发迭代贡献和两个月的Apache Incubator孵化过程,Apache HertzBeat (incubating) v1.6.0 终于出来了。
|
||||
经过近五个月的社区开发迭代贡献和两个月的Apache Incubator孵化过程,Apache HertzBeat v1.6.0 终于出来了。
|
||||
这个版本我们增加了对OpenAi监控,Redfish协议服务器,插件机制,支持了NebulaGraph, Apache Yarn, HDFS, Hbase, Storm等更多功能特性。
|
||||
由于License兼容问题,我们在底层替换了ORM框架,计算框架等多个依赖,Hibernate -> EclipseLink, 这也算是JPA生态下为数不多的迁移踩坑实践。
|
||||
同时修复了一些bug和优化了一些功能,更完善的文档。欢迎大家尝试使用,提出宝贵意见和建议,共同推动HertzBeat的发展。🎉
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ title: HTTP协议系统默认解析方式
|
||||
sidebar_label: 系统默认解析方式
|
||||
---
|
||||
|
||||
> HTTP接口调用获取响应数据后,用 Apache HertzBeat (incubating) 默认的解析方式去解析响应数据。
|
||||
> HTTP接口调用获取响应数据后,用 Apache HertzBeat 默认的解析方式去解析响应数据。
|
||||
|
||||
**此需接口响应数据结构符合HertzBeat指定的数据结构规则**
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ title: 教程一:适配一款基于HTTP协议的监控类型
|
||||
sidebar_label: 教程一:适配一款HTTP协议监控
|
||||
---
|
||||
|
||||
通过此教程我们一步一步描述如何在 Apache HertzBeat (incubating) 监控系统下新增适配一款基于http协议的监控类型。
|
||||
通过此教程我们一步一步描述如何在 Apache HertzBeat 监控系统下新增适配一款基于http协议的监控类型。
|
||||
|
||||
阅读此教程前我们希望您已经从[自定义监控](extend-point)和[http协议自定义](extend-http)了解熟悉了怎么自定义类型,指标,协议等。
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ sidebar_label: JsonPath解析方式
|
||||
|
||||
注意⚠️ 响应数据为JSON格式
|
||||
|
||||
**使用JsonPath脚本将响应数据解析成符合 Apache HertzBeat (incubating) 指定的数据结构规则的数据**
|
||||
**使用JsonPath脚本将响应数据解析成符合 Apache HertzBeat 指定的数据结构规则的数据**
|
||||
|
||||
#### JsonPath操作符
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ title: 自定义适配一款基于HTTP协议的新监控类型
|
||||
sidebar_label: 教程案例
|
||||
---
|
||||
|
||||
通过此教程我们一步一步描述如何在 Apache HertzBeat (incubating) 系统下自定义新增适配一款基于 http 协议的监控类型。
|
||||
通过此教程我们一步一步描述如何在 Apache HertzBeat 系统下自定义新增适配一款基于 http 协议的监控类型。
|
||||
|
||||
阅读此教程前我们希望您已经从[自定义监控](extend-point)和[http协议自定义](extend-http)了解熟悉了怎么自定义类型,指标,协议等。
|
||||
|
||||
|
||||
+2
-3
@@ -40,9 +40,8 @@ Apache HertzBeat 社区努力追求基于功绩的原则。因此,一旦有人
|
||||
|
||||
Committer 的候选人应该持续参与并为 HertzBeat 做出大量的贡献(例如修复漏洞、添加新功能、编写文档、维护问题板、代码审查或回答社区问题),无论是向主网站的代码库还是 HertzBeat 的 GitHub 仓库贡献。
|
||||
|
||||
- +3 个月的轻度活动和参与。
|
||||
- +2 个月的中度活动和参与。
|
||||
- +1 个月的高度活动和参与。
|
||||
- 3+ months 的活动和参与。
|
||||
- 20+ pr 的代码,文档,测试等贡献。
|
||||
|
||||
### 贡献的质量
|
||||
|
||||
|
||||
+1
-3
@@ -40,9 +40,7 @@ Apache HertzBeat 社区努力追求基于功绩的原则。因此,一旦有人
|
||||
|
||||
PMC 成员的候选人应该持续参与并为 HertzBeat 做出大量的贡献(例如修复漏洞、添加新功能、编写文档、维护问题板、代码审查或回答社区问题),无论是向主网站的代码库还是 HertzBeat 的 GitHub 仓库贡献。
|
||||
|
||||
- +5 个月的轻度活动和参与。
|
||||
- +4 个月的中度活动和参与。
|
||||
- +3 个月的高度活动和参与。
|
||||
- 12+ months 的活动和参与。
|
||||
|
||||
### 贡献的质量
|
||||
|
||||
|
||||
+12
-12
@@ -350,13 +350,13 @@ svn commit -m "release for HertzBeat 1.6.0-RC1"
|
||||
发送社区投票邮件需要至少三个`+1`,且无`-1`。
|
||||
|
||||
> `Send to`: <dev@hertzbeat.apache.org> <br />
|
||||
> `Title`: [VOTE] Release Apache HertzBeat (incubating) 1.6.0 rc1 <br />
|
||||
> `Title`: [VOTE] Release Apache HertzBeat 1.6.0 rc1 <br />
|
||||
> `Body`:
|
||||
|
||||
```text
|
||||
Hello HertzBeat Community:
|
||||
|
||||
This is a call for vote to release Apache HertzBeat (incubating) version release-1.6.0-RC1.
|
||||
This is a call for vote to release Apache HertzBeat version release-1.6.0-RC1.
|
||||
|
||||
Apache HertzBeat - a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities.
|
||||
|
||||
@@ -406,13 +406,13 @@ Thanks!
|
||||
在72小时后,将统计投票结果,并发送投票结果邮件,如下所示。
|
||||
|
||||
> `Send to`: <dev@hertzbeat.apache.org> <br />
|
||||
> `Title`: [RESULT]\[VOTE\] Release Apache HertzBeat (incubating) 1.6.0-rc1 <br />
|
||||
> `Title`: [RESULT]\[VOTE\] Release Apache HertzBeat 1.6.0-rc1 <br />
|
||||
> `Body`:
|
||||
|
||||
```text
|
||||
Dear HertzBeat community,
|
||||
|
||||
Thanks for your review and vote for "Release Apache HertzBeat (incubating) 1.6.0-rc1"
|
||||
Thanks for your review and vote for "Release Apache HertzBeat 1.6.0-rc1"
|
||||
I'm happy to announce the vote has passed:
|
||||
---
|
||||
4 binding +1, from:
|
||||
@@ -441,14 +441,14 @@ ChunJin Mu
|
||||
发送孵化社区投票邮件需要至少三个`+1`,且无`-1`。
|
||||
|
||||
> `Send to`: <general@incubator.apache.org> <br />
|
||||
> `Title`: [VOTE] Release Apache HertzBeat (incubating) 1.6.0-rc1 <br />
|
||||
> `Title`: [VOTE] Release Apache HertzBeat 1.6.0-rc1 <br />
|
||||
> `Body`:
|
||||
|
||||
```text
|
||||
Hello Incubator Community:
|
||||
|
||||
This is a call for a vote to release Apache HertzBeat (incubating) version 1.6.0-RC1.
|
||||
The Apache HertzBeat community has voted on and approved a proposal to release Apache HertzBeat (incubating) version 1.6.0-RC1.
|
||||
This is a call for a vote to release Apache HertzBeat version 1.6.0-RC1.
|
||||
The Apache HertzBeat community has voted on and approved a proposal to release Apache HertzBeat version 1.6.0-RC1.
|
||||
We now kindly request the Incubator PPMC members review and vote on this incubator release.
|
||||
Apache HertzBeat, a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities.
|
||||
|
||||
@@ -486,7 +486,7 @@ https://hertzbeat.apache.org/docs/community/development/#build-hertzbeat-binary-
|
||||
---
|
||||
Thanks,
|
||||
|
||||
On behalf of Apache HertzBeat (incubating) community
|
||||
On behalf of Apache HertzBeat community
|
||||
---
|
||||
Best,
|
||||
ChunJin Mu
|
||||
@@ -507,13 +507,13 @@ Chunjin Mu
|
||||
然后将统计投票结果,并发送投票结果邮件,如下所示。
|
||||
|
||||
> `Send to`: <general@incubator.apache.org> <br />
|
||||
> `Title`: [RESULT]\[VOTE\] Release Apache HertzBeat (incubating) 1.6.0-rc1 <br />
|
||||
> `Title`: [RESULT]\[VOTE\] Release Apache HertzBeat 1.6.0-rc1 <br />
|
||||
> `Body`:
|
||||
|
||||
```text
|
||||
Hi Incubator Community,
|
||||
|
||||
The vote to release Apache HertzBeat (incubating) 1.6.0-rc4 has passed with 3 +1 binding and no +0 or -1 votes.
|
||||
The vote to release Apache HertzBeat 1.6.0-rc4 has passed with 3 +1 binding and no +0 or -1 votes.
|
||||
|
||||
3 binding votes, no +0 or -1 votes.
|
||||
|
||||
@@ -584,13 +584,13 @@ release note: xxx
|
||||
|
||||
> `Send to`: <general@incubator.apache.org> <br />
|
||||
> `cc`: <dev@hertzbeat.apache.org> <br />
|
||||
> `Title`: [ANNOUNCE] Apache HertzBeat (incubating) 1.6.0 released <br />
|
||||
> `Title`: [ANNOUNCE] Apache HertzBeat 1.6.0 released <br />
|
||||
> `Body`:
|
||||
|
||||
```text
|
||||
Hi Community,
|
||||
|
||||
We are glad to announce the release of Apache HertzBeat (incubating) 1.6.0.
|
||||
We are glad to announce the release of Apache HertzBeat 1.6.0.
|
||||
Thanks again for your help.
|
||||
|
||||
Apache HertzBeat (https://hertzbeat.apache.org/) - a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities.
|
||||
|
||||
@@ -110,9 +110,7 @@ tar -xzvf apache-hertzbeat-${release.version}-incubating-bin.tar.gz
|
||||
|
||||
进行如下检查:
|
||||
|
||||
- [ ] 文件夹包含单词`incubating`
|
||||
- [ ] 存在`LICENSE`和`NOTICE`文件
|
||||
- [ ] 存在`DISCLAIMER`或`DISCLAIMER-WIP`文件
|
||||
- [ ] `NOTICE`文件中的年份正确
|
||||
- [ ] 所有文本文件开头都有ASF许可证
|
||||
- [ ] 检查第三方依赖许可证:
|
||||
@@ -136,9 +134,7 @@ cd apache-hertzbeat-${release_version}-incubating-src
|
||||
进行如下检查:
|
||||
|
||||
- [ ] 检查源码包是否包含由于包含不必要文件,致使tar包过于庞大
|
||||
- [ ] 文件夹包含单词`incubating`
|
||||
- [ ] 存在`LICENSE`和`NOTICE`文件
|
||||
- [ ] 存在`DISCLAIMER`或`DISCLAIMER-WIP`文件
|
||||
- [ ] `NOTICE`文件中的年份正确
|
||||
- [ ] 只存在文本文件,不存在二进制文件
|
||||
- [ ] 所有文件的开头都有ASF许可证
|
||||
|
||||
+1
-1
@@ -270,7 +270,7 @@ Subject: [ANNOUNCE] New committer: ${NEW_COMMITTER_NAME}
|
||||
```text
|
||||
Hello Community,
|
||||
|
||||
The Podling Project Management Committee (PPMC) for Apache HertzBeat (incubating)
|
||||
The Podling Project Management Committee (PPMC) for Apache HertzBeat
|
||||
has invited ${NEW_COMMITTER_NAME} to become a committer and we are pleased to
|
||||
announce that he has accepted.
|
||||
|
||||
|
||||
+1
-1
@@ -281,5 +281,5 @@ submission process. This should enable better productivity.
|
||||
A PPMC member helps manage and guide the direction of the project.
|
||||
|
||||
Thanks,
|
||||
On behalf of the Apache HertzBeat (incubating) PPMC
|
||||
On behalf of the Apache HertzBeat PPMC
|
||||
```
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user