{"id":45697,"library":"openinference-instrumentation-groq","title":"OpenInference Groq Instrumentation","description":"OpenInference instrumentation for Groq LLM API calls. This package provides automatic tracing of Groq client interactions (chat completions, embeddings, etc.) for observability and monitoring. Version 0.1.16 supports Python 3.10-3.14. It is part of the OpenInference ecosystem and is used with Phoenix or other OpenInference-compatible collectors.","status":"active","version":"0.1.16","language":"python","source_language":"en","source_url":"https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-groq","tags":["openinference","groq","llm","instrumentation","opentelemetry","observability"],"install":[{"cmd":"pip install openinference-instrumentation-groq","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Base instrumentation framework and semantic conventions required.","package":"openinference-instrumentation","optional":false},{"reason":"Official Groq Python client library that is instrumented.","package":"groq","optional":false},{"reason":"OpenTelemetry API for creating spans and traces.","package":"opentelemetry-api","optional":false},{"reason":"OpenTelemetry SDK for exporting traces (often used with Phoenix).","package":"opentelemetry-sdk","optional":true}],"imports":[{"wrong":"from openinference_instrumentation_groq import GroqInstrumentor","symbol":"GroqInstrumentor","correct":"from openinference.instrumentation.groq import GroqInstrumentor"}],"quickstart":{"code":"import os\nfrom openinference_instrumentation_groq import GroqInstrumentor\nfrom opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter\nfrom opentelemetry.sdk.trace import TracerProvider\nfrom opentelemetry.sdk.trace.export import SimpleSpanProcessor\n\n# Set up OpenTelemetry (example with Phoenix)\nendpoint = os.environ.get('PHOENIX_COLLECTOR_ENDPOINT', 'http://localhost:4318/v1/traces')\nprovider = TracerProvider()\nprovider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter(endpoint)))\n\n# Instrument Groq\nGroqInstrumentor().instrument(tracer_provider=provider)\n\n# Now use Groq as usual\nfrom groq import Groq\nclient = Groq(api_key=os.environ.get('GROQ_API_KEY', ''))\nresponse = client.chat.completions.create(\n    model=\"llama3-8b-8192\",\n    messages=[{\"role\": \"user\", \"content\": \"Say hello!\"}]\n)\nprint(response.choices[0].message.content)","lang":"python","description":"Initialize OpenTelemetry, instrument Groq, then make a chat completion call to see traces."},"warnings":[{"fix":"Use `GroqInstrumentor().instrument(...)` instead of `GroqInstrumentor.instrument(...)`.","message":"The `GroqInstrumentor` must be instantiated (with parentheses) even if no arguments are passed. `GroqInstrumentor.instrument()` (classmethod) may not work as expected.","severity":"gotcha","affected_versions":"<=0.1.16"},{"fix":"Ensure `GroqInstrumentor().instrument()` is called at the top of your application, before any Groq client initialization.","message":"Instrumentation must be called before creating any Groq clients. If you import and use Groq before calling `instrument()`, some spans may be missed.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider using `from opentelemetry import trace; trace.set_tracer_provider(provider)` before instrumenting without arguments.","message":"The `tracer_provider` parameter may be deprecated in future versions in favor of setting the global tracer provider via `opentelemetry-api`. Check documentation for the latest pattern.","severity":"deprecated","affected_versions":"0.1.x"}],"env_vars":null,"search_vec":"'-3.14':33 '0.1.16':29 '3.10':32 'api':9 'automat':14 'call':10 'chat':20 'client':18 'collector':51 'compat':50 'complet':21 'ecosystem':40 'embed':22 'etc':23 'groq':2,7,17,53 'instrument':3,5,55 'interact':19 'llm':8,54 'monitor':27 'observ':25,57 'openinfer':1,4,39,49,52 'openinference-compat':48 'opentelemetri':56 'packag':12 'part':36 'phoenix':45 'provid':13 'python':31 'support':30 'trace':15 'use':43 'version':28","created_at":"2026-06-07T12:56:16.793208+00:00","updated_at":"2026-06-07T12:56:16.793208+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-groq","github":"https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-groq","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}