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

PAYARA-3260 Metrics API produces invalid metric names for Prometheus (Payara 4.x) #3660

Merged
merged 1 commit into from Jan 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -308,9 +308,9 @@ private String sanitizeMetricName(String name) {
//Translation rules :
//camelCase is translated to camel_case
String out = name.replaceAll("(.)(\\p{Upper})", "$1_$2").toLowerCase();
//Dot (.), Space ( ), Dash (-) are translated to underscore (_)
//Dot (.), Space ( ), Dash (-), Slash (/) are translated to underscore (_)
//Double underscore is translated to single underscore
out = out.replaceAll("[-_.\\s]+", "_");
out = out.replaceAll("[-_./\\s]+", "_");
//Colon-underscore (:_) is translated to single colon
out = out.replaceAll(":_", ":");
return out;
Expand Down