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

Java 9 pool names contain single quotes which breaks Graphite #1322

Closed
maxmil opened this issue Jun 21, 2018 · 3 comments
Closed

Java 9 pool names contain single quotes which breaks Graphite #1322

maxmil opened this issue Jun 21, 2018 · 3 comments
Labels

Comments

@maxmil
Copy link

maxmil commented Jun 21, 2018

Memory metrics generated have single quotes in their names.

For example: jvm.memory.pools.CodeHeap-'profiled-nmethods'

This starts in Java 9 with extra pools that were added as part of JEP 197.

This breaks our graphite which creates the directory for these whisper metrics that does not contain spaces (mkdir strips the spaces out from the name).

When subsequent updates are received for the metric they fail as they are looking for the directory with quotes in the name.

A safe solution would be replacing quotes in the pool name, just as you do for whitespaces.

final String poolName = name("pools", WHITESPACE.matcher(pool.getName()).replaceAll("-"));

@maxmil
Copy link
Author

maxmil commented Jun 27, 2018

Referencing the same issue #731

@maxmil
Copy link
Author

maxmil commented Jun 27, 2018

On closer inspection it looks like this was already done here #637 and rolled back here #1099.

I'm happy with leaving only basic sanitation, we can make a fix for our environment and in newer versions of graphite (we are still on 0.9.10) I don't think it is a problem.

However I'm not sure why the MemoryUsageGaugeSet needs to reimplement it's own sanitizer. It looks like it doesn't need to if metric names are sanitized in the GraphiteSenders.

public void send(String name, String value, long timestamp) throws IOException {

@github-actions
Copy link

github-actions bot commented Sep 1, 2019

This issue is stale because it has been open 180 days with no activity. Remove the "stale" label or comment or this will be closed in 14 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant