Skip to content

Commit

Permalink
Update metrics name for better monitor selection in JMX MetricBeanWri…
Browse files Browse the repository at this point in the history
…ter extension (#2976)
  • Loading branch information
garroshh authored Nov 30, 2022
1 parent 4774557 commit 8a00a86
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@ public synchronized void write(Map<String, MetricNode> map) throws Exception {
appName = DEFAULT_APP_NAME;
}
long version = System.currentTimeMillis();
// set or update the new value
// set or update the new metric value
for (MetricNode metricNode : map.values()) {
final String mBeanName = "Sentinel:type=" + appName + ",name=\"" + metricNode.getResource()
+"\",classification=\"" + metricNode.getClassification() +"\"";
final String mBeanName = "Sentinel:type=Metric,resource=" + metricNode.getResource()
+",classification=" + metricNode.getClassification()
+",appName=" + appName;
MetricBean metricBean = mBeanRegistry.findMBean(mBeanName);
if (metricBean != null) {
metricBean.setValueFromNode(metricNode);
Expand Down

0 comments on commit 8a00a86

Please sign in to comment.