Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(#12355): Record the cost of ConfigDump in Prometheus. #12356

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ public static Timer getNotifyRtTimer() {
return NacosMeterRegistryCenter.timer(METER_REGISTRY, "nacos_timer", "module", "config", "name", "notifyRt");
}

public static Timer getDumpRtTimer() {
return NacosMeterRegistryCenter.timer(METER_REGISTRY, "nacos_timer", "module", "config", "name", "dumpRt");
}

public static Counter getIllegalArgumentException() {
return NacosMeterRegistryCenter
.counter(METER_REGISTRY, "nacos_exception", "module", "config", "name", "illegalArgument");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ public static void logPersistenceEvent(String dataId, String group, String tenan
//localIp | dataid | group | tenant | requestIpAppName | ts | client ip | event | type | [delayed = -1] | ext
// (md5)
String md5 = content == null ? null : MD5Utils.md5Hex(content, Constants.PERSIST_ENCODE);

LogUtil.TRACE_LOG.info("{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}", InetUtils.getSelfIP(), dataId, group, tenant,
requestIpAppName, ts, handleIp, event, type, -1, md5);
}
Expand All @@ -165,17 +164,14 @@ public static void logNotifyEvent(String dataId, String group, String tenant, St
if (!LogUtil.TRACE_LOG.isInfoEnabled()) {
return;
}

if (delayed < 0) {
delayed = 0;
}

MetricsMonitor.getNotifyRtTimer().record(delayed, TimeUnit.MILLISECONDS);
// Convenient tlog segmentation
if (StringUtils.isBlank(tenant)) {
tenant = null;
}

//localIp | dataid | group | tenant | requestIpAppName | ts | handleIp | event | type | [delayed] | ext
// (targetIp)
LogUtil.TRACE_LOG.info("{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}", InetUtils.getSelfIP(), dataId, group, tenant,
Expand Down Expand Up @@ -227,6 +223,7 @@ private static void logDumpEventInner(String dataId, String group, String tenant
if (delayed < 0) {
delayed = 0;
}
MetricsMonitor.getDumpRtTimer().record(delayed, TimeUnit.MILLISECONDS);
// Convenient tlog segmentation
if (StringUtils.isBlank(tenant)) {
tenant = null;
Expand Down Expand Up @@ -284,11 +281,9 @@ public static void logPullEvent(String dataId, String group, String tenant, Stri
if (StringUtils.isBlank(tenant)) {
tenant = null;
}

if (isNotify && delayed < 0) {
delayed = 0;
}

// localIp | dataid | group | tenant| requestIpAppName| ts | event | type | [delayed] |clientIp| isNotify | mode(http/grpc)
LogUtil.TRACE_LOG.info("{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}|{}", InetUtils.getSelfIP(), dataId, group, tenant,
requestIpAppName, ts, event, type, delayed, clientIp, isNotify, model);
Expand Down
Loading