{"record":{"id":"46d3e37af47c844b","repo":"vectordotdev/vector","slug":"traces-are-not-supported","errorCode":null,"errorMessage":"Traces are not supported.","messagePattern":"Traces are not supported\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/transforms/aws_ec2_metadata.rs","lineNumber":338,"sourceCode":"    }\n}\n\nimpl Ec2MetadataTransform {\n    fn transform_one(&mut self, mut event: Event) -> Event {\n        let state = self.state.load();\n        match event {\n            Event::Log(ref mut log) => {\n                state.iter().for_each(|(k, v)| {\n                    log.insert(&k.log_path, v.clone());\n                });\n            }\n            Event::Metric(ref mut metric) => {\n                state.iter().for_each(|(k, v)| {\n                    metric\n                        .replace_tag(k.metric_tag.clone(), String::from_utf8_lossy(v).to_string());\n                });\n            }\n            Event::Trace(_) => panic!(\"Traces are not supported.\"),\n        }\n        event\n    }\n}\n\nstruct MetadataClient {\n    client: HttpClient<Body>,\n    host: Uri,\n    token: Option<(Bytes, Instant)>,\n    keys: Keys,\n    state: Arc<ArcSwap<Vec<(MetadataKey, Bytes)>>>,\n    refresh_interval: Duration,\n    refresh_timeout: Duration,\n    fields: HashSet<String>,\n    tags: HashSet<String>,\n}\n\n#[derive(Debug, Deserialize)]","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/src/transforms/aws_ec2_metadata.rs#L320-L356","documentation":"The AWS EC2 Metadata transform panics if it receives an Event::Trace, since it only transforms logs and metrics (annotating them with instance metadata). Trace events are unsupported by design and the panic makes that explicit instead of silently passing them through. This is an event-type routing problem in the topology.","triggerScenarios":"Wiring a traces-producing source (e.g. datadog_agent with traces, opentelemetry traces) into the aws_ec2_metadata transform's inputs; a route/filter passing trace events through to this transform.","commonSituations":"Users add the EC2 metadata enrichment transform to a catch-all pipeline that also carries traces, assuming it passes unknown event types through untouched.","solutions":["Remove aws_ec2_metadata from the trace event path in the topology","Insert a filter/route so only log and metric events reach the transform","If traces need enrichment, use a trace-capable transform instead"],"exampleFix":"// before\n[transforms.ec2_meta]\ntype = \"aws_ec2_metadata\"\ninputs = [\"everything\"]\n\n// after\n[transforms.ec2_meta]\ntype = \"aws_ec2_metadata\"\ninputs = [\"route.logs_and_metrics\"]","handlingStrategy":"validation","validationCode":"// Filter out traces before the transform\ninputs.iter().for_each(|e| assert!(!matches!(e, Event::Trace(_)), \"aws_ec2_metadata does not accept trace events\"));","typeGuard":"fn is_trace(e: &Event) -> bool { matches!(e, Event::Trace(_)) }","tryCatchPattern":null,"preventionTips":["Only feed logs/metrics into aws_ec2_metadata","Use route/filter transforms to split traces out of mixed streams","Check component docs for supported event classes before wiring"],"tags":["rust","transform","aws-ec2","panic","traces"],"backgroundTag":"unsupported-operation","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"}