This commit is contained in:
Wenjun Ruan 2024-06-07 10:15:24 +08:00
parent 2880f360ec
commit b519fc70c4
4 changed files with 30 additions and 3 deletions

View File

@ -91,6 +91,11 @@ For example, you can get the master metrics by `curl http://localhost:5679/actua
- stop: the number of stopped workflow instances
- failover: the number of workflow instance fail-overs
### RPC Related Metrics
- ds.rpc.client.sync.request.exception.count: (counter) the number of exceptions occurred in sync rpc requests
- ds.rpc.client.sync.request.duration.time: (histogram) the time cost of sync rpc requests
### Master Server Metrics
- ds.master.overload.count: (counter) the number of times the master overloaded

View File

@ -91,6 +91,11 @@ metrics exporter端口`server.port`是在application.yaml里定义的: master: `
- stop停止的工作流实例数量
- failover容错的工作流实例数量
### RPC相关指标
- ds.rpc.client.sync.request.exception.count: (counter) 同步rpc请求异常数
- ds.rpc.client.sync.request.duration.time: (histogram) 同步rpc请求耗时
### Master Server指标
- ds.master.overload.count: (counter) master过载次数

View File

@ -53,7 +53,7 @@ public class RpcMetrics {
final String serverHost) {
final String exceptionType = throwable == null ? "unknown" : throwable.getClass().getSimpleName();
final Counter counter = rpcRequestExceptionCounter.computeIfAbsent(exceptionType,
(et) -> Counter.builder("ds.rpc.client.sync.request.exception")
(et) -> Counter.builder("ds.rpc.client.sync.request.exception.count")
.tag("method_name", methodName)
.tag("client_host", clientHost)
.tag("server_host", serverHost)
@ -80,7 +80,7 @@ public class RpcMetrics {
final String clientHost,
final String serverHost) {
rpcRequestDurationTimer.computeIfAbsent(methodName,
(method) -> Timer.builder("ds.rpc.client.sync.request.duration")
(method) -> Timer.builder("ds.rpc.client.sync.request.duration.time")
.tag("method_name", method)
.tag("client_host", clientHost)
.tag("server_host", serverHost)

View File

@ -1,3 +1,20 @@
/*
* 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.dolphinscheduler.extract.base.metrics;
import static com.google.common.truth.Truth.assertThat;
@ -19,7 +36,7 @@ class RpcMetricsTest {
@Test
void testRecordClientSyncRequestException() {
assertThat(Metrics.globalRegistry.find("ds.rpc.client.sync.request.exception").counter()).isNull();
assertThat(Metrics.globalRegistry.find("ds.rpc.client.sync.request.exception.count").counter()).isNull();
String clientHost = NetUtils.getHost();
String serverHost = NetUtils.getHost();