def _get_event_otel_spans(record_id: str) -> List[OtelSpan]:
    """Get all event spans for a given record ID.

    Args:
        record_id: The record ID to get events for.

    Returns:
        A list of OtelSpans for all events corresponding to the given record ID.
    """
    session = get_session()
    db = session.connector.db

    if not db or not hasattr(db, "get_events_by_record_id"):
        st.error(
            f"Error getting events by record {record_id}: database must support OTEL spans"
        )
        return []

    try:
        events_df = db.get_events_by_record_id(record_id)
        return _convert_events_to_otel_spans(events_df)
    except Exception as e:
        st.error(f"Error getting events for record {record_id}: {e}")
        return []
Get all event spans for a given record ID.

    Args:
        record_id: The record ID to get events for.

    Returns:
        A list of OtelSpans for all events corresponding to the given record ID.
    
src/dashboard/trulens/dashboard/utils/dashboard_utils.py