Skip to content

Commit

Permalink
god forgive the creator of this parser and the creator of regex
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Fukushima <[email protected]>
  • Loading branch information
gfukushima committed Jan 9, 2025
1 parent aa3b682 commit 38a916b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static MetricValue parse(final String line) {

final Map<String, String> metricLabels = new HashMap<>();
final String labelsString = line.substring(line.indexOf("{") + 1, line.indexOf("}"));
final Pattern p = Pattern.compile("(.*?)=\"(.*?)\",");
final Pattern p = Pattern.compile("(.*?)=\"(.*?)\",?");
final Matcher m = p.matcher(labelsString);
while (m.find()) {
metricLabels.put(m.group(1), m.group(2));
Expand Down

0 comments on commit 38a916b

Please sign in to comment.