TLA Line data Source code
1 : #[cfg(debug_assertions)]
2 : use utils::tracing_span_assert::{check_fields_present, MultiNameExtractor};
3 :
4 : #[cfg(not(debug_assertions))]
5 : pub(crate) fn debug_assert_current_span_has_tenant_id() {}
6 :
7 : #[cfg(debug_assertions)]
8 : pub(crate) static TENANT_ID_EXTRACTOR: once_cell::sync::Lazy<MultiNameExtractor<1>> =
9 CBC 553 : once_cell::sync::Lazy::new(|| MultiNameExtractor::new("TenantId", ["tenant_id"]));
10 :
11 : #[cfg(debug_assertions)]
12 : #[track_caller]
13 2788 : pub(crate) fn debug_assert_current_span_has_tenant_id() {
14 2788 : if let Err(missing) = check_fields_present!([&*TENANT_ID_EXTRACTOR]) {
15 UBC 0 : panic!("missing extractors: {missing:?}")
16 CBC 2788 : }
17 2788 : }
|