pub fn remove_json_hooks(existing: Value, otel_keys: &[&str]) -> Option<Value>Expand description
Remove mi6 hooks from JSON settings.
This function handles the common pattern of removing mi6-related hooks:
- Iterates over all event types in the hooks object
- Filters out entries that contain “mi6” in their command
- Removes empty arrays and objects
- Optionally removes OTel environment variables
§Arguments
existing- The existing settings contentotel_keys- List of OTel-related environment variable names to remove
§Returns
Some(modified settings) if any mi6 hooks were removed, None otherwise