Skip to content

Commit

Permalink
Re-divide the indicators of nacos_monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
DioxideCN committed Aug 4, 2024
1 parent 963b5c7 commit ac4c05b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
*/
public class MetricsMonitor {

private static final Gauge NACOS_MONITOR_GAUGE = Gauge.build().name("nacos_monitor_gauge").labelNames("module", "name")
.help("nacos_monitor_gauge").register();
private static final Gauge NACOS_MONITOR_GAUGE = Gauge.build().name("nacos_monitor").labelNames("module", "name")
.help("nacos_monitor").register();

private static final Histogram NACOS_CLIENT_REQUEST_HISTOGRAM = Histogram.build()
.labelNames("module", "method", "url", "code").name("nacos_client_request").help("nacos_client_request")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,42 +81,42 @@ public class MetricsMonitor {
List<Tag> tags = new ArrayList<>();
tags.add(immutableTag);
tags.add(new ImmutableTag("name", "getConfig"));
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor_gauge", tags, getConfig);
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor", tags, getConfig);

tags = new ArrayList<>();
tags.add(immutableTag);
tags.add(new ImmutableTag("name", "publish"));
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor_gauge", tags, publish);
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor", tags, publish);

tags = new ArrayList<>();
tags.add(immutableTag);
tags.add(new ImmutableTag("name", "longPolling"));
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor_gauge", tags, longPolling);
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor", tags, longPolling);

tags = new ArrayList<>();
tags.add(immutableTag);
tags.add(new ImmutableTag("name", "configCount"));
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor_gauge", tags, configCount);
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor", tags, configCount);

tags = new ArrayList<>();
tags.add(immutableTag);
tags.add(new ImmutableTag("name", "notifyTask"));
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor_gauge", tags, notifyTask);
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor", tags, notifyTask);

tags = new ArrayList<>();
tags.add(immutableTag);
tags.add(new ImmutableTag("name", "notifyClientTask"));
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor_gauge", tags, notifyClientTask);
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor", tags, notifyClientTask);

tags = new ArrayList<>();
tags.add(immutableTag);
tags.add(new ImmutableTag("name", "dumpTask"));
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor_gauge", tags, dumpTask);
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor", tags, dumpTask);

tags = new ArrayList<>();
tags.add(immutableTag);
tags.add(new ImmutableTag("name", "fuzzySearch"));
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor_gauge", tags, fuzzySearch);
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor", tags, fuzzySearch);

configSubscriber.put("v1", new AtomicInteger(0));
configSubscriber.put("v2", new AtomicInteger(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,27 @@ public final class MetricsMonitor {
List<Tag> tags = new ArrayList<>();
tags.add(immutableTag);
tags.add(new ImmutableTag("name", "raft_read_index_failed"));
RAFT_READ_INDEX_FAILED = NacosMeterRegistryCenter.summary(METER_REGISTRY, "nacos_monitor", tags);
RAFT_READ_INDEX_FAILED = NacosMeterRegistryCenter.summary(METER_REGISTRY, "nacos_monitor_summary", tags);

tags = new ArrayList<>();
tags.add(immutableTag);
tags.add(new ImmutableTag("name", "raft_read_from_leader"));
RAFT_FROM_LEADER = NacosMeterRegistryCenter.summary(METER_REGISTRY, "nacos_monitor", tags);
RAFT_FROM_LEADER = NacosMeterRegistryCenter.summary(METER_REGISTRY, "nacos_monitor_summary", tags);

tags = new ArrayList<>();
tags.add(immutableTag);
tags.add(new ImmutableTag("name", "raft_apply_log_timer"));
RAFT_APPLY_LOG_TIMER = NacosMeterRegistryCenter.timer(METER_REGISTRY, "nacos_monitor", tags);
RAFT_APPLY_LOG_TIMER = NacosMeterRegistryCenter.timer(METER_REGISTRY, "nacos_monitor_summary", tags);

tags = new ArrayList<>();
tags.add(immutableTag);
tags.add(new ImmutableTag("name", "raft_apply_read_timer"));
RAFT_APPLY_READ_TIMER = NacosMeterRegistryCenter.timer(METER_REGISTRY, "nacos_monitor", tags);
RAFT_APPLY_READ_TIMER = NacosMeterRegistryCenter.timer(METER_REGISTRY, "nacos_monitor_summary", tags);

tags = new ArrayList<>();
tags.add(immutableTag);
tags.add(new ImmutableTag("name", "longConnection"));
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor_gauge", tags, longConnection);
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor", tags, longConnection);

tags = new ArrayList<>();
tags.add(immutableTag);
Expand Down Expand Up @@ -259,7 +259,7 @@ public static void refreshModuleConnectionCount(Map<String, Integer> connectionC
// new module comes
AtomicInteger newModuleConnCnt = new AtomicInteger(cnt);
moduleConnectionCnt.put(module, newModuleConnCnt);
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor_gauge",
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor",
Arrays.asList(
new ImmutableTag("module", module),
new ImmutableTag("name", "longConnection")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private <T extends Number> void registerToMetrics(String name, T number) {
List<Tag> tags = new ArrayList<>();
tags.add(new ImmutableTag("module", "naming"));
tags.add(new ImmutableTag("name", name));
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor_gauge", tags, number);
NacosMeterRegistryCenter.gauge(METER_REGISTRY, "nacos_monitor", tags, number);
}

public static AtomicInteger getMysqlHealthCheckMonitor() {
Expand Down

0 comments on commit ac4c05b

Please sign in to comment.