Registry /
observability / opentelemetry-instrumentation-groq
Install & Compatibility
Where this runs
tested against v0.62.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.190s · 39.2MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 5.1s · import 1.096s · 39MB
38MB installed
● package 38MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
GroqInstrumentor
✓ from opentelemetry.instrumentation.groq import GroqInstrumentor
This quickstart demonstrates how to set up the OpenTelemetry SDK with a console exporter, instrument the Groq client, and make a sample API call. Traces generated by the Groq client will be printed to the console.
import os
from opentelemetry import trace
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import ConsoleSpanExporter, SimpleSpanProcessor
from opentelemetry.instrumentation.groq import GroqInstrumentor
# 1. Configure OpenTelemetry SDK
resource = Resource.create({"service.name": "groq-llm-app"})
provider = TracerProvider(resource=resource)
processor = SimpleSpanProcessor(ConsoleSpanExporter())
provider.add_span_processor(processor)
trace.set_tracer_provider(provider)
# 2. Instrument the Groq library
GroqInstrumentor().instrument()
# 3. Ensure Groq API key is set
groq_api_key = os.environ.get("GROQ_API_KEY", "
# In a real application, use proper secret management.
# For this quickstart, ensure the env var is set or provide a dummy key for testing.
")
if not groq_api_key:
print("Warning: GROQ_API_KEY environment variable not set.")
print("Skipping Groq API call. Please set GROQ_API_KEY to run the example.")
else:
print("Making Groq API call...")
try:
from groq import Groq
client = Groq(api_key=groq_api_key)
chat_completion = client.chat.completions.create(
messages=[
{
"role": "user",
"content": "Explain the concept of 'observability' in one sentence."
}
],
model="llama3-8b-8192",
temperature=0.7,
max_tokens=100
)
print("Groq Response:", chat_completion.choices[0].message.content)
print("Traces should be printed to console.")
except Exception as e:
print(f"An error occurred during Groq API call: {e}")
Upgrade
Version history
0.62.3latest on PyPI · released Aug 10, 2026
Audit
Dependencies
opentelemetry-apirequiredCore OpenTelemetry API for tracing.
opentelemetry-sdkrequiredOpenTelemetry SDK for provider and processor setup.
opentelemetry-semantic-conventionsrequiredDefines the standard attribute names and values for GenAI operations.
groqrequiredThe Groq client library being instrumented. This package does not bundle it.