> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gp.scale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get span export status

> Retrieve the status, and when complete the result location, of an async span export.

Poll this with the ``export_id`` returned by POST /v5/spans/export. Only
exports that ran as async jobs on the tracing service have a pollable status;
synchronous exports from the legacy trace store return their result directly
and have no export id to poll here. The lookup is proxied to the tracing service
and scoped to the caller's account; a tracing-service failure surfaces as a 503.



## OpenAPI

````yaml /openapi/v5.yaml get /v5/spans/export/{export_id}
openapi: 3.1.0
info:
  title: EGP API V5
  description: >-
    This is the parent API for all EGP APIs. If you are looking for the EGP API,
    please go to https://api.egp.scale.com/docs.
  contact:
    name: Scale Generative AI Platform
    url: https://scale.com/genai-platform
  version: 0.1.0
servers:
  - url: https://api.egp.scale.com
security: []
paths:
  /v5/spans/export/{export_id}:
    get:
      tags:
        - Spans
      summary: Get span export status
      description: >-
        Retrieve the status, and when complete the result location, of an async
        span export.


        Poll this with the ``export_id`` returned by POST /v5/spans/export. Only

        exports that ran as async jobs on the tracing service have a pollable
        status;

        synchronous exports from the legacy trace store return their result
        directly

        and have no export id to poll here. The lookup is proxied to the tracing
        service

        and scoped to the caller's account; a tracing-service failure surfaces
        as a 503.
      operationId: GET-V5-/v5/spans/export/export_id
      parameters:
        - name: export_id
          in: path
          required: true
          schema:
            type: string
            title: Export Id
        - name: x-selected-account-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account ID Header
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpansExportStatusResponse'
        '400':
          description: >-
            The request carried a value this API or the tracing service
            rejected, such as a search term breaking a documented rule or a
            malformed pagination cursor.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpanReadErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          description: >-
            The configured tracing read backend is unavailable. Known service
            configuration failures include a stable error_code; other failures
            return only detail.
          headers:
            x-correlation-id:
              description: Correlation ID for this request.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpanReadErrorResponse'
      security:
        - APIKeyHeader: []
components:
  schemas:
    SpansExportStatusResponse:
      properties:
        export_id:
          type: string
          title: Export Id
          description: The export id echoed back.
        status:
          type: string
          enum:
            - running
            - succeeded
            - failed
          title: Status
          description: Lifecycle state.
        run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Run Id
          description: Temporal run id of the export workflow.
        rows_written:
          anyOf:
            - type: integer
            - type: 'null'
          title: Rows Written
          description: Rows written so far (running).
        bytes_written:
          anyOf:
            - type: integer
            - type: 'null'
          title: Bytes Written
          description: Bytes written so far (running).
        shards_completed:
          anyOf:
            - type: integer
            - type: 'null'
          title: Shards Completed
          description: >-
            Export shards completed so far (running). A shard here is one of the
            export's concurrent read windows over the export time range, not a
            storage shard.
        shards_total:
          anyOf:
            - type: integer
            - type: 'null'
          title: Shards Total
          description: >-
            Total shards in the export plan, the time windows the export window
            is split into for concurrent reads (running).
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
          description: Name of the exported file (succeeded).
        signed_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Signed Url
          description: Pre-signed download URL (succeeded).
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
          description: When the signed URL expires.
        from_ts:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: From Ts
          description: Resolved start of the window.
        to_ts:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: To Ts
          description: Resolved end of the window.
        snapshot_ts:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Snapshot Ts
          description: Snapshot the export read at.
        truncated:
          anyOf:
            - $ref: '#/components/schemas/SpansExportTruncation'
            - type: 'null'
          description: Present when the export hit a budget.
        staged_file:
          anyOf:
            - $ref: '#/components/schemas/SpansExportStagedFile'
            - type: 'null'
          description: >-
            The export artifact's commit handle in the Datasets workspace grant,
            present only for a staged export (succeeded); signed_url is absent
            in that case.
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
          description: >-
            Terminal failure reason (failed): not_found (unknown or
            cross-account export id, or a result that expired or predates the
            object-storage cutover), invalid_input (the request was rejected,
            and guidance names what to change), resource_exhausted, timed_out,
            resume_cursor_stale (the resume cursor does not match how this
            export is ordered), canceled, terminated, failed (no cause
            recorded), or internal (server-side fault).
        guidance:
          anyOf:
            - type: string
            - type: 'null'
          title: Guidance
          description: Human-readable, actionable next step for a failed export (failed).
      type: object
      required:
        - export_id
        - status
      title: SpansExportStatusResponse
      description: >-
        Status for GET /v5/spans/export/{export_id} (mirrors the sgp-traces
        status object).


        Always returned with HTTP 200; unknown or cross-account ids arrive as

        ``failed`` with ``reason=not_found``.
    SpanReadErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: A user-safe explanation of why the tracing read failed.
        error_code:
          anyOf:
            - type: string
              const: TRACES_SERVICE_CONFIGURATION_ERROR
            - type: 'null'
          title: Error Code
          description: >-
            Stable classification for a known EGP-to-tracing-service
            configuration failure. Omitted when the downstream failure is not
            safely classifiable.
      type: object
      required:
        - detail
      title: SpanReadErrorResponse
      description: Safe public error body for a tracing read that could not be completed.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SpansExportTruncation:
      properties:
        reason:
          type: string
          title: Reason
          description: 'Budget that was hit: row_budget, byte_budget, or disk_budget.'
        rows_exported:
          type: integer
          title: Rows Exported
          description: Rows written before truncation.
        resume_after:
          anyOf:
            - type: string
            - type: 'null'
          title: Resume After
          description: >-
            Opaque signed token for the rows after this file. Repeat the
            identical POST /v5/spans/export with `resume_after` set to it to
            export the remainder. Absent on exports started before resume tokens
            existed.
      type: object
      required:
        - reason
        - rows_exported
      title: SpansExportTruncation
      description: >-
        Present on a succeeded export that hit a budget; absent for a complete
        one.
    SpansExportStagedFile:
      properties:
        key:
          type: string
          title: Key
          description: >-
            Datasets staging key the export's workspace grant maps the artifact
            to; commit it as a files[].key entry.
        size_bytes:
          type: integer
          title: Size Bytes
          description: Size in bytes of the export artifact.
        sha256:
          type: string
          title: Sha256
          description: Hex-encoded SHA-256 of the export artifact's bytes.
      type: object
      required:
        - key
        - size_bytes
        - sha256
      title: SpansExportStagedFile
      description: >-
        The export artifact's commit handle in the Datasets workspace grant —

        shaped to pass verbatim into the datasets commit operation's files
        entry.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````