better empty check in metric tracing