Skip to content

Add gen_ai.request.stop_sequences attribute #5813

Closed

Description

@ericapisani

Problem

OTel GenAI semconv recommends capturing gen_ai.request.stop_sequences (string[]). Google's GenerateContentConfig has a stop_sequences parameter, but it is not captured by the integration.

Context

Other config parameters (temperature, top_p, top_k, max_output_tokens, presence_penalty, frequency_penalty, seed) are already captured in the param loop at utils.py:834-846. Adding stop_sequences follows the same pattern.

Files

  • sentry_sdk/integrations/google_genai/utils.py — set_span_data_for_request()
  • sentry_sdk/consts.py — may need a new SPANDATA constant if one doesn't exist

Acceptance Criteria

  • stop_sequences from GenerateContentConfig is captured on the span
  • Test added to verify the attribute is set when stop_sequences is provided

Activity

  1. linear-code commented on Mar 24, 2026

    @linear-code
  2. alexander-alderman-webb commented on Mar 24, 2026

    @alexander-alderman-webb
    Collaborator

    Not in the RFC today: getsentry/rfcs#153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions