Skip to content

agent-span

Generated reference page for spec/v1/schemas/resources/agent-span.json.

Metadata

  • Type: JSON Schema
  • Source: spec/v1/schemas/resources/agent-span.json
  • Raw: View Raw

Summary

Source

json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agent-service.spec/v1/schemas/resources/agent-span.json",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "orgId",
    "agentId",
    "runId",
    "runSpaceId",
    "traceId",
    "spanId",
    "rootSpanId",
    "spanName",
    "spanType",
    "status",
    "startTime"
  ],
  "properties": {
    "orgId": {
      "$ref": "../common/identity.json#/$defs/orgId"
    },
    "agentId": {
      "$ref": "../common/identity.json#/$defs/agentId"
    },
    "contextId": {
      "$ref": "../common/identity.json#/$defs/opaqueId"
    },
    "runId": {
      "$ref": "../common/identity.json#/$defs/runId"
    },
    "runSpaceId": {
      "$ref": "../common/identity.json#/$defs/opaqueId"
    },
    "traceId": {
      "$ref": "../common/tracing.json#/$defs/traceId"
    },
    "spanId": {
      "$ref": "../common/tracing.json#/$defs/spanId"
    },
    "parentSpanId": {
      "$ref": "../common/tracing.json#/$defs/spanId"
    },
    "rootSpanId": {
      "$ref": "../common/tracing.json#/$defs/spanId"
    },
    "spanName": {
      "type": "string",
      "minLength": 1
    },
    "spanType": {
      "$ref": "../common/tracing.json#/$defs/spanType"
    },
    "spanKind": {
      "$ref": "../common/otel.json#/$defs/spanKind"
    },
    "status": {
      "$ref": "../common/tracing.json#/$defs/spanStatus"
    },
    "startTime": {
      "$ref": "../common/identity.json#/$defs/timestamp"
    },
    "endTime": {
      "$ref": "../common/identity.json#/$defs/timestamp"
    },
    "durationMs": {
      "type": "integer",
      "minimum": 0
    },
    "errorMessage": {
      "type": "string"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": true
    },
    "traceContext": {
      "$ref": "../common/tracing.json#/$defs/TraceContext"
    },
    "captureMode": {
      "$ref": "../common/otel.json#/$defs/ContentCaptureMode"
    },
    "otel": {
      "$ref": "../common/otel.json#/$defs/OTelSpanProjection"
    },
    "genAI": {
      "$ref": "../common/otel.json#/$defs/GenAIObservation"
    },
    "events": {
      "type": "array",
      "items": {
        "$ref": "./trace-event.json"
      }
    },
    "metrics": {
      "$ref": "../common/tracing.json#/$defs/SpanMetrics"
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "status": {
            "const": "running"
          }
        },
        "required": ["status"]
      },
      "else": {
        "required": ["endTime", "durationMs", "metrics"]
      }
    }
  ]
}

Generated from spec source.