vectordotdev/vector · error

global log_schema.source_type_key to be valid path

Error message

global log_schema.source_type_key to be valid path

What it means

Same construction-time check as the host key, applied to log_schema.source_type_key: the Datadog Agent source panics if the global source-type key cannot be parsed into a valid event target path. It guards the invariant that the global schema keys are always valid paths.

Solutions

  1. Provide a valid path for log_schema.source_type_key (e.g. "source_type").
  2. Delete the override to use the built-in default.
  3. Render your config template and inspect the resolved log_schema section before launching.

Example fix

# before
log_schema:
  source_type_key: ""
# after
log_schema:
  source_type_key: "source_type"
Defensive patterns

Strategy: validation

Validate before calling

// validate before starting vector:
// vector validate --no-environment config.yaml
if !source_type_key.is_empty() && lookup_path(source_type_key).is_none() {
    eprintln!("invalid log_schema.source_type_key: {}", source_type_key);
}

Prevention

When it happens

Trigger: Launching Vector with a datadog_agent source while `log_schema.source_type_key` (global config) is empty or contains characters that fail path parsing.

Common situations: Custom log_schema blocks with malformed keys; env templating injecting empty strings; copying config fragments with placeholder values like "<key>" left unsubstituted.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of vectordotdev/vector@0d4ab78a4f (2026-09-16). Data as JSON: /api/errors/1b1688c0cfcca3dc. Report an issue: GitHub.

Appendix: source

Thrown at src/sources/datadog_agent/mod.rs:480

        protocol: &'static str,
        logs_schema_definition: Option<schema::Definition>,
        log_namespace: LogNamespace,
        parse_ddtags: bool,
        split_metric_namespace: bool,
    ) -> Self {
        Self {
            api_key_extractor: ApiKeyExtractor {
                store_api_key,
                matcher: Regex::new(r"^/v1/input/(?P<api_key>[[:alnum:]]{32})/??")
                    .expect("static regex always compiles"),
            },
            log_schema_host_key: log_schema()
                .host_key_target_path()
                .expect("global log_schema.host_key to be valid path")
                .clone(),
            log_schema_source_type_key: log_schema()
                .source_type_key_target_path()
                .expect("global log_schema.source_type_key to be valid path")
                .clone(),
            decoder,
            protocol,
            logs_schema_definition: logs_schema_definition.map(Arc::new),
            log_namespace,
            events_received: register!(EventsReceived),
            parse_ddtags,
            split_metric_namespace,
        }
    }

    fn build_warp_filters(
        &self,
        handler: RequestHandler,
        config: &DatadogAgentConfig,
    ) -> crate::Result<BoxedFilter<(Response,)>> {
        let mut filters =
            (!config.disable_logs).then(|| logs::build_warp_filter(handler.clone(), self.clone()));

View on GitHub (pinned to 0d4ab78a4f)