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

# Inspect trace quality and signal coverage

> Returns a bounded, organization-scoped summary of the trace data received for one
simulation output or monitoring conversation. The response contains span names,
counts, timing and status distributions, structural integrity checks, and attribute
key/type coverage. It never returns attribute values, prompt text, tool arguments or
results, status messages, events, or links.

Provide exactly one of `simulation_id` or `conversation_id`. A truncated response
reports `is_truncated: true`; do not treat its counts as complete.




## OpenAPI

````yaml /api-reference/v1/traces-v1.yaml get /traces/summary
openapi: 3.0.3
info:
  title: Traces API
  version: 1.0.0
  description: >
    OTLP/HTTP trace ingestion endpoint for Coval. Accepts native OpenTelemetry

    spans (protobuf or JSON, `ExportTraceServiceRequest` from
    `opentelemetry-proto`)

    and associates them with a simulation output or a monitoring conversation.


    Each request must identify its target via exactly one of:
      - `X-Simulation-Id` — for simulation flows (the simulation output ID).
      - `X-Conversation-Id` — for monitoring flows (the conversation ID returned
        by `POST /v1/conversations:submit`).

    For most use cases, the recommended client is the OpenTelemetry SDK itself

    (`OTLPSpanExporter` from `opentelemetry-exporter-otlp-proto-http` pointed at

    `https://api.coval.dev/v1/traces`). This OpenAPI spec exists for users who

    prefer to generate a typed HTTP client (e.g. with `openapi-python-client`).
  contact:
    name: Coval API Support
    url: https://coval.dev
    email: support@coval.dev
servers:
  - url: https://api.coval.dev/v1
    description: Production API
security:
  - apiKey: []
tags:
  - name: Traces
    description: OTLP trace ingestion for simulations and monitoring conversations.
paths:
  /traces/summary:
    get:
      tags:
        - Traces
      summary: Inspect trace quality and signal coverage
      description: >
        Returns a bounded, organization-scoped summary of the trace data
        received for one

        simulation output or monitoring conversation. The response contains span
        names,

        counts, timing and status distributions, structural integrity checks,
        and attribute

        key/type coverage. It never returns attribute values, prompt text, tool
        arguments or

        results, status messages, events, or links.


        Provide exactly one of `simulation_id` or `conversation_id`. A truncated
        response

        reports `is_truncated: true`; do not treat its counts as complete.
      operationId: getTraceQualitySummary
      parameters:
        - name: simulation_id
          in: query
          required: false
          description: >-
            Exact simulation output ID. Mutually exclusive with
            `conversation_id`.
          schema:
            type: string
            maxLength: 200
        - name: conversation_id
          in: query
          required: false
          description: >-
            Exact monitoring conversation ID. Mutually exclusive with
            `simulation_id`.
          schema:
            type: string
            maxLength: 200
      responses:
        '200':
          description: Privacy-safe trace quality summary.
          content:
            application/json:
              schema:
                type: object
                required:
                  - target
                  - trace_summary
                properties:
                  target:
                    type: object
                    required:
                      - type
                      - id
                    properties:
                      type:
                        type: string
                        enum:
                          - simulation
                          - conversation
                      id:
                        type: string
                  trace_summary:
                    $ref: '#/components/schemas/TraceQualitySummary'
        '400':
          description: >-
            Exactly one target was not provided, or the conversation is not a
            monitoring conversation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: API key lacks the `traces:read` scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: >-
            The requested target does not exist or does not belong to your
            organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          description: Trace storage or organization routing is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    TraceQualitySummary:
      type: object
      required:
        - simulation_output_id
        - run_id
        - total_spans
        - returned_spans
        - is_truncated
        - unique_span_count
        - duplicate_span_count
        - trace_count
        - root_span_count
        - orphan_span_count
        - child_timing_violation_count
        - status_counts
        - span_groups
      properties:
        simulation_output_id:
          type: string
        run_id:
          type: string
        total_spans:
          type: integer
        returned_spans:
          type: integer
        is_truncated:
          type: boolean
        unique_span_count:
          type: integer
        duplicate_span_count:
          type: integer
        trace_count:
          type: integer
        root_span_count:
          type: integer
        orphan_span_count:
          type: integer
        child_timing_violation_count:
          type: integer
        status_counts:
          type: object
          additionalProperties:
            type: integer
        export_lag:
          type: object
          nullable: true
          description: >-
            Collector insertion lag for samples without detected clock skew.
            Negative samples are excluded from timing statistics and counted
            separately.
          required:
            - sample_count
            - clock_skew_sample_count
            - average_seconds
            - p95_seconds
            - max_seconds
          properties:
            sample_count:
              type: integer
              description: >-
                Number of non-negative lag samples included in the timing
                statistics.
            clock_skew_sample_count:
              type: integer
              description: >-
                Number of negative lag samples excluded because collector and
                producer clocks disagreed.
            average_seconds:
              type: number
            p95_seconds:
              type: number
            max_seconds:
              type: number
        span_groups:
          type: array
          items:
            type: object
            description: >-
              Per-span-name count, duration, status, and attribute key/type
              coverage.
            additionalProperties: true
        resource_attribute_keys:
          type: array
          items:
            type: object
            description: >-
              Resource attribute key/type coverage. Attribute values are never
              returned.
            additionalProperties: true
    ErrorResponse:
      type: object
      description: Standard error response
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
              description: Machine-readable error code
              example: INVALID_ARGUMENT
            message:
              type: string
              description: Human-readable error message
              example: Invalid request parameters
            details:
              type: array
              description: Detailed error information
              items:
                type: object
                properties:
                  field:
                    type: string
                    description: Field that caused the error
                    example: X-Simulation-Id
                  description:
                    type: string
                    description: Description of the error
                    example: No simulation output found with this ID
  responses:
    Unauthorized:
      description: Authentication failed or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: UNAUTHENTICATED
              message: Authentication failed
              details:
                - field: X-API-Key
                  description: Invalid or missing API key
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INTERNAL
              message: Internal server error
              details:
                - description: An unexpected error occurred while processing the request
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: Organization API key for authentication

````