Skip to content

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).

@fstab fstab force-pushed the jvm_classes_loaded branch from 153d392 to 8995637 Compare August 6, 2021 22:19
@fstab fstab merged commit 17c98eb into master Aug 6, 2021
@fstab fstab deleted the jvm_classes_loaded branch August 6, 2021 22:25
@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.

3 participants