You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+28-1
Original file line number
Diff line number
Diff line change
@@ -40,14 +40,41 @@ See [Health Checks](#health-checks) for more information on how to build your ow
40
40
41
41
## Installation & Configuration
42
42
43
+
#### Configuration Hierarchy
44
+
45
+
The Prometheus metrics exporter plugin supports multiple configuration sources for the HTTP endpoint (host/port). The configuration is applied in the following order of priority:
46
+
47
+
1.**Environment Variables:**
48
+
-`MINECRAFT_PROMETHEUS_EXPORTER_HOST`
49
+
-`MINECRAFT_PROMETHEUS_EXPORTER_PORT`
50
+
If these environment variables are set, their values will override all other settings.
51
+
52
+
2.**System Properties:**
53
+
-`minecraft.prometheus.exporter.host`
54
+
-`minecraft.prometheus.exporter.port`
55
+
If the environment variables are not provided, the plugin checks these system properties. They can be set when launching the JVM.
56
+
57
+
3.**Configuration File:**
58
+
If neither environment variables nor system properties are defined, the plugin falls back to the values in the configuration file.
59
+
60
+
43
61
### Plugin config
44
62
45
63
The default configuration file will be created after the first use of the plugin.
46
64
47
65
```yml
48
66
# Note that the HTTP server binds to localhost by default.
49
-
# If your Prometheus runs on another host or inside a Kubernetes cluster
67
+
# If your Prometheus runs on another host or inside a Kubernetes cluster,
50
68
# set this to any reachable IP or 0.0.0.0 to listen on all interfaces.
69
+
#
70
+
# These settings can be overridden by environment variables or system properties.
71
+
# Environment variables:
72
+
# - MINECRAFT_PROMETHEUS_EXPORTER_HOST: Overrides the host setting (e.g., 0.0.0.0)
73
+
# - MINECRAFT_PROMETHEUS_EXPORTER_PORT: Overrides the port setting (e.g., 9001)
74
+
#
75
+
# System properties (set during JVM startup):
76
+
# -Dminecraft.prometheus.exporter.host=0.0.0.0
77
+
# -Dminecraft.prometheus.exporter.port=9001
51
78
host: localhost
52
79
# The port can be changed in case it conflicts with any other application.
0 commit comments