Skip to content

Commit 8a00a86

Browse files
authored
Update metrics name for better monitor selection in JMX MetricBeanWriter extension (#2976)
1 parent 4774557 commit 8a00a86

File tree

1 file changed

+4
-3
lines changed
  • sentinel-extension/sentinel-metric-exporter/src/main/java/com/alibaba/csp/sentinel/metric/exporter/jmx

1 file changed

+4
-3
lines changed

sentinel-extension/sentinel-metric-exporter/src/main/java/com/alibaba/csp/sentinel/metric/exporter/jmx/MetricBeanWriter.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,11 @@ public synchronized void write(Map<String, MetricNode> map) throws Exception {
6666
appName = DEFAULT_APP_NAME;
6767
}
6868
long version = System.currentTimeMillis();
69-
// set or update the new value
69+
// set or update the new metric value
7070
for (MetricNode metricNode : map.values()) {
71-
final String mBeanName = "Sentinel:type=" + appName + ",name=\"" + metricNode.getResource()
72-
+"\",classification=\"" + metricNode.getClassification() +"\"";
71+
final String mBeanName = "Sentinel:type=Metric,resource=" + metricNode.getResource()
72+
+",classification=" + metricNode.getClassification()
73+
+",appName=" + appName;
7374
MetricBean metricBean = mBeanRegistry.findMBean(mBeanName);
7475
if (metricBean != null) {
7576
metricBean.setValueFromNode(metricNode);

0 commit comments

Comments
 (0)