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

Update metrics name for monitor better select in JMX MetricBeanWriter #2976

Merged
merged 5 commits into from
Nov 30, 2022
Merged
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 @@ -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