{"record":{"id":"fec7381430fbda50","repo":"dbt-labs/dbt-core","slug":"telemetry-hasn-t-been-properly-initialized-missin","errorCode":null,"errorMessage":"Telemetry hasn't been properly initialized. Missing span event attributes","messagePattern":"Telemetry hasn't been properly initialized\\. Missing span event attributes","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/dbt-tracing/src/span_info.rs","lineNumber":268,"sourceCode":"        }\n    });\n}\n\n/// Records the status of a span for the closest span with the expected\n/// `TelemetryAttributes` type starting from the current span and going up.\n///\n/// If no such span is found, this is a no-op.\npub fn find_and_record_span_status<A: AnyTelemetryEvent>(error_message: Option<&str>) {\n    with_current_span(|span_ref| {\n        // Find the closest span with the expected TelemetryAttributes type.\n        // Scope iterator starts from the current span and goes up to the root.\n        for span_ref in span_ref.scope() {\n            let mut span_ext_mut = span_ref.extensions_mut();\n\n            if span_ext_mut\n                // Get the current attributes\n                .get_mut::<TelemetryAttributes>()\n                .expect(\"Telemetry hasn't been properly initialized. Missing span event attributes\")\n                // Try downcasting to the expected type\n                .is::<A>()\n            {\n                // Found the expected attributes, call the updater and return\n                record_span_status_on_ref(&mut span_ext_mut, error_message);\n                return;\n            }\n        }\n    });\n}\n\n/// Records the status and attributes of the given span.\n///\n/// If `error_message` is `None`, the status code will be set to `Ok`,\n/// otherwise it will be set to `Error`.\n///\n/// The `attrs_updater` closure receives a mutable reference to the current\n/// attributes and should modify them in place.","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-tracing/src/span_info.rs#L250-L286","documentation":"Invariant expect in find_and_record_span_status: a span whose TelemetryAttributes extension type matches the expected one was found, but its span-event attributes were missing, meaning telemetry was never properly initialized for that span. This is an internal telemetry-setup defect, not a user-facing condition; spans without the matching attributes type are silently skipped instead.","triggerScenarios":"Thrown at crates/dbt-tracing/src/span_info.rs:268 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure telemetry initialization attaches TelemetryAttributes to spans at creation time","Check that the span creation macro/path sets the event attributes extension","Report as an internal bug in dbt-tracing span setup"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}