{"record":{"id":"9bbc8adf94a6a69a","repo":"vectordotdev/vector","slug":"message-is-required-make-sure-the-message-seman","errorCode":null,"errorMessage":"message is required (make sure the \"message\" semantic meaning is set)","messagePattern":"message is required \\(make sure the \"message\" semantic meaning is set\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/sinks/datadog/events/sink.rs","lineNumber":57,"sourceCode":"            })\n            .into_driver(self.service)\n            .run()\n            .await\n    }\n}\n\nasync fn ensure_required_fields(event: Event) -> Option<Event> {\n    let mut log = event.into_log();\n\n    if !log.contains(event_path!(\"title\")) {\n        emit!(ParserMissingFieldError::<DROP_EVENT> { field: \"title\" });\n        return None;\n    }\n\n    if !log.contains(event_path!(\"text\")) {\n        let message_path = log\n            .message_path()\n            .expect(\"message is required (make sure the \\\"message\\\" semantic meaning is set)\")\n            .clone();\n        log.rename_key(&message_path, event_path!(\"text\"));\n    }\n\n    if !log.contains(event_path!(\"host\"))\n        && let Some(host_path) = log.host_path().cloned().as_ref()\n    {\n        log.rename_key(host_path, event_path!(\"host\"));\n    }\n\n    if !log.contains(event_path!(\"date_happened\"))\n        && let Some(timestamp_path) = log.timestamp_path().cloned().as_ref()\n    {\n        log.rename_key(timestamp_path, event_path!(\"date_happened\"));\n    }\n\n    if !log.contains(event_path!(\"source_type_name\"))\n        && let Some(source_type_path) = log.source_type_path().cloned().as_ref()","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/vectordotdev/vector/blob/3708c39b12a93212ed8b8d7510b4cc7769cb5864/src/sinks/datadog/events/sink.rs#L39-L75","documentation":"The Datadog Events sink maps missing required fields onto semantic meanings: when an event lacks a 'text' field it renames the log's message field, located via log.message_path(). That method returns the 'message' semantic meaning path (Vector log namespace) or the global log_schema.message_key (legacy namespace); if neither exists the Option is None and this expect panics inside the sink's event path.","triggerScenarios":"An event reaches the datadog_events sink with no 'text' field and no resolvable message path: a Vector-namespace event whose source never set the message meaning, log_schema.message_key explicitly nulled in global config (legacy namespace), or programmatically constructed events in tests.","commonSituations":"Setting log_schema.message_key to null/empty globally; custom sources or exec inputs that skip semantic-meaning assignment; events shaped for other sinks routed into datadog_events.","solutions":["Add a remap transform before the sink that guarantees .text exists (e.g. .text = string(.message) ?? \"\")","Remove log_schema.message_key overrides so the global message key resolves","Ensure sources emitting Vector-namespace events assign the 'message' meaning or set the field explicitly","File an issue: this path should drop the event or emit ParserMissingFieldError instead of panicking"],"exampleFix":"# before\n[transforms.pre]\ntype = \"remap\"\n# no .text handling; events without text hit the panic\n\n# after\n[transforms.pre]\ntype = \"remap\"\nsource = '.text = string(.message) ?? \"\"'","handlingStrategy":"validation","validationCode":"# VRL guard before the datadog_events sink\nif !exists(.text) {\n  if exists(.message) {\n    .text = string(.message)\n  } else {\n    abort\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never null out log_schema.message_key globally","Ensure a remap transform guarantees .title/.text before datadog_events","Unit-test the sink path with events that lack text to prove the guard works"],"tags":["rust","vector","datadog","logs-schema","semantic-meaning","panic"],"backgroundTag":"missing-required-argument","analyzedSha":"3708c39b12a93212ed8b8d7510b4cc7769cb5864","analyzedAt":"2026-08-20T07:02:18.786Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T20:17:18.057Z"}