It's possible for a span to not have any annotations in which case, this would blow up. FlatMap over traceIds and have the body return an Option[TraceIdDuration] based on the existence of annotations.