vectordotdev/vector · critical

registered log schema required

Error message

registered log schema required

What it means

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.

Solutions

  1. Ensure the Datadog Agent source is built through its normal config/build path so the log schema is registered
  2. In custom code, set logs_schema_definition before invoking decode_log_body
  3. Check Vector version/schema feature flags; upgrade or enable schema support if registration was compiled out
Defensive patterns

Strategy: validation

Validate before calling

// Before decoding, ensure the schema is registered
if source.logs_schema_definition.is_none() {
    return Err("datadog_agent source built without log schema registration".into());
}

Type guard

fn has_log_schema(s: &DatadogAgentLogsSource) -> bool { s.logs_schema_definition.is_some() }

Prevention

When it happens

Trigger: 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.

Common situations: Custom builds or embedding the source in tests without calling the registration step; plugin/embedding code that constructs the source struct directly.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16). Data as JSON: /api/errors/371cdaae19da5f27. Report an issue: GitHub.

Appendix: source

Thrown at src/sources/datadog_agent/logs.rs:176

                            );

                            // compute EstimatedJsonSizeOf before enrichment
                            event_bytes_received += log.estimated_json_encoded_size_of();

                            namespace.insert_standard_vector_source_metadata(
                                log,
                                DatadogAgentConfig::NAME,
                                now,
                            );

                            if let Some(k) = &api_key {
                                log.metadata_mut().set_datadog_api_key(Arc::clone(k));
                            }

                            let logs_schema_definition = source
                                .logs_schema_definition
                                .as_ref()
                                .unwrap_or_else(|| panic!("registered log schema required"));

                            log.metadata_mut()
                                .set_schema_definition(logs_schema_definition);
                        }

                        decoded.push(event);
                    }
                }
                Ok(None) => break,
                Err(error) => {
                    // Error is logged by `vector_lib::codecs::Decoder`, no further
                    // handling is needed here.
                    if !error.can_continue() {
                        break;
                    }
                }
            }
        }

View on GitHub (pinned to bdb87aeaa4)