{"record":{"id":"1b1688c0cfcca3dc","repo":"vectordotdev/vector","slug":"global-log-schema-source-type-key-to-be-valid-path-mod","errorCode":null,"errorMessage":"global log_schema.source_type_key to be valid path","messagePattern":"global log_schema\\.source_type_key to be valid path","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/sources/datadog_agent/mod.rs","lineNumber":480,"sourceCode":"        protocol: &'static str,\n        logs_schema_definition: Option<schema::Definition>,\n        log_namespace: LogNamespace,\n        parse_ddtags: bool,\n        split_metric_namespace: bool,\n    ) -> Self {\n        Self {\n            api_key_extractor: ApiKeyExtractor {\n                store_api_key,\n                matcher: Regex::new(r\"^/v1/input/(?P<api_key>[[:alnum:]]{32})/??\")\n                    .expect(\"static regex always compiles\"),\n            },\n            log_schema_host_key: log_schema()\n                .host_key_target_path()\n                .expect(\"global log_schema.host_key to be valid path\")\n                .clone(),\n            log_schema_source_type_key: log_schema()\n                .source_type_key_target_path()\n                .expect(\"global log_schema.source_type_key to be valid path\")\n                .clone(),\n            decoder,\n            protocol,\n            logs_schema_definition: logs_schema_definition.map(Arc::new),\n            log_namespace,\n            events_received: register!(EventsReceived),\n            parse_ddtags,\n            split_metric_namespace,\n        }\n    }\n\n    fn build_warp_filters(\n        &self,\n        handler: RequestHandler,\n        config: &DatadogAgentConfig,\n    ) -> crate::Result<BoxedFilter<(Response,)>> {\n        let mut filters =\n            (!config.disable_logs).then(|| logs::build_warp_filter(handler.clone(), self.clone()));","sourceCodeStart":462,"sourceCodeEnd":498,"githubUrl":"https://github.com/vectordotdev/vector/blob/0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460/src/sources/datadog_agent/mod.rs#L462-L498","documentation":"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.","triggerScenarios":"Launching Vector with a datadog_agent source while `log_schema.source_type_key` (global config) is empty or contains characters that fail path parsing.","commonSituations":"Custom log_schema blocks with malformed keys; env templating injecting empty strings; copying config fragments with placeholder values like \"<key>\" left unsubstituted.","solutions":["Provide a valid path for log_schema.source_type_key (e.g. \"source_type\").","Delete the override to use the built-in default.","Render your config template and inspect the resolved log_schema section before launching."],"exampleFix":"# before\nlog_schema:\n  source_type_key: \"\"\n# after\nlog_schema:\n  source_type_key: \"source_type\"","handlingStrategy":"validation","validationCode":"// validate before starting vector:\n// vector validate --no-environment config.yaml\nif !source_type_key.is_empty() && lookup_path(source_type_key).is_none() {\n    eprintln!(\"invalid log_schema.source_type_key: {}\", source_type_key);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use defaults (\"source_type\") unless a custom key is truly needed.","Run `vector validate` in CI pipelines.","Avoid placeholder strings left from config templates."],"tags":["rust","panic","config","log-schema"],"backgroundTag":"invalid-config-value","analyzedSha":"0d4ab78a4f0d9c9e5d03a50108a2ae4d2f4b2460","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}