File tree Expand file tree Collapse file tree
src/main/java/de/sldk/mc/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8+ ## [ Unreleased] - 2024-01-02
9+
10+ Special thanks to all new and old contributors :star :
11+
12+ ### Fixed
13+ - [ #197 ] ( https://github.com/sladkoff/minecraft-prometheus-exporter/issues/197 ) : Plugin crashes on Azul JVM
14+
15+
816## [ v2.5.0] - 2022-04-11
917
1018Special thanks to all new and old contributors :star :
Original file line number Diff line number Diff line change @@ -61,16 +61,22 @@ public void loadDefaultsAndSave() {
6161 public void enableConfiguredMetrics () {
6262 PrometheusExporterConfig .METRICS
6363 .forEach (metricConfig -> {
64- Metric metric = metricConfig .getMetric (prometheusExporter );
65- Boolean enabled = get (metricConfig );
64+ String metricName = metricConfig .getClass ().getSimpleName ();
65+ try {
66+ Metric metric = metricConfig .getMetric (prometheusExporter );
67+ Boolean enabled = get (metricConfig );
6668
67- if (Boolean .TRUE .equals (enabled )) {
68- metric .enable ();
69- }
69+ if (Boolean .TRUE .equals (enabled )) {
70+ metric .enable ();
71+ }
7072
71- prometheusExporter .getLogger ().fine ("Metric " + metric . getClass (). getSimpleName () + " enabled: " + enabled );
73+ prometheusExporter .getLogger ().fine ("Metric " + metricName + " enabled: " + enabled );
7274
73- MetricRegistry .getInstance ().register (metric );
75+ MetricRegistry .getInstance ().register (metric );
76+ } catch (Exception e ) {
77+ prometheusExporter .getLogger ().warning ("Failed to enable metric " + metricName + ": " + e .getMessage ());
78+ prometheusExporter .getLogger ().log (java .util .logging .Level .FINE , "Failed to enable metric " + metricName , e );
79+ }
7480 });
7581 }
7682
You can’t perform that action at this time.
0 commit comments