Add diagnostics tracing