-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Fix JMX Metrics export error #2992
Conversation
...ic-exporter/src/test/java/com/alibaba/cps/sentinel/metric/exporter/MetricBeanWriterTest.java
Show resolved
Hide resolved
cc @xiangtianyu @garroshh @BlueSodaWater for review |
LGTM notice:for those special characters,metrics lable value will add “” and \, but that's right. |
@garroshh Added string quote and escapes for special character to resource name when there are special characters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for contributing and look forward to more! 👍 |
…el/issues/2989
Describe what this PR does / why we need it
Fix JMX Metrics export error, Before registering, first escape the special characters [*, ?, ", \n, =, :] in the resource name.
Does this pull request fix one issue?
Fixes #2989
Describe how you did it
Escape the resourceName by call "quote" method before creating the registration, escape if the resource name contains special characters, otherwise do nothing.
Describe how to verify it
By installing the new jar package locally and retesting the resource name containing 6 special characters, there is no abnormality in the Record log, and there is no abnormality in the Mbean display.
Special notes for reviews
None