{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/okareo/json-schema/okareo-find-traces-response-schema.json",
  "title": "FindTracesResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/okareo-traces-api-openapi.yml#/components/schemas/FindTracesResponse",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id",
      "description": "Trace UUID"
    },
    "otel_trace_id": {
      "type": "string",
      "title": "Otel Trace Id",
      "description": "Trace ID from OpenTelemetry"
    },
    "datapoint_ids": {
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "type": "array",
      "title": "Datapoint Ids",
      "description": "List of associated datapoint IDs"
    },
    "span_ids": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Span Ids",
      "description": "List of associated span OpenTelemetry IDs"
    },
    "spans": {
      "items": {
        "$ref": "#/$defs/SpanResponse"
      },
      "type": "array",
      "title": "Spans",
      "description": "List of spans associated with the trace"
    },
    "start_time": {
      "type": "string",
      "format": "date-time",
      "title": "Start Time",
      "description": "Trace start time"
    },
    "end_time": {
      "type": "string",
      "format": "date-time",
      "title": "End Time",
      "description": "Trace end time"
    },
    "time_created": {
      "type": "string",
      "format": "date-time",
      "title": "Time Created",
      "description": "Trace creation time"
    }
  },
  "type": "object",
  "required": [
    "id",
    "otel_trace_id",
    "datapoint_ids",
    "span_ids",
    "spans",
    "start_time",
    "end_time",
    "time_created"
  ],
  "$defs": {
    "SpanResponse": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "span_name": {
          "type": "string",
          "title": "Span Name",
          "description": "Name of the span"
        },
        "span_kind": {
          "type": "string",
          "title": "Span Kind",
          "description": "Kind of the span"
        },
        "otel_span_id": {
          "type": "string",
          "title": "Otel Span Id",
          "description": "OpenTelemetry Span ID"
        },
        "otel_trace_id": {
          "type": "string",
          "title": "Otel Trace Id",
          "description": "OpenTelemetry Trace ID"
        },
        "otel_trace_depth": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Otel Trace Depth",
          "description": "Depth of the span in the trace hierarchy"
        },
        "start_time": {
          "type": "integer",
          "title": "Start Time",
          "description": "Span start time in epoch nanoseconds"
        },
        "end_time": {
          "type": "integer",
          "title": "End Time",
          "description": "Span end time in epoch nanoseconds"
        },
        "datapoint_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Datapoint Id",
          "description": "Associated Datapoint ID"
        },
        "attributes": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Attributes",
          "description": "Span attributes"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Metadata",
          "description": "Span metadata"
        }
      },
      "type": "object",
      "required": [
        "id",
        "span_name",
        "span_kind",
        "otel_span_id",
        "otel_trace_id",
        "start_time",
        "end_time"
      ],
      "title": "SpanResponse"
    }
  }
}