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
{{ message }}
Repository navigation
Commit 00e9afb
Browse filesBrowse the repository at this point in the historyBrowse files
2. The configuration file: `resources/application.yml` | `.yaml` | `.properties` next to
17
17
the application file (the file `mercury-serve` is given, or the script `python app.py`
18
18
ran), never in the working directory; or `--config <path>`.
19
-
3.`${ENV_VAR:default}` substitution inside values: environment first, then a base
20
-
configuration key of that name, then the default.
19
+
3.`${ENV_VAR:default}` substitution inside values: the environment variable first, then the
20
+
configuration key of that name — a `-D` override of it before the file's value, as a key is
21
+
read — then the default. A reference that leads back to a key being resolved is logged
22
+
(`Config loop for 'key' detected`, as the engines log it) and has no value, so its default
23
+
stands. A value its references leave empty is no value either, as in the Java engine: with
24
+
`llm.effort: '${LLM_EFFORT:}'` and the variable unset, the key reads as its default — the
25
+
idiom for an optional setting — while an empty text written as one (`key: ''`) stays one.
26
+
27
+
## How a YAML file is read
28
+
29
+
Every YAML file of the pack — `application.yml`, `rest.yaml`, `app-log-context.yaml`, an
30
+
extension's own file — is read by **YAML 1.2.2**, the same way by the Python pack and the Node.js
31
+
pack. A scalar written without quotes is resolved by the core schema of the
32
+
specification (section 10.3.2), its rows tried in this order:
33
+
34
+
| Written | Read as |
35
+
|---------|---------|
36
+
| nothing, `~`, `null`, `Null`, `NULL`| no value: the key reads as a key that is not there, so its default applies |
37
+
|`true`, `True`, `TRUE`, `false`, `False`, `FALSE`| a boolean |
38
+
|`[-+]?[0-9]+` — `16000`, `-5`, `010`| an integer in base 10, exact at any size: `010` is 10 |
39
+
|`0o[0-7]+` — `0o17`| an integer in base 8 |
40
+
|`0x[0-9a-fA-F]+` — `0x1F`| an integer in base 16 |
41
+
|`[-+]?[0-9]+(\.[0-9]*)?([eE][-+]?[0-9]+)?` with a point or an exponent, or `[-+]?\.[0-9]+([eE][-+]?[0-9]+)?` — `1.5`, `16000.0`, `1e3`, `.5`| a float |
42
+
|`.inf`, `.Inf`, `.INF`, also with a sign; `.nan`, `.NaN`, `.NAN`| a float |
43
+
| anything else, and anything in quotes | text |
44
+
45
+
So `yes`, `no`, `on`, `off`, `y` and `n`, a number with an underscore (`16_000`), in base 2
46
+
(`0b101`) or in base 60 (`1:30`), `-0x10`, a date (`2026-11-30`), `=` and `<<` are text, and `<<`
47
+
as a key is a key like any other, not the merge key. A switch or a flag written `yes` is refused by
48
+
name (`rest.automation must be true or false`), never read as on and never as off. Under an
49
+
explicit tag a scalar is valid when the tag is one of the core schema's (`!!str`, `!!int`,
50
+
`!!float`, `!!bool`, `!!null`) and its content one of that tag's rows; a file with any other tag
51
+
(`!!binary`, `!!timestamp`, `!!set`) does not load.
52
+
53
+
### Write YAML 1.2.2, and none of the additional syntax of YAML 1.1
54
+
55
+
This is the recommendation for whoever writes a file, a developer or an AI assistant. The Java
56
+
engine's reader (SnakeYAML) reads YAML 1.1 and still accepts the older syntax, so a file that uses
57
+
it reads one way in the Java engine and another way in the packs. The Rust engine reads YAML 1.2 as
58
+
well; its library departs from the core schema in three spellings, which the table shows:
59
+
60
+
| Do not write | The Java engine reads | The Rust engine reads | The packs read | Write |
|`yes`, `no`, `on`, `off`| a boolean | text | text |`true`, `false`|
63
+
|`010`, `08`| 8 (base 8), text | text | 10, 8 |`10`, `8` — or `'010'` when it is text |
64
+
|`0o10`| text | 8 | 8 |`8`|
65
+
|`0b101`| 5 | 5 | text |`5`|
66
+
|`-0x10`| -16 | -16 | text |`-16`|
67
+
|`1:30`| 90 (base 60) | text | text |`90` — or `'1:30'` when it is text |
68
+
|`16_000`| 16000 | text | text |`16000`|
69
+
|`2026-11-30`| a date, written in the time zone of its JVM | text | text |`'2026-11-30'`|
70
+
|`<<: *base`| the merge key | a key named `<<`| a key named `<<`| the keys themselves |
71
+
72
+
`yes`/`no`/`on`/`off`, `0b101`, `1:30`, `16_000` and the merge key are syntax of YAML 1.1 only. A
73
+
number with a leading zero (`010`, `08`), `0o10` and an unquoted date are valid YAML 1.2.2 and are
74
+
to be avoided all the same, because the Java engine reads them another way and the Rust engine keeps a
75
+
number with a leading zero as text. `y` and `n`, booleans
76
+
in YAML 1.1 itself, are text in every runtime. The forms every runtime reads alike: `true` and `false`; a plain decimal number without a leading zero, an underscore or a
77
+
colon (`16000`, `-5`, `1.5`, `1e3`); `0x` for base 16 (`0x1F`); and quotes around any text that
78
+
could be read as a boolean, a number, a date or no value (`'true'`, `'010'`, `'1e3'`,
79
+
`'2026-11-30'`, `'null'`).
80
+
81
+
### The text of a value
82
+
83
+
As text — what `get_property` returns, and what a reference inside a longer text is replaced by — a
84
+
boolean is `true` or `false` and a float keeps its point (`1.0`, never `1`), so
85
+
`info.app.version: 1.0` reads `1.0` in both packs; a float is written as Python writes one, which
86
+
is the Java engine's text too between 0.001 and 10,000,000. A mapping key YAML read as something
87
+
other than text (`True:`, `8080:`) is the text of that value (`true`, `8080`). A tab is read as two
88
+
spaces, as the Java engine reads a file, so one indented with tabs loads. A file whose document is
89
+
not a mapping has no keys, and the last of two equal keys stands.
90
+
91
+
## A number, a duration and a switch
92
+
93
+
The settings of the host read these by one rule, the same in both packs; a value that is none of
94
+
them stops the start by name instead of being read as off or as a default:
95
+
96
+
-**a whole number** — a number with a whole value (`16000`, `16000.0`), or text of the digits
97
+
`0`-`9` with white space around them at most, up to 9007199254740991. A sign, an underscore, a
98
+
point or an exponent in text and a digit of another script are refused
99
+
(`rest.upload.max.bytes must be a whole number >= 0`);
100
+
-**a duration** — such a number, in seconds, or the number and, right after it, one of `ms`, `s`,
101
+
`m`, `h`, `d`: `30`, `30s`, `500ms`, `2m`
102
+
(`event.stream.keep.alive must be a duration such as 30s, 2m or 500ms (seconds, ms, s, m, h, d), or 0 for none`);
103
+
-**a switch** — the boolean `true` or `false`, or that text in any letter case; no value and an
104
+
empty one are the default (`rest.automation must be true or false`).
21
105
22
106
## Well-known keys (shared with the engines)
23
107
24
108
| Key | Meaning | Default |
25
109
|-----|---------|---------|
26
110
|`application.name`| application identity in logs, `/info` and `/health`|`application`|
27
-
|`rest.server.port`| Event API + actuator port |`8085`|
111
+
|`rest.server.port`| Event API + actuator port: a whole number up to 65535, `0` for one the system picks|`8085`|
28
112
|`log.format`|`text`, `json` (pretty-printed) or `compact` (single-line JSONL) |`text`|
29
113
|`log.level`| log level; the `LOG_LEVEL` environment variable wins |`INFO`|
114
+
|`app.log.context`| the application log context: a `context` block on every structured log line inside a traced request ([guide](function-patterns.md#trace-context-and-span-lineage)); a switch — `false` opts out, any value but `true` or `false` stops the start |`true`|
30
115
|`info.app.version`| version reported by `/info`| package version |
31
116
|`info.app.description`| description reported by `/info`|`application.name`|
32
117
|`show.env.variables`| opt-in list of environment variables shown by `/env`| (empty) |
33
118
|`show.application.properties`| opt-in list of configuration keys shown by `/env`| (empty) |
34
119
|`mandatory.health.dependencies`| routes of health check functions that decide `/health`| (empty) |
35
120
|`optional.health.dependencies`| health check routes reported but never affecting status | (empty) |
36
-
|`rest.automation`| REST automation on: the entries of `rest.yaml` served in front of the functions ([guide](rest-automation.md)) |`false`|
121
+
|`rest.automation`| REST automation on: the entries of `rest.yaml` served in front of the functions ([guide](rest-automation.md)); a switch — any value but `true` or `false` stops the start|`false`|
37
122
|`yaml.rest.automation`| the one location of `rest.yaml`: `classpath:` the resources folder, `file:` an absolute path, a relative path under the application file's folder |`classpath:/rest.yaml`|
38
-
|`rest.upload.max.bytes`| the bound on one upload: its files and its text fields together, counted in bytes (413 beyond it) |`16777216`|
123
+
|`rest.upload.max.bytes`| the bound on one upload: its files and its text fields together, counted in bytes (413 beyond it); a whole number|`16777216`|
39
124
|`http.trace.id.header`| the trace-id header a traced entry reads when no W3C `traceparent` arrives (`trace.id.header` overrides it per entry) |`X-Trace-Id`|
40
125
|`http.correlation.id.header`| the business correlation-id header, always ensured and echoed (`correlation.id.header` per entry) |`X-Correlation-Id`|
41
126
|`http.traceparent.header`| a custom name for the W3C `traceparent` header, read only when the standard one is absent (`traceparent.header` per entry) |`traceparent`|
42
-
|`event.stream.keep.alive`| the keep-alive comment interval of a Server-Sent Events reply (`/api/event` and streaming entries); `0` disables |`30s`|
127
+
|`event.stream.keep.alive`| the keep-alive comment interval of a Server-Sent Events reply (`/api/event` and streaming entries): a duration up to 2147483647 ms (about 24.8 days, the longest a timer of the Node.js pack holds); `0` disables |`30s`|
43
128
|`static.html.folder`| the folder of static web content the host serves for the paths nothing else claims — relative to the application file's folder ([guide](config-logging-actuators.md#static-content-the-engines-public-folder)) |`resources/public`|
44
-
|`otel.forwarding`| the OpenTelemetry forwarder's master switch ([guide](config-logging-actuators.md#distributed-tracing-the-opentelemetry-forwarder-opt-in)) |`false`|
129
+
|`otel.forwarding`| the OpenTelemetry forwarder's master switch ([guide](config-logging-actuators.md#distributed-tracing-the-opentelemetry-forwarder-opt-in)); a switch — any value but `true` or `false` stops the start|`false`|
45
130
|`otel.exporter.otlp.endpoint`| the OTLP/HTTP traces URL including the signal path |`http://localhost:4318/v1/traces`|
46
131
|`otel.exporter.otlp.headers`| request headers, `k=v` or `k: v`, comma-separated (re-read per export) | (none) |
47
132
|`otel.exporter.otlp.timeout`| per-export timeout in milliseconds |`10000`|
0 commit comments