Registry / observability / opentelemetry-instrumentation-pinecone

opentelemetry-instrumentation-pinecone

JSON →
library0.62.3pypypi✓ verified 23d ago

This library provides OpenTelemetry instrumentation for the Pinecone vector database client. It automatically captures spans and traces for operations, adhering to OpenTelemetry's Generative AI Semantic Conventions. As part of the `openllmetry` project, it follows a rapid release cycle, with the current version being 0.58.0.

pip install opentelemetry-instrumentation-pinecone pinecone opentelemetry-sdk
INSTALL
IMPORT
SIG · OPENTELEMETRY-INST
O
opentelemetry-instrumentation-pinecone
observabilitypythonv0.62.3
Install
4.6s avg
Import
488ms
Disk
39MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.60.0 · 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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.512s · 40.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.6s · import 0.464s · 41MB
39MB installed
● package 39MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PineconeInstrumentor
from opentelemetry.instrumentation.pinecone import PineconeInstrumentor

This quickstart demonstrates how to set up basic OpenTelemetry console tracing and instrument the Pinecone client. Ensure you have the `pinecone` library (v2+) and OpenTelemetry SDK installed. Set `PINECONE_API_KEY` and `PINECONE_ENVIRONMENT` environment variables for a runnable example.

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.pinecone import PineconeInstrumentor import pinecone # 1. Setup OpenTelemetry Tracer Provider (for console output) resource = Resource.create({"service.name": "my-pinecone-app"}) provider = TracerProvider(resource=resource) span_processor = SimpleSpanProcessor(ConsoleSpanExporter()) provider.add_span_processor(span_processor) trace.set_tracer_provider(provider) # 2. Instrument Pinecone client calls PineconeInstrumentor().instrument() # 3. Use Pinecone as usual api_key = os.environ.get("PINECONE_API_KEY", "YOUR_API_KEY") environment = os.environ.get("PINECONE_ENVIRONMENT", "YOUR_ENVIRONMENT") if api_key == "YOUR_API_KEY" or environment == "YOUR_ENVIRONMENT": print("Please set PINECONE_API_KEY and PINECONE_ENVIRONMENT environment variables.") print("Skipping Pinecone client interaction due to missing credentials.") elif not pinecone.list_indexes: # Check if the package is the new pinecone library print("It appears you are using the old `pinecone-client` library. This instrumentation requires `pinecone` (v2+).") print("Skipping Pinecone client interaction.") else: try: pinecone.init(api_key=api_key, environment=environment) # This operation will be traced indexes = pinecone.list_indexes() print(f"Pinecone Indexes: {indexes}") print("Check your console for OpenTelemetry traces!") except Exception as e: print(f"Error interacting with Pinecone: {e}") print("Ensure your Pinecone API Key and Environment are correct and that you are using `pinecone` v2+.")
opentelemetry-instrument --version
Debug
Known issues
breakingStarting from version 0.53.0, this instrumentation switched from supporting the deprecated `pinecone-client` package to the newer `pinecone` (v2.x.x) package. If you are using an older version of the instrumentation or the older Pinecone client, ensure compatibility.
fix
Upgrade your Pinecone client to `pinecone` (version 2.x.x or higher) and install `opentelemetry-instrumentation-pinecone` 0.53.0 or higher. If you must use `pinecone-client`, pin your instrumentation version to <0.53.0.
affects: >=0.53.0
gotchaThe `PineconeInstrumentor().instrument()` call only patches the `pinecone` library methods. To actually collect, process, and export telemetry data, you must configure an OpenTelemetry `TracerProvider` with appropriate `SpanProcessors` and `SpanExporters`.
fix
Refer to the OpenTelemetry Python SDK documentation for full setup instructions, including configuring exporters like OTLP, Jaeger, or Zipkin.
affects: All
gotchaThe `pinecone` library itself is a peer dependency and is not installed automatically with `opentelemetry-instrumentation-pinecone`. You must explicitly install it.
fix
Ensure `pip install pinecone` is run in your environment alongside the instrumentation package. Verify you are using `pinecone` v2.x.x+.
affects: All
Upgrade
Version history
0.62.3latest on PyPI · released Aug 10, 2026
Audit
Dependencies
pineconerequiredThe instrumentation targets the `pinecone` client library. It must be installed separately for the instrumentation to function.
opentelemetry-sdkrequiredRequired for configuring tracing providers and exporters to process and send telemetry data.
opentelemetry-apirequiredCore OpenTelemetry API, usually pulled in by the SDK.
Agent activity
54 hits · last 30 days
node
46
OpenAI (training)
1
Resources
opentelemetry-instrumentation-pinecone — pip install opentelemetry-instrumentation-pinecone · libregistry