{"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":"critical","filePath":"src/transforms/aws_ec2_metadata.rs","lineNumber":339,"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":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/vectordotdev/vector/blob/3708c39b12a93212ed8b8d7510b4cc7769cb5864/src/transforms/aws_ec2_metadata.rs#L321-L357","documentation":"The aws_ec2_metadata enrichment transform copies EC2 metadata into events. It handles Event::Log (insert fields) and Event::Metric (replace tags) explicitly; Event::Trace has no representation, so that match arm panics with 'Traces are not supported.' as a loud statement that traces must never reach this transform.","triggerScenarios":"A trace event (from an otlp/datadog_agent traces producer or synthetic source) routed into aws_ec2_metadata - e.g. via a route/filter transform forwarding all event kinds, or by calling the transform programmatically on a trace. Topology type-checking should reject trace inputs to this transform, so firing the panic means validation was bypassed or has a gap.","commonSituations":"Wildcard routing (inputs: [\"*\"]) on type-restricted transforms; custom topology code feeding mixed Event streams into a boxed transform; Vector versions where multi-output trace sources introduced validation gaps.","solutions":["Do not route traces into aws_ec2_metadata: keep a dedicated trace path and list only log/metric sources as inputs","Insert a filter or remap transform before it that drops or diverts trace events","Run `vector validate` - a valid config cannot produce this; check why the trace edge exists","If stock Vector hits it, report it: the transform should reject trace inputs at config time"],"exampleFix":"# before\ntransforms:\n  enrich:\n    type: aws_ec2_metadata\n    inputs: [\"*\"]\n\n# after\ntransforms:\n  enrich:\n    type: aws_ec2_metadata\n    inputs: [\"my_logs_source\", \"my_metrics_source\"]","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"fn ec2_metadata_eligible(event: &Event) -> bool {\n    matches!(event, Event::Log(_) | Event::Metric(_))\n}","tryCatchPattern":null,"preventionTips":["Declare explicit inputs instead of wildcards on type-restricted transforms","Add an upstream filter (condition like `!exists(.trace_id)`) when event kinds mix on a stream","Run `vector validate` so the type checker rejects invalid edges at config time"],"tags":["rust","vector","transform","aws-ec2-metadata","traces","event-type","panic"],"backgroundTag":"unsupported-event-type","analyzedSha":"3708c39b12a93212ed8b8d7510b4cc7769cb5864","analyzedAt":"2026-08-20T07:02:18.786Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T20:17:18.057Z"}