def _export_to_snowflake(
        self, spans: Sequence[ReadableSpan], dry_run: bool
    ) -> SpanExportResult:
        """
        Exports a list of spans to a Snowflake stage as a protobuf file.
        This function performs the following steps:
        1. Writes the provided spans to a temporary protobuf file.
        2. Creates a Snowflake stage if it does not already exist.
        3. Uploads the temporary protobuf file to the Snowflake stage.
        4. Removes the temporary protobuf file.
        Args:
            spans: A sequence of spans to be exported.
            dry_run: Whether to do everything but run the ingestion SPROC.
        Returns:
            SpanExportResult: The result of the export operation, either SUCCESS or FAILURE.
        """
        if not isinstance(self.connector, SnowflakeConnector):
            return SpanExportResult.FAILURE

        # Avoid uploading empty files to the stage
        if not spans:
            return SpanExportResult.SUCCESS

        app_and_run_info_to_spans = defaultdict(list)
        for span in spans:
            key = (
                # TODO(otel, semconv, SNOW-2130988): Should have this in `span.resource.attributes`!
                span.attributes.get(ResourceAttributes.APP_NAME),
                span.attributes.get(ResourceAttributes.APP_VERSION),
                span.attributes.get(SpanAttributes.RUN_NAME),
            )
            app_and_run_info_to_spans[key].append(span)

        for (
            app_name,
            app_version,
            run_name,
        ), spans in app_and_run_info_to_spans.items():
            logger.debug(
                f"Logging {len(spans)} for app:{app_name} version:{app_version} run:{run_name}"
            )
            res = self._export_to_snowflake_stage_for_app_and_run(
                app_name, app_version, run_name, spans, dry_run
            )
            if res == SpanExportResult.FAILURE:
                return res
        return SpanExportResult.SUCCESS

        Exports a list of spans to a Snowflake stage as a protobuf file.
        This function performs the following steps:
        1. Writes the provided spans to a temporary protobuf file.
        2. Creates a Snowflake stage if it does not already exist.
        3. Uploads the temporary protobuf file to the Snowflake stage.
        4. Removes the temporary protobuf file.
        Args:
            spans: A sequence of spans to be exported.
            dry_run: Whether to do everything but run the ingestion SPROC.
        Returns:
            SpanExportResult: The result of the export operation, either SUCCESS or FAILURE.
        
src/connectors/snowflake/trulens/connectors/snowflake/otel_exporter.py