Currently messages produced by the event handler interface are formatted as “flat”-style strings, prepended with a list of comma-separated attributes. As a means to improve the structure of our event handler messages we will update the event handler to optionally allow the formatting of messages as JSON-encoded strings. This introduces a structured, reliable and easy to parse message format that can be flexibly extended to expose new metadata attributes. An example converting between flat-style strings to JSON-encoded strings:
Style | Example |
---|---|
Flat String Version | [1633567623:999634][4202:0x7f843dae3740], test_verbose.test_verbose.test_long_running, WT_CONNECTION.close: [WT_VERB_EVICTSERVER] waking, bytes inuse <= max (0MB <= 100MB) |
JSON Version | "ts_sec": "1633567623", "ts_usec": "999634", "thread": "4202:0x7f843dae3740", "err_prefix": "test_verbose.test_verbose.test_long_running", "session_name": "WT_CONNECTION.close", "category": "WT_VERB_EVICTSERVER", "category_id": 5, "verbose_level": "WT_DEBUG_1", "verbose_level_id": "1", "msg": "waking, bytes inuse <= max (0MB <= 100MB)" Note: omitted wrapping curly brackets due to jira formatting issues |
Definition of Done:
- Introduce connection configuration option to enable the JSON-encoded strings - 'verbose_json'. In absence of the configuration option, WiredTiger will default to the legacy flat-style strings.
- Expand the event handler implementation (eventv) to format message strings into JSON-encoded strings (when the configuration option is enabled).
- Encode the JSON message to be inline with the above schema, reformatting the attributes appended by 'eventv' as JSON-fields (e.g. timestamp, thread name, session name etc.)
- The legacy flat-string format should remain un-impacted i.e. the format remains unchanged.
Documentation of this functionality will be done in WT-8261.
- is depended on by
-
WT-8396 Integrate '__wt_progress' to support JSON-encoded messages
- Closed
- is documented by
-
WT-8261 Update WiredTiger Doxygen documentation to reflect new JSON configuration option and schema
- Closed
- tested by
-
WT-8260 Create a Python suite test to validate new EVENT_HANDLER JSON format
- Closed