diff --git a/sbroad-core/src/otm.rs b/sbroad-core/src/otm.rs
index c0df93b0ed1b909c4af861b226d57153f5ec8b10..f7c62a139a1270c9f98b3f3863b19bde9510e2e5 100644
--- a/sbroad-core/src/otm.rs
+++ b/sbroad-core/src/otm.rs
@@ -216,22 +216,6 @@ where
     f()
 }
 
-#[inline]
-#[allow(unreachable_code)]
-#[allow(unused_variables)]
-#[allow(clippy::needless_pass_by_value)]
-pub fn stat_query_span<T, F>(name: &'static str, sql: &str, id: &str, tracer: TracerRef, f: F) -> T
-where
-    F: FnOnce() -> T,
-{
-    #[cfg(all(feature = "tracing", not(feature = "mock")))]
-    {
-        let ctx = Context::new();
-        return query_span(name, &id, tracer, &ctx, sql, f);
-    }
-    f()
-}
-
 #[inline]
 #[allow(unreachable_code)]
 #[allow(unused_variables)]