Skip to main content
Google Gemini provides multimodal AI models for chat, vision, and function calling. HoneyHive integrates with Gemini via the OpenInference instrumentor, automatically capturing all API calls, function calls, and token usage.

Quick Start

Add HoneyHive tracing in just 4 lines of code. Add this to your existing Gemini app and all generate calls, function calls, and chat sessions are automatically traced.
To see where to initialize the tracer for your environment, including AWS Lambda and long-running servers, see Tracer Initialization.
Requires google-genai 0.3.0 or later. The older google-generativeai package is not supported.

What Gets Traced

The instrumentor automatically captures:
  • Content generation - client.models.generate_content() with inputs, outputs, and token usage
  • Function calls - Each function call with arguments and results
  • Chat sessions - chat.send_message() with conversation history
  • Streaming responses - Streamed generations with aggregated tokens
No manual instrumentation required.

Example: Content Generation


Environment Configuration


Troubleshooting

Traces not appearing

  1. Check environment variables - Ensure HH_API_KEY is set
  2. Pass the tracer provider - The instrumentor must receive tracer_provider=tracer.provider:
  1. Initialize before making calls - Call instrument() before creating the genai.Client

SDK version

The instrumentor works with the newer google-genai SDK. If you’re using the older google-generativeai package, migrate to google-genai:

Google ADK

Google Agent Development Kit integration

Enrich Your Traces

Add user IDs and custom metadata to traces

Distributed Tracing

Trace calls across service boundaries

Resources