{"record":{"id":"371cdaae19da5f27","repo":"vectordotdev/vector","slug":"registered-log-schema-required","errorCode":null,"errorMessage":"registered log schema required","messagePattern":"registered log schema required","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/sources/datadog_agent/logs.rs","lineNumber":176,"sourceCode":"                            );\n\n                            // compute EstimatedJsonSizeOf before enrichment\n                            event_bytes_received += log.estimated_json_encoded_size_of();\n\n                            namespace.insert_standard_vector_source_metadata(\n                                log,\n                                DatadogAgentConfig::NAME,\n                                now,\n                            );\n\n                            if let Some(k) = &api_key {\n                                log.metadata_mut().set_datadog_api_key(Arc::clone(k));\n                            }\n\n                            let logs_schema_definition = source\n                                .logs_schema_definition\n                                .as_ref()\n                                .unwrap_or_else(|| panic!(\"registered log schema required\"));\n\n                            log.metadata_mut()\n                                .set_schema_definition(logs_schema_definition);\n                        }\n\n                        decoded.push(event);\n                    }\n                }\n                Ok(None) => break,\n                Err(error) => {\n                    // Error is logged by `vector_lib::codecs::Decoder`, no further\n                    // handling is needed here.\n                    if !error.can_continue() {\n                        break;\n                    }\n                }\n            }\n        }","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/src/sources/datadog_agent/logs.rs#L158-L194","documentation":"The Datadog Agent logs source panics when decoding a log body if logs_schema_definition is None. Vector's schema-aware event model requires every source that emits logs to have registered its log schema definition so decoded events can carry the correct schema metadata. A missing registration means the source was built without schema registration, which is treated as a programming error.","triggerScenarios":"decode_log_body processing a decoded log event while source.logs_schema_definition is None; constructing the DatadogAgentLogsSource manually without setting the schema; running with a build/config path where schema registration is skipped while schema support is expected.","commonSituations":"Custom builds or embedding the source in tests without calling the registration step; plugin/embedding code that constructs the source struct directly.","solutions":["Ensure the Datadog Agent source is built through its normal config/build path so the log schema is registered","In custom code, set logs_schema_definition before invoking decode_log_body","Check Vector version/schema feature flags; upgrade or enable schema support if registration was compiled out"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before decoding, ensure the schema is registered\nif source.logs_schema_definition.is_none() {\n    return Err(\"datadog_agent source built without log schema registration\".into());\n}","typeGuard":"fn has_log_schema(s: &DatadogAgentLogsSource) -> bool { s.logs_schema_definition.is_some() }","tryCatchPattern":null,"preventionTips":["Build the source via its config path so registration runs","Set logs_schema_definition explicitly in tests/custom constructors","Keep schema-related feature flags consistent across builds"],"tags":["rust","datadog","schema","panic","source"],"backgroundTag":"missing-required-argument","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}