Skip to content

[bot] google-cloud-ai_platform gem (Vertex AI) not instrumented #184

@braintrust-bot

Description

@braintrust-bot

Summary

The google-cloud-ai_platform gem is the official Google Ruby SDK for Vertex AI, published by Google in the googleapis/google-cloud-ruby monorepo. With 875K+ downloads and a release on June 11, 2026 (v2.4.0), it is the authoritative Ruby path for accessing Gemini models on Vertex AI and is not instrumented by this SDK.

The SDK instruments standalone provider clients for OpenAI, Anthropic, and (community) Gemini via gemini-ai, but has no instrumentation for the official Google Vertex AI generative execution surface.

What is missing

No instrumentation exists for any google-cloud-ai_platform generative execution surface. Key APIs that should be instrumented (via Google::Cloud::AIPlatform::V1::PredictionService::Client):

Generative Content (Gemini on Vertex AI)

  • generate_content(...) — Non-streaming generative content generation for Gemini models; accepts messages, system instruction, tools (function declarations), generation config (temperature, max_output_tokens, top_p, top_k, stop_sequences), safety settings, and response schema for structured output.
  • stream_generate_content(...) — Server-side streaming variant; yields GenerateContentResponse chunks with token usage in the final chunk.

Embeddings

  • embed_content(...) — Generates text embeddings via Gemini embedding models on Vertex AI.

General Prediction (non-Gemini Vertex models)

  • predict(...) — Online prediction for custom models and PaLM-family models.
  • raw_predict(...) / direct_predict(...) — Raw HTTP/gRPC prediction for arbitrary Vertex endpoints.
  • streaming_predict(...) / server_streaming_predict(...) — Streaming prediction variants.

Expected instrumentation

generate_content / stream_generate_content spans should capture:

  • Input: contents (messages array), system_instruction, tools (function declarations), tool_config
  • Metadata: model endpoint/model ID, generation_config (temperature, max_output_tokens, top_p, top_k, stop_sequences, response_mime_type, response_schema), safety settings, location/project
  • Metrics: usage_metadata (prompt_token_count, candidates_token_count, total_token_count) from response
  • Output: candidates content, finish_reason

Braintrust docs status

not_found — The SDK integrations page at https://www.braintrust.dev/docs/integrations/sdk-integrations lists only ruby-llm as a Ruby-specific integration. There is no documented Ruby instrumentation path for Google Vertex AI or google-cloud-ai_platform.

Upstream sources

Local repo files inspected

  • lib/braintrust/contrib.rb (lines 196–205) — registers only 4 integrations: OpenAI, RubyOpenAI, RubyLLM, Anthropic. No Google/Vertex integration.
  • lib/braintrust/contrib/ — contains only openai/, ruby_openai/, ruby_llm/, anthropic/, and rails/ directories. No google/ or vertex/ directory.
  • Appraisals — no appraisal scenarios for google-cloud-ai_platform
  • braintrust.gemspec — no mention of google or vertex
  • Grep for google, vertex, ai_platform across lib/braintrust/ returns zero matches

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions