Skip to content

Commit

Permalink
feat: added the ability to set server name via environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Cubxity committed Jul 9, 2021
1 parent ac39d01 commit 907c1b5
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ data class UnifiedMetricsConfig(

@Serializable
data class UnifiedMetricsServerConfig(
val name: String = "global"
val name: String = env("SERVER_NAME", "global")
)

@Serializable
Expand All @@ -45,4 +45,7 @@ data class UnifiedMetricsCollectorsConfig(
val world: Boolean = true,
val tick: Boolean = true,
val events: Boolean = true
)
)

private fun env(name: String, default: String): String =
System.getenv("UNIFIEDMETRICS_$name") ?: default

0 comments on commit 907c1b5

Please sign in to comment.