Skip to content

Commit 4ec7eca

Browse files
Merge pull request killbill#632 from vnandwana/health-config
Added documentation for property precedence order, per-tenant configuration and /v1/health/config endpoint.
2 parents 9a1ba5c + 4dd655c commit 4ec7eca

File tree

1 file changed

+60
-7
lines changed

1 file changed

+60
-7
lines changed

userguide/aviate/aviate-health.adoc

Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,69 @@ The metrics exposed by the Aviate plugin can mainly be categorized in the follow
9797

9898
Properties can be specified to configure the Kill Bill system including its plugins. The following https://docs.killbill.io/latest/userguide_configuration#configuration_properties_table[documentation] shows the main configuration properties.
9999

100+
The values for these properties can come from multiple sources, each with a defined precedence.
100101

101-
The values for these properties can come from a number of sources and the system will evaluate based on the following order:
102+
==== Property Resolution Order (Highest to Lowest)
103+
Kill Bill resolves property values in the following order, where higher precedence sources override lower ones:
102104

103-
* Immutable system properties: Properties set by the Kill Bill system - e.g. `user.timezone` set to `GMT`
104-
* Tenant configurations: Properties that have been overridden on a per-tenant level
105-
* Environment variables: Environment variables that have been set using the `KB_org_*` syntax
106-
* Runtime configurations: Properties that can be specified as a system property using the `-D<propName>=<propValue>` syntax or through a system property file identified by the system property `-Dorg.killbill.server.properties=<propertyFile>`
107-
* Default property values: Default values if none of the above overrode the default value
105+
* Immutable System Property
108106

109-
This flexibility is offered by default and it allows to adopt different deployment models along with a fine grained granularity at the tenant level. However, to make it easier to understand the runtime values of these properties, we have created the endpoint `/v1/health/config`: It provides the view of what the system is running along with the required information about where each property value comes from.
107+
Includes the `user.timezone` property, which is force set to `GMT`.
108+
109+
This property cannot be overridden.
110+
111+
* Environment Variables
112+
113+
Properties prefixed with `KB_org_` (for example, `KB_org_killbill_dao_url` maps to `org.killbill.dao.url`).
114+
115+
These are loaded only when `org.killbill.server.lookupEnvironmentVariables` is set to `true` (this is enabled by default).
116+
117+
These properties take the highest precedence among other configurable sources.
118+
119+
* Runtime Configuration
120+
121+
Properties loaded from a configuration file specified via `-Dorg.killbill.server.properties=<propertyFile>`.
122+
123+
If no file is specified, Kill Bill uses JVM system properties defined via `-Dproperty=value`.
124+
125+
This source has the second-highest precedence among configurable sources.
126+
127+
* Kill Bill Defaults
128+
129+
These are default values defined within the Kill Bill codebase.
130+
131+
They are registered dynamically by various *Config classes during application startup, covering configuration domains such as CatalogConfig, DaoConfig, LifecycleConfig, SecurityConfig, InvoiceConfig, PaymentConfig, OSGIConfig, and others.
132+
133+
The following defaults are applied only when a property is not defined in any higher precedence source:
134+
135+
org.killbill.persistent.bus.external.tableName=bus_ext_events
136+
org.killbill.persistent.bus.external.historyTableName=bus_ext_events_history
137+
org.killbill.server.enableJasypt=false
138+
org.killbill.server.lookupEnvironmentVariables=true
139+
org.slf4j.simpleLogger.log.jdbc=ERROR
140+
141+
142+
143+
When a property is defined in multiple sources, Kill Bill applies the value from the highest precedence source and logs a warning indicating which sources defined it and which value was chosen.
144+
145+
Example warning:
146+
147+
`Property conflict detected for 'org.killbill.dao.healthCheckConnectionTimeout':
148+
defined in sources [RuntimeConfiguration, EnvironmentVariables] -
149+
using value from 'EnvironmentVariables': '11s'`
150+
151+
152+
To make it easier to understand the runtime values of these properties, Kill Bill provides the https://killbill.github.io/slate/aviate-health.html#retrieve-runtime-configuration[/v1/health/config] endpoint.
153+
This endpoint displays the effective configuration currently in use along with information about which source each property value was derived from.
154+
155+
156+
==== Per-Tenant Configuration
157+
158+
In addition to system-wide properties, Kill Bill supports per-tenant configuration, allowing tenants to override specific system properties for their own environment.
159+
160+
This provides fine-grained control in multi-tenant deployments, enabling different tenants to customize selected settings while still inheriting defaults from the global configuration.
161+
162+
For more details, see the official documentation: https://docs.killbill.io/latest/userguide_configuration#_per_tenant_properties.
110163

111164

112165
=== Queue Metrics

0 commit comments

Comments
 (0)