Skip to main content

Module telemetry

Module telemetry 

Source
Expand description

OpenTelemetry helpers for provider-authored GenAI instrumentation. OpenTelemetry helpers for provider-authored GenAI instrumentation.

Gestalt injects standard OTEL_* environment variables into provider processes from the host telemetry configuration. This module records GenAI semantic-convention spans and metrics through the process-global OpenTelemetry API configured by the provider runtime.

Structs§

AgentInvocationOptions
Options for recording provider-owned agent turn execution.
GenAIOperation
Records a GenAI span plus operation duration and token usage metrics.
ModelOperationOptions
Options for recording an upstream model SDK call.
RequestOptions
Common GenAI request options that are useful as span attributes.
TokenUsage
GenAI token usage recorded on spans and token usage metrics.
ToolExecutionOptions
Options for recording provider-owned tool execution.

Constants§

GENAI_OPERATION_CHAT
GenAI operation name for chat/model calls.
GENAI_OPERATION_EXECUTE_TOOL
GenAI operation name for tool executions.
GENAI_OPERATION_INVOKE_AGENT
GenAI operation name for agent invocations.
GENAI_PROVIDER_NAME
Default GenAI provider name used for Gestalt-owned agent and tool work.
GENAI_TOOL_TYPE_DATASTORE
GenAI tool type for datastore-backed tools.
GENAI_TOOL_TYPE_EXTENSION
GenAI tool type for extension/plugin-backed tools.
TELEMETRY_INSTRUMENTATION_NAME
OpenTelemetry instrumentation scope used by the Gestalt SDK.

Functions§

agent_invocation
Starts a GenAI internal span for provider-owned agent turn execution.
model_operation
Starts a GenAI client span for an upstream model SDK call.
tool_execution
Starts a GenAI internal span for provider-owned tool execution.