Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,20 @@ If you already have OpenTelemetry instrumented, you can just add any of our inst

## 🚀 Getting Started


The easiest way to get started is to use our SDK.
For a complete guide, go to our [docs](https://traceloop.com/docs/openllmetry/getting-started-python).

Install the SDK:
Install the SDK with all instrumentations:

```bash
pip install traceloop-sdk[full]
```
Comment on lines +69 to +71
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Quote extras to avoid shell globbing and PowerShell parsing issues

Unquoted extras can break in zsh/bash (globbing of [..]) and PowerShell. Recommend quoting for cross-shell compatibility.

Apply:

-```bash
-pip install traceloop-sdk[full]
-```
+```bash
+pip install "traceloop-sdk[full]"
+```
🤖 Prompt for AI Agents
In README.md around lines 69 to 71, the pip install command uses unquoted extras
which can cause shell globbing issues in zsh/bash and parsing problems in
PowerShell. To fix this, add double quotes around the extras part in the pip
install command, changing pip install traceloop-sdk[full] to pip install
"traceloop-sdk[full]". Also ensure the code block is properly fenced with triple
backticks and the bash language identifier.


Or, to install only the instrumentations you need (for example, OpenAI and LangChain):

```bash
pip install traceloop-sdk
pip install traceloop-sdk[openai,langchain]
```
Comment on lines +73 to 77
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Also quote selective extras; add a brief cross-shell note

Same quoting concern applies here. Suggest a short note that quoting is required in PowerShell/zsh.

Apply:

-Or, to install only the instrumentations you need (for example, OpenAI and LangChain):
+Or, to install only the instrumentations you need (for example, OpenAI and LangChain):
+Tip: quote extras for zsh/PowerShell compatibility.
 
 ```bash
-pip install traceloop-sdk[openai,langchain]
+pip install "traceloop-sdk[openai,langchain]"

<details>
<summary>🤖 Prompt for AI Agents</summary>

In README.md around lines 73 to 77, the pip install command for selective extras
lacks quotes, which can cause issues in shells like PowerShell and zsh. Fix this
by adding double quotes around the package and extras list, changing pip install
traceloop-sdk[openai,langchain] to pip install
"traceloop-sdk[openai,langchain]". Also, add a brief note explaining that
quoting is necessary in PowerShell and zsh to avoid shell interpretation errors.


</details>

<!-- fingerprinting:phantom:triton:capybara -->

<!-- This is an auto-generated comment by CodeRabbit -->


Then, to start instrumenting your code, just add this line to your code:
Expand Down
35 changes: 35 additions & 0 deletions packages/traceloop-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,41 @@

Traceloop’s Python SDK allows you to easily start monitoring and debugging your LLM execution. Tracing is done in a non-intrusive way, built on top of OpenTelemetry. You can choose to export the traces to Traceloop, or to your existing observability stack.


## Installation


You can now install only the integrations you need, or groups of them:

- All LLM providers:
```bash
pip install traceloop-sdk[llm]
```
- All frameworks:
```bash
pip install traceloop-sdk[frameworks]
```
- All vector stores:
```bash
pip install traceloop-sdk[vectorstores]
```
- All cloud providers:
```bash
pip install traceloop-sdk[cloud]
```
- Everything:
```bash
pip install traceloop-sdk[all]
```
- Or any combination, e.g.:
```bash
pip install traceloop-sdk[openai,chromadb]
```

This keeps your install minimal and fast!

---

```python
Traceloop.init(app_name="joke_generation_service")

Expand Down
176 changes: 141 additions & 35 deletions packages/traceloop-sdk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,41 +29,6 @@ opentelemetry-api = "^1.28.0"
opentelemetry-sdk = "^1.28.0"
opentelemetry-exporter-otlp-proto-http = "^1.28.0"
opentelemetry-exporter-otlp-proto-grpc = "^1.28.0"
opentelemetry-instrumentation-logging = ">=0.50b0"
opentelemetry-instrumentation-requests = ">=0.50b0"
opentelemetry-instrumentation-sqlalchemy = ">=0.50b0"
opentelemetry-instrumentation-urllib3 = ">=0.50b0"
opentelemetry-instrumentation-threading = ">=0.50b0"
opentelemetry-instrumentation-redis = ">=0.50b0"
opentelemetry-semantic-conventions-ai = "0.4.11"
opentelemetry-instrumentation-mistralai = { path = "../opentelemetry-instrumentation-mistralai", develop = true }
opentelemetry-instrumentation-openai = { path = "../opentelemetry-instrumentation-openai", develop = true }
opentelemetry-instrumentation-openai-agents = { path = "../opentelemetry-instrumentation-openai-agents", develop = true }
opentelemetry-instrumentation-ollama = { path = "../opentelemetry-instrumentation-ollama", develop = true }
opentelemetry-instrumentation-anthropic = { path = "../opentelemetry-instrumentation-anthropic", develop = true }
opentelemetry-instrumentation-cohere = { path = "../opentelemetry-instrumentation-cohere", develop = true }
opentelemetry-instrumentation-crewai = { path = "../opentelemetry-instrumentation-crewai", develop = true }
opentelemetry-instrumentation-google-generativeai = { path = "../opentelemetry-instrumentation-google-generativeai", develop = true }
opentelemetry-instrumentation-pinecone = { path = "../opentelemetry-instrumentation-pinecone", develop = true }
opentelemetry-instrumentation-qdrant = { path = "../opentelemetry-instrumentation-qdrant", develop = true }
opentelemetry-instrumentation-langchain = { path = "../opentelemetry-instrumentation-langchain", develop = true }
opentelemetry-instrumentation-lancedb = { path = "../opentelemetry-instrumentation-lancedb", develop = true }
opentelemetry-instrumentation-chromadb = { path = "../opentelemetry-instrumentation-chromadb", develop = true }
opentelemetry-instrumentation-transformers = { path = "../opentelemetry-instrumentation-transformers", develop = true }
opentelemetry-instrumentation-together = { path = "../opentelemetry-instrumentation-together", develop = true }
opentelemetry-instrumentation-llamaindex = { path = "../opentelemetry-instrumentation-llamaindex", develop = true }
opentelemetry-instrumentation-milvus = { path = "../opentelemetry-instrumentation-milvus", develop = true }
opentelemetry-instrumentation-haystack = { path = "../opentelemetry-instrumentation-haystack", develop = true }
opentelemetry-instrumentation-bedrock = { path = "../opentelemetry-instrumentation-bedrock", develop = true }
opentelemetry-instrumentation-sagemaker = { path = "../opentelemetry-instrumentation-sagemaker", develop = true }
opentelemetry-instrumentation-replicate = { path = "../opentelemetry-instrumentation-replicate", develop = true }
opentelemetry-instrumentation-vertexai = { path = "../opentelemetry-instrumentation-vertexai", develop = true }
opentelemetry-instrumentation-watsonx = { path = "../opentelemetry-instrumentation-watsonx", develop = true }
opentelemetry-instrumentation-weaviate = { path = "../opentelemetry-instrumentation-weaviate", develop = true }
opentelemetry-instrumentation-alephalpha = { path = "../opentelemetry-instrumentation-alephalpha", develop = true }
opentelemetry-instrumentation-marqo = { path = "../opentelemetry-instrumentation-marqo", develop = true }
opentelemetry-instrumentation-groq = { path = "../opentelemetry-instrumentation-groq", develop = true }
opentelemetry-instrumentation-mcp = { path = "../opentelemetry-instrumentation-mcp", develop = true }
colorama = "^0.4.6"
tenacity = ">=8.2.3, <10.0"
pydantic = ">=1"
Expand All @@ -89,5 +54,146 @@ langchain = "^0.2.5"
langchain-openai = "^0.1.15"

[build-system]
[tool.poetry.extras]
llm = [
"../opentelemetry-instrumentation-openai",
"../opentelemetry-instrumentation-anthropic",
"../opentelemetry-instrumentation-cohere",
"../opentelemetry-instrumentation-groq",
"../opentelemetry-instrumentation-ollama",
"../opentelemetry-instrumentation-mistralai",
"../opentelemetry-instrumentation-bedrock",
"../opentelemetry-instrumentation-sagemaker",
"../opentelemetry-instrumentation-replicate",
"../opentelemetry-instrumentation-vertexai",
"../opentelemetry-instrumentation-watsonx",
"../opentelemetry-instrumentation-google-generativeai",
"../opentelemetry-instrumentation-alephalpha"
]
frameworks = [
"../opentelemetry-instrumentation-langchain",
"../opentelemetry-instrumentation-llamaindex",
"../opentelemetry-instrumentation-crewai",
"../opentelemetry-instrumentation-haystack",
"../opentelemetry-instrumentation-transformers",
"../opentelemetry-instrumentation-together"
]
vectorstores = [
"../opentelemetry-instrumentation-pinecone",
"../opentelemetry-instrumentation-qdrant",
"../opentelemetry-instrumentation-weaviate",
"../opentelemetry-instrumentation-chromadb",
"../opentelemetry-instrumentation-lancedb",
"../opentelemetry-instrumentation-milvus",
"../opentelemetry-instrumentation-marqo"
]
cloud = [
"../opentelemetry-instrumentation-bedrock",
"../opentelemetry-instrumentation-vertexai",
"../opentelemetry-instrumentation-sagemaker",
"../opentelemetry-instrumentation-watsonx",
"../opentelemetry-instrumentation-google-generativeai"
]
minimal = [
"opentelemetry-api",
"opentelemetry-sdk",
"opentelemetry-exporter-otlp-proto-http",
"opentelemetry-exporter-otlp-proto-grpc",
"colorama",
"tenacity",
"pydantic",
"jinja2",
"deprecated",
"posthog",
"aiohttp"
]
all = [
"llm",
"frameworks",
"vectorstores",
"cloud",
"logging",
"requests",
"sqlalchemy",
"urllib3",
"threading",
"redis",
"semantic-conventions-ai",
"../opentelemetry-instrumentation-openai-agents",
"../opentelemetry-instrumentation-mcp",
"../opentelemetry-instrumentation-groq"
]
logging = ["opentelemetry-instrumentation-logging"]
requests = ["opentelemetry-instrumentation-requests"]
sqlalchemy = ["opentelemetry-instrumentation-sqlalchemy"]
urllib3 = ["opentelemetry-instrumentation-urllib3"]
threading = ["opentelemetry-instrumentation-threading"]
redis = ["opentelemetry-instrumentation-redis"]
semantic-conventions-ai = ["opentelemetry-semantic-conventions-ai"]
mistralai = ["../opentelemetry-instrumentation-mistralai"]
openai = ["../opentelemetry-instrumentation-openai"]
openai-agents = ["../opentelemetry-instrumentation-openai-agents"]
ollama = ["../opentelemetry-instrumentation-ollama"]
anthropic = ["../opentelemetry-instrumentation-anthropic"]
cohere = ["../opentelemetry-instrumentation-cohere"]
crewai = ["../opentelemetry-instrumentation-crewai"]
google-generativeai = ["../opentelemetry-instrumentation-google-generativeai"]
pinecone = ["../opentelemetry-instrumentation-pinecone"]
qdrant = ["../opentelemetry-instrumentation-qdrant"]
langchain = ["../opentelemetry-instrumentation-langchain"]
lancedb = ["../opentelemetry-instrumentation-lancedb"]
chromadb = ["../opentelemetry-instrumentation-chromadb"]
transformers = ["../opentelemetry-instrumentation-transformers"]
together = ["../opentelemetry-instrumentation-together"]
llamaindex = ["../opentelemetry-instrumentation-llamaindex"]
milvus = ["../opentelemetry-instrumentation-milvus"]
haystack = ["../opentelemetry-instrumentation-haystack"]
bedrock = ["../opentelemetry-instrumentation-bedrock"]
sagemaker = ["../opentelemetry-instrumentation-sagemaker"]
replicate = ["../opentelemetry-instrumentation-replicate"]
vertexai = ["../opentelemetry-instrumentation-vertexai"]
watsonx = ["../opentelemetry-instrumentation-watsonx"]
weaviate = ["../opentelemetry-instrumentation-weaviate"]
alephalpha = ["../opentelemetry-instrumentation-alephalpha"]
marqo = ["../opentelemetry-instrumentation-marqo"]
groq = ["../opentelemetry-instrumentation-groq"]
mcp = ["../opentelemetry-instrumentation-mcp"]
Comment on lines +57 to +160
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Extras reference undeclared path dependencies – build will fail.

[tool.poetry.extras] lists entries such as

"../opentelemetry-instrumentation-openai"

but none of these path packages are declared in [tool.poetry.dependencies] with optional = true.
Poetry (and pip) resolve extras only against dependencies already present; referencing raw paths here causes resolution errors during poetry build or pip install traceloop-sdk[full].

Add each instrumentation as an optional dependency first, then reference its name (not the path) in the extras list, e.g.:

[tool.poetry.dependencies]
opentelemetry-instrumentation-openai = {path = "../opentelemetry-instrumentation-openai", optional = true}

[tool.poetry.extras]
openai = ["opentelemetry-instrumentation-openai"]
llm = ["openai", ...]

Without this fix, publishing the wheel or installing with extras will error out.

🤖 Prompt for AI Agents
In packages/traceloop-sdk/pyproject.toml between lines 57 and 160, the extras
section references path dependencies directly without declaring them as optional
dependencies in the [tool.poetry.dependencies] section. To fix this, add each
instrumentation package as an optional dependency under
[tool.poetry.dependencies] with its path and optional = true, then update the
extras lists to reference these dependency names instead of raw paths. This
ensures proper resolution during build and installation.

full = [
"opentelemetry-instrumentation-logging",
"opentelemetry-instrumentation-requests",
"opentelemetry-instrumentation-sqlalchemy",
"opentelemetry-instrumentation-urllib3",
"opentelemetry-instrumentation-threading",
"opentelemetry-instrumentation-redis",
"opentelemetry-semantic-conventions-ai",
"../opentelemetry-instrumentation-mistralai",
"../opentelemetry-instrumentation-openai",
"../opentelemetry-instrumentation-openai-agents",
"../opentelemetry-instrumentation-ollama",
"../opentelemetry-instrumentation-anthropic",
"../opentelemetry-instrumentation-cohere",
"../opentelemetry-instrumentation-crewai",
"../opentelemetry-instrumentation-google-generativeai",
"../opentelemetry-instrumentation-pinecone",
"../opentelemetry-instrumentation-qdrant",
"../opentelemetry-instrumentation-langchain",
"../opentelemetry-instrumentation-lancedb",
"../opentelemetry-instrumentation-chromadb",
"../opentelemetry-instrumentation-transformers",
"../opentelemetry-instrumentation-together",
"../opentelemetry-instrumentation-llamaindex",
"../opentelemetry-instrumentation-milvus",
"../opentelemetry-instrumentation-haystack",
"../opentelemetry-instrumentation-bedrock",
"../opentelemetry-instrumentation-sagemaker",
"../opentelemetry-instrumentation-replicate",
"../opentelemetry-instrumentation-vertexai",
"../opentelemetry-instrumentation-watsonx",
"../opentelemetry-instrumentation-weaviate",
"../opentelemetry-instrumentation-alephalpha",
"../opentelemetry-instrumentation-marqo",
"../opentelemetry-instrumentation-groq",
"../opentelemetry-instrumentation-mcp"
]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Loading