Conversation
Use `serde_ignored` to detect unrecognized keys in the merged config (YAML + env vars) and emit warnings at startup. Since config is loaded before tracing is initialized, warnings are buffered in a static log queue and flushed once `init_tracing` completes.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| tracing::Level::WARN, | ||
| format!("Ignoring unknown config key `{unknown_path}`"), | ||
| ); | ||
| })?; |
There was a problem hiding this comment.
False positive warnings from default storage config fields
Medium Severity
The serde_ignored check runs against the full merged figment Value, which includes deep-merged defaults. Since Config::default() uses StorageConfig::FileSystem(FileSystemConfig { path: "data" }), figment's deep merge retains storage.path even when a user switches to a different backend (e.g., S3, GCS, BigTable). The serde_ignored::deserialize then flags storage.path as an unknown key, producing a spurious warning on every non-filesystem deployment — which is essentially every production environment.


Uses
serde_ignoredto detect unrecognized keys after merging the YAMLfile and environment variables, emitting a warning per unknown key.
Since config is loaded before tracing is initialized, warnings are
buffered in a static log queue (
BufferedLogsState) and flushed onceinit_tracingcompletes. Thelog_or_bufferfunction handles therouting: if tracing is ready it emits immediately, otherwise it queues.
This helps catch typos and stale keys that would otherwise be silently
ignored by Figment's default deserialization.