Groq for Eve

Adds instrumentation for the Groq SDK. (default)

Import name: Sentry.groqIntegration

This integration is enabled by default when tracing is enabled. If you'd like to modify your default integrations, read this.

The groqIntegration adds instrumentation for the groq-sdk to capture agent tracing gen_ai spans, recording model, token usage, latency, and (when enabled) inputs and outputs. Groq speaks the OpenAI wire format, so it reuses the same span and streaming logic as the OpenAI integration.

Copied
Sentry.init({
  dsn: "___PUBLIC_DSN___",
  // Tracing must be enabled for agent tracing to work.
  // `groqIntegration` is then on by default; add it to `integrations` only to change its options.
  tracesSampleRate: 1.0,
});

To group multi-turn chats in Conversations and show who started them, set a conversation ID and user in every request that makes AI calls. See Tracking Conversations.

By default, tracing support is added to the following Groq SDK calls:

  • chat.completions.create() - Chat completion requests
  • embeddings.create() - Embedding requests

Streaming and non-streaming requests are automatically detected and handled appropriately.

  • groq-sdk: >=0.3.0 <2

Type: boolean (optional)

Records inputs to Groq SDK calls (such as prompts and messages).

Defaults to true if dataCollection.genAI.inputs is true, which is the default.

Type: boolean (optional)

Records outputs from Groq SDK calls (such as generated text and responses).

Defaults to true if dataCollection.genAI.outputs is true, which is the default.

Copied
Sentry.init({
  dsn: "___PUBLIC_DSN___",
  tracesSampleRate: 1.0,
  integrations: [
    Sentry.groqIntegration({
      recordInputs: false,
      recordOutputs: false,
    }),
  ],
});
Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").