def record_viewer_otel(
    spans: List[OtelSpan], key: Optional[str] = None
) -> None:
    """Create a new instance of "record_viewer_otel", which produces a record viewer for the OTEL spans.

    Args:
        spans: List of spans to be displayed in the timeline. It is the caller's responsibility
               to select the spans to be displayed. The simplest way to get the spans is to
               get the rows from the ORM.Events table, then call to_dict(orient="records") on the rows.
    """

    # Call through to our private component function. Arguments we pass here
    # will be sent to the frontend, where they'll be available in an "args"
    # dictionary.
    #
    # "default" is a special argument that specifies the initial return
    # value of the component before the user has interacted with it.
    global _record_viewer_otel

    if _record_viewer_otel is None:
        if not _RELEASE:
            _record_viewer_otel = components.declare_component(
                # We give the component a simple, descriptive name
                "record_viewer_otel",
                # Pass `url` here to tell Streamlit that the component will be served
                # by the local dev server that you run via `npm run start`.
                # (This is useful while your component is in development.)
                url="http://localhost:5173",
            )
        else:
            # When we're distributing a production version of the component, we'll
            # replace the `url` param with `path`, and point it to to the component's
            # build directory:
            parent_dir = os.path.dirname(os.path.abspath(__file__))
            build_dir = os.path.join(parent_dir, "dist")
            _record_viewer_otel = components.declare_component(
                "record_viewer_otel", path=build_dir
            )

    _record_viewer_otel(spans=spans, key=key, default="")
Create a new instance of "record_viewer_otel", which produces a record viewer for the OTEL spans.

    Args:
        spans: List of spans to be displayed in the timeline. It is the caller's responsibility
               to select the spans to be displayed. The simplest way to get the spans is to
               get the rows from the ORM.Events table, then call to_dict(orient="records") on the rows.
    
src/dashboard/trulens/dashboard/components/record_viewer_otel/__init__.py