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

# Query traces

> Retrieve traces based on the specified filters.



## OpenAPI

````yaml POST /query/traces
openapi: 3.1.0
info:
  title: Lumos API
  version: 1.0.0
  description: Lumos RESTful API
  x-logo:
    url: >-
      https://zorp.zeetco.com/static/media/mark-white.8c3b78e3c878db1859b6319c98dc38b6.svg
    altText: Zeet Logo
  contact:
    email: support@zeet.co
servers:
  - url: https://api.alerty.ai
security: []
paths:
  /query/traces:
    post:
      summary: Query traces
      description: Retrieve traces based on the specified filters.
      operationId: getTraces
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                start_time:
                  type: string
                  format: date-time
                  description: Start time for the query.
                  example: '2023-01-01T00:00:00Z'
                end_time:
                  type: string
                  format: date-time
                  description: End time for the query.
                  example: '2023-01-02T00:00:00Z'
                service_name:
                  type: string
                  description: Filter traces by service name.
                span_name:
                  type: string
                  description: Filter traces by span name.
                limit:
                  type: integer
                  default: 100
                  description: Limit the number of results.
      responses:
        '200':
          description: Traces retrieved
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Trace'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - bearerAuth: []
        - cookieAuth: []
components:
  schemas:
    Trace:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
        trace_id:
          type: string
        span_id:
          type: string
        parent_span_id:
          type: string
        trace_state:
          type: string
        span_name:
          type: string
        span_kind:
          type: string
        service_name:
          type: string
        resource_attributes:
          type: object
          additionalProperties:
            type: string
        scope_name:
          type: string
        scope_version:
          type: string
        span_attributes:
          type: object
          additionalProperties:
            type: string
        duration:
          type: integer
        status_code:
          type: string
        status_message:
          type: string
        events:
          type: array
          items:
            $ref: '#/components/schemas/TraceEvent'
        links:
          type: array
          items:
            $ref: '#/components/schemas/TraceLink'
    TraceEvent:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
        name:
          type: string
        attributes:
          type: object
          additionalProperties:
            type: string
    TraceLink:
      type: object
      properties:
        trace_id:
          type: string
        span_id:
          type: string
        trace_state:
          type: string
        attributes:
          type: object
          additionalProperties:
            type: string
    ApiError:
      type: object
      properties:
        code:
          type: integer
          description: a custom Lumos error code
          format: uint64
          example: 1400
        field:
          type: string
          description: the field that this error is associated with, if applicable
          example: name
        description:
          type: string
          description: a description for this error
          example: A descriptive error message
      required:
        - description
  responses:
    Forbidden:
      description: The request is forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
    ServerError:
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    cookieAuth:
      type: apiKey
      in: cookie
      name: __lumos_session

````