This guide covers installing Botanu SDK and its optional dependencies.
- Python 3.9 or later
- OpenTelemetry Collector (for span processing)
Install the core SDK with pip:
pip install botanuThe core package has minimal dependencies:
opentelemetry-api >= 1.20.0
This is all you need if you already have OpenTelemetry configured in your application.
If you don't have an existing OpenTelemetry setup:
pip install "botanu[sdk]"This adds:
opentelemetry-sdk- The OTel SDK implementationopentelemetry-exporter-otlp-proto-http- OTLP HTTP exporter
For automatic instrumentation of common libraries:
pip install "botanu[instruments]"Includes instrumentation for:
- HTTP clients: requests, httpx, urllib3, aiohttp
- Web frameworks: FastAPI, Flask, Django, Starlette
- Databases: SQLAlchemy, psycopg2, asyncpg, pymongo, redis
- Messaging: Celery, Kafka
- Other: gRPC, logging
For automatic LLM provider instrumentation:
pip install "botanu[genai]"Includes instrumentation for:
- OpenAI
- Anthropic
- Google Vertex AI
- Google GenAI
- LangChain
To install all optional dependencies:
pip install "botanu[all]"For development and testing:
pip install "botanu[dev]"import botanu
print(botanu.__version__)In a Dockerfile:
FROM python:3.11-slim
WORKDIR /app
# Install Botanu with SDK extras
RUN pip install "botanu[sdk]"
COPY . .
CMD ["python", "app.py"][tool.poetry.dependencies]
botanu = { version = "^0.1.0", extras = ["sdk"] }# requirements.in
botanu[sdk]>=0.1.0
Generate with:
pip-compile requirements.inBotanu SDK sends traces to an OpenTelemetry Collector. You'll need one running to receive spans.
Quick start with Docker:
docker run -p 4318:4318 otel/opentelemetry-collector:latestSee Collector Configuration for detailed setup.
- Quickstart - Your first instrumented application
- Configuration - Customize SDK behavior