Skip to content

otel

Generated reference page for spec/v1/schemas/common/otel.json.

Metadata

  • Type: JSON Schema
  • Source: spec/v1/schemas/common/otel.json
  • Raw: View Raw

Summary

Source

json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agent-service.spec/v1/schemas/common/otel.json",
  "$defs": {
    "OTelAttributePrimitive": {
      "type": ["string", "number", "boolean"]
    },
    "OTelAttributeValue": {
      "oneOf": [
        {
          "$ref": "#/$defs/OTelAttributePrimitive"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OTelAttributePrimitive"
          }
        }
      ]
    },
    "OTelAttributes": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/OTelAttributeValue"
      }
    },
    "spanKind": {
      "type": "string",
      "enum": ["internal", "server", "client", "producer", "consumer"]
    },
    "statusCode": {
      "type": "string",
      "enum": ["unset", "ok", "error"]
    },
    "ContentCaptureMode": {
      "type": "string",
      "enum": ["none", "redacted", "span_attributes", "span_events", "external_blob"]
    },
    "BaggageItem": {
      "type": "object",
      "additionalProperties": false,
      "required": ["key", "value"],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "value": {
          "type": "string"
        },
        "metadata": {
          "type": "string"
        }
      }
    },
    "PropagationCarrier": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "format": {
          "type": "string",
          "enum": ["w3c_headers", "text_map", "environment"]
        },
        "traceparent": {
          "type": "string",
          "minLength": 1
        },
        "tracestate": {
          "type": "string"
        },
        "baggage": {
          "type": "string"
        },
        "baggageItems": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BaggageItem"
          }
        },
        "carrier": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "OTelLink": {
      "type": "object",
      "additionalProperties": false,
      "required": ["traceId", "spanId"],
      "properties": {
        "traceId": {
          "$ref": "./identity.json#/$defs/opaqueId"
        },
        "spanId": {
          "$ref": "./identity.json#/$defs/opaqueId"
        },
        "attributes": {
          "$ref": "#/$defs/OTelAttributes"
        }
      }
    },
    "OTelSpanProjection": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schemaUrl": {
          "type": "string",
          "format": "uri"
        },
        "semconvVersion": {
          "type": "string"
        },
        "spanKind": {
          "$ref": "#/$defs/spanKind"
        },
        "statusCode": {
          "$ref": "#/$defs/statusCode"
        },
        "attributes": {
          "$ref": "#/$defs/OTelAttributes"
        },
        "links": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/OTelLink"
          }
        }
      }
    },
    "GenAIMessageRoleKnown": {
      "type": "string",
      "enum": ["system", "developer", "user", "assistant", "tool", "model"]
    },
    "GenAIMessageRole": {
      "anyOf": [
        {
          "$ref": "#/$defs/GenAIMessageRoleKnown"
        },
        {
          "type": "string",
          "minLength": 1
        }
      ]
    },
    "TextPart": {
      "type": "object",
      "additionalProperties": true,
      "required": ["type", "content"],
      "properties": {
        "type": {
          "const": "text"
        },
        "content": {
          "type": "string"
        }
      }
    },
    "ReasoningPart": {
      "type": "object",
      "additionalProperties": true,
      "required": ["type", "content"],
      "properties": {
        "type": {
          "const": "reasoning"
        },
        "content": {
          "type": "string"
        }
      }
    },
    "ToolCallRequestPart": {
      "type": "object",
      "additionalProperties": true,
      "required": ["type", "id", "name", "arguments"],
      "properties": {
        "type": {
          "const": "tool_call"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "arguments": {}
      }
    },
    "ToolCallResponsePart": {
      "type": "object",
      "additionalProperties": true,
      "required": ["type", "id", "result"],
      "properties": {
        "type": {
          "const": "tool_call_response"
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string"
        },
        "result": {},
        "isError": {
          "type": "boolean"
        }
      }
    },
    "BlobPart": {
      "type": "object",
      "additionalProperties": true,
      "required": ["type", "modality"],
      "properties": {
        "type": {
          "const": "blob"
        },
        "modality": {
          "type": "string",
          "minLength": 1
        },
        "mimeType": {
          "type": "string"
        },
        "content": {
          "type": "string"
        },
        "contentRef": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "FilePart": {
      "type": "object",
      "additionalProperties": true,
      "required": ["type"],
      "properties": {
        "type": {
          "const": "file"
        },
        "fileId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "mimeType": {
          "type": "string"
        },
        "uri": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "UriPart": {
      "type": "object",
      "additionalProperties": true,
      "required": ["type", "uri"],
      "properties": {
        "type": {
          "const": "uri"
        },
        "uri": {
          "type": "string",
          "format": "uri"
        },
        "mimeType": {
          "type": "string"
        },
        "modality": {
          "type": "string"
        }
      }
    },
    "JsonPart": {
      "type": "object",
      "additionalProperties": true,
      "required": ["type", "value"],
      "properties": {
        "type": {
          "const": "json"
        },
        "value": {}
      }
    },
    "GenericPart": {
      "type": "object",
      "additionalProperties": true,
      "required": ["type"],
      "properties": {
        "type": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "GenAIContentPart": {
      "oneOf": [
        {
          "$ref": "#/$defs/TextPart"
        },
        {
          "$ref": "#/$defs/ReasoningPart"
        },
        {
          "$ref": "#/$defs/ToolCallRequestPart"
        },
        {
          "$ref": "#/$defs/ToolCallResponsePart"
        },
        {
          "$ref": "#/$defs/BlobPart"
        },
        {
          "$ref": "#/$defs/FilePart"
        },
        {
          "$ref": "#/$defs/UriPart"
        },
        {
          "$ref": "#/$defs/JsonPart"
        },
        {
          "$ref": "#/$defs/GenericPart"
        }
      ]
    },
    "GenAIMessage": {
      "type": "object",
      "additionalProperties": true,
      "required": ["role", "parts"],
      "properties": {
        "role": {
          "$ref": "#/$defs/GenAIMessageRole"
        },
        "name": {
          "type": "string"
        },
        "parts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GenAIContentPart"
          }
        },
        "finishReason": {
          "type": "string"
        }
      }
    },
    "GenAIToolDefinition": {
      "type": "object",
      "additionalProperties": false,
      "required": ["name"],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string"
        },
        "inputSchema": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "GenAIUsage": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "inputTokens": {
          "type": "integer",
          "minimum": 0
        },
        "outputTokens": {
          "type": "integer",
          "minimum": 0
        },
        "totalTokens": {
          "type": "integer",
          "minimum": 0
        },
        "reasoningTokens": {
          "type": "integer",
          "minimum": 0
        },
        "cacheReadInputTokens": {
          "type": "integer",
          "minimum": 0
        },
        "cacheWriteInputTokens": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "GenAIOperationDetails": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "provider": {
          "type": "string"
        },
        "operationName": {
          "type": "string",
          "minLength": 1
        },
        "requestModel": {
          "type": "string"
        },
        "responseModel": {
          "type": "string"
        },
        "conversationId": {
          "type": "string"
        },
        "promptName": {
          "type": "string"
        },
        "promptVersion": {
          "type": "string"
        },
        "outputType": {
          "type": "string"
        },
        "requestParameters": {
          "$ref": "#/$defs/OTelAttributes"
        },
        "systemInstructions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GenAIMessage"
          }
        },
        "inputMessages": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GenAIMessage"
          }
        },
        "outputMessages": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GenAIMessage"
          }
        },
        "tools": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GenAIToolDefinition"
          }
        },
        "usage": {
          "$ref": "#/$defs/GenAIUsage"
        },
        "responseId": {
          "type": "string"
        },
        "finishReasons": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "contentCaptureMode": {
          "$ref": "#/$defs/ContentCaptureMode"
        },
        "redactionPolicy": {
          "type": "string"
        },
        "inputRef": {
          "type": "string",
          "format": "uri"
        },
        "outputRef": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "GenAIObservation": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "schemaUrl": {
          "type": "string",
          "format": "uri"
        },
        "semconvVersion": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        },
        "operationName": {
          "type": "string"
        },
        "requestModel": {
          "type": "string"
        },
        "responseModel": {
          "type": "string"
        },
        "conversationId": {
          "type": "string"
        },
        "promptName": {
          "type": "string"
        },
        "outputType": {
          "type": "string"
        },
        "contentCaptureMode": {
          "$ref": "#/$defs/ContentCaptureMode"
        },
        "requestAttributes": {
          "$ref": "#/$defs/OTelAttributes"
        },
        "responseAttributes": {
          "$ref": "#/$defs/OTelAttributes"
        },
        "usage": {
          "$ref": "#/$defs/GenAIUsage"
        },
        "details": {
          "$ref": "#/$defs/GenAIOperationDetails"
        }
      }
    }
  }
}

Generated from spec source.