Skip to main content
The Google GenAI Go SDK (google.golang.org/genai) does not emit OpenTelemetry spans natively, and there is no OpenInference Go instrumentor for it today. The pattern below wraps each Gemini call in a manual span and sets OpenTelemetry GenAI semantic conventions attributes. Phoenix ingests these spans directly — see Translating Semantic Conventions for context.

Install

Setup

Configure an OTLP/HTTP exporter pointed at Phoenix. Create tracing.go:

Run Gemini

Wrap each Gemini call in a span and set gen_ai.* attributes using OpenTelemetry semantic-convention helpers where available.

Observe

After running your application, Gemini calls will appear in the Phoenix UI for visualization and analysis. Spans are queryable by gen_ai.* attributes; Phoenix UI features that key off OpenInference attributes are reduced, since this flow emits GenAI conventions rather than OpenInference. For Go SDKs with native OpenInference instrumentation, see OpenAI Go SDK and Anthropic SDK Go.

Resources