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

Prevent name conflicts and rename jvm_classes_loaded #681

Merged
merged 1 commit into from Aug 6, 2021

Conversation

fstab
Copy link
Member

@fstab fstab commented Aug 6, 2021

The ClassLoadingExports collector provides a Gauge named jvm_classes_loaded and a Counter named jvm_classes_loaded_total. This is an illegal name conflict in OpenMetrics, and this is also the root cause for prometheus/jmx_exporter#621.

This PR renames jvm_classes_loaded to jvm_classes_currently_loaded.

This is a breaking change. Prometheus queries referencing jvm_classes_loaded need to be adapted to the new name jvm_classes_currently_loaded.

Moreover, the PR adds a check in CollectorRegistry.register(Collector) to prevent collectors with such name conflicts from being registered.

The check will be performed if the Collector implements Collector.Describable, or if CollectorRegistry.autoDescribe is true (it's true by default for the CollectorRegistry.defaultRegistry and false by default for custom registries).

Signed-off-by: Fabian Stäber <fabian@fstab.de>
@fmmr
Copy link

fmmr commented Sep 16, 2021

starting solr (and other apps) with prometheus and calling DefaultExports.initialize() now fails: - #699

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

Successfully merging this pull request may close these issues.

None yet

2 participants