Created
May 6, 2025 20:29
-
-
Save keithchambers/c97dbbaf3c24e0bd7bee6bef92b36feb to your computer and use it in GitHub Desktop.
AWS Bedrock Schema
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$schema": "https://json-schema.org/draft/2020-12/schema", | |
| "title": "AWS Bedrock OpenTelemetry (OTLP/JSON) Schema", | |
| "description": "Validation schema covering resource and span attributes required for instrumenting Amazon Bedrock calls using OpenTelemetry Gen-AI semantic conventions.", | |
| "type": "object", | |
| "properties": { | |
| "resource": { | |
| "type": "object", | |
| "properties": { | |
| "attributes": { "$ref": "#/$defs/ResourceAttributes" } | |
| }, | |
| "required": ["attributes"], | |
| "additionalProperties": true | |
| }, | |
| "spans": { | |
| "type": "array", | |
| "items": { | |
| "type": "object", | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "kind": { | |
| "type": "string", | |
| "enum": [ | |
| "SPAN_KIND_CLIENT", | |
| "SPAN_KIND_SERVER", | |
| "SPAN_KIND_CONSUMER", | |
| "SPAN_KIND_PRODUCER", | |
| "SPAN_KIND_INTERNAL" | |
| ] | |
| }, | |
| "attributes": { "$ref": "#/$defs/SpanAttributes" }, | |
| "events": { | |
| "type": "array", | |
| "items": { "$ref": "#/$defs/SpanEvent" } | |
| } | |
| }, | |
| "required": ["attributes"], | |
| "additionalProperties": true | |
| } | |
| } | |
| }, | |
| "required": ["resource", "spans"], | |
| "additionalProperties": false, | |
| "$defs": { | |
| "ResourceAttributes": { | |
| "type": "object", | |
| "properties": { | |
| "cloud.provider": { "const": "aws" }, | |
| "cloud.region": { "type": "string" }, | |
| "cloud.account.id": { "type": "string", "pattern": "^[0-9]{12}$" }, | |
| "service.name": { "type": "string" }, | |
| "service.namespace": { "type": "string" }, | |
| "service.instance.id": { "type": "string" }, | |
| "aws.bedrock.agent.id": { "type": "string", "pattern": "^[0-9A-Za-z]{10}$" }, | |
| "aws.bedrock.knowledge_base.id": { "type": "string" }, | |
| "aws.bedrock.data_source.id": { "type": "string" }, | |
| "aws.bedrock.guardrail.id": { "type": "string" }, | |
| "aws.bedrock.guardrail.arn": { "type": "string", "pattern": "^arn:aws[\-a-zA-Z0-9]*:bedrock:[^:]+:[0-9]{12}:guardrail/.+" }, | |
| "aws.bedrock.model.id": { "type": "string" } | |
| }, | |
| "required": ["cloud.provider", "cloud.region", "cloud.account.id", "service.name"], | |
| "additionalProperties": true | |
| }, | |
| "SpanAttributes": { | |
| "type": "object", | |
| "properties": { | |
| "gen_ai.system": { "const": "aws.bedrock" }, | |
| "gen_ai.operation.name": { | |
| "type": "string", | |
| "enum": [ | |
| "chat", | |
| "text_completion", | |
| "embeddings", | |
| "generate_content", | |
| "execute_tool", | |
| "create_agent", | |
| "invoke_agent" | |
| ] | |
| }, | |
| "gen_ai.request.model": { "type": "string" }, | |
| "gen_ai.response.model": { "type": "string" }, | |
| "gen_ai.request.max_tokens": { "type": "integer", "minimum": 0, "maximum": 16384 }, | |
| "gen_ai.request.temperature": { "type": "number", "minimum": 0, "maximum": 2 }, | |
| "gen_ai.request.top_p": { "type": "number", "minimum": 0, "maximum": 1 }, | |
| "gen_ai.request.top_k": { "type": "integer", "minimum": 0, "maximum": 4096 }, | |
| "gen_ai.request.stop_sequences": { | |
| "type": "array", | |
| "items": { "type": "string" } | |
| }, | |
| "gen_ai.request.choice.count": { "type": "integer", "minimum": 1 }, | |
| "gen_ai.request.seed": { "type": "integer" }, | |
| "gen_ai.request.frequency_penalty": { "type": "number" }, | |
| "gen_ai.request.presence_penalty": { "type": "number" }, | |
| "gen_ai.usage.input_tokens": { "type": "integer", "minimum": 0 }, | |
| "gen_ai.usage.output_tokens": { "type": "integer", "minimum": 0 }, | |
| "gen_ai.response.finish_reasons": { | |
| "type": "array", | |
| "items": { | |
| "type": "string", | |
| "enum": ["stop", "length", "content_filter", "tool_calls", "error"] | |
| } | |
| }, | |
| "gen_ai.response.id": { "type": "string" }, | |
| "rpc.system": { "const": "aws-api" }, | |
| "rpc.service": { "const": "Bedrock Runtime" }, | |
| "rpc.method": { | |
| "type": "string", | |
| "enum": ["InvokeModel", "InvokeModelWithResponseStream"] | |
| }, | |
| "server.address": { "type": "string" }, | |
| "server.port": { "type": "integer", "enum": [443] }, | |
| "aws.bedrock.agent.id": { "type": "string" }, | |
| "aws.bedrock.knowledge_base.id": { "type": "string" }, | |
| "aws.bedrock.data_source.id": { "type": "string" }, | |
| "aws.bedrock.guardrail.id": { "type": "string" }, | |
| "aws.bedrock.model.id": { "type": "string" } | |
| }, | |
| "required": [ | |
| "gen_ai.system", | |
| "gen_ai.operation.name", | |
| "rpc.system", | |
| "rpc.service", | |
| "rpc.method" | |
| ], | |
| "additionalProperties": true | |
| }, | |
| "SpanEvent": { | |
| "type": "object", | |
| "properties": { | |
| "name": { | |
| "type": "string", | |
| "enum": [ | |
| "gen_ai.system.message", | |
| "gen_ai.user.message", | |
| "gen_ai.assistant.message", | |
| "gen_ai.tool.message", | |
| "gen_ai.choice" | |
| ] | |
| }, | |
| "attributes": { | |
| "type": "object", | |
| "additionalProperties": true | |
| } | |
| }, | |
| "required": ["name"], | |
| "additionalProperties": true | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment