Skip to content

Latest commit

 

History

History
141 lines (93 loc) · 2.38 KB

File metadata and controls

141 lines (93 loc) · 2.38 KB

Installation

This guide covers installing Botanu SDK and its optional dependencies.

Requirements

  • Python 3.9 or later
  • OpenTelemetry Collector (for span processing)

Basic Installation

Install the core SDK with pip:

pip install botanu

The core package has minimal dependencies:

  • opentelemetry-api >= 1.20.0

This is all you need if you already have OpenTelemetry configured in your application.

Installation with Extras

Full SDK (Recommended for Standalone)

If you don't have an existing OpenTelemetry setup:

pip install "botanu[sdk]"

This adds:

  • opentelemetry-sdk - The OTel SDK implementation
  • opentelemetry-exporter-otlp-proto-http - OTLP HTTP exporter

Auto-Instrumentation

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

GenAI Instrumentation

For automatic LLM provider instrumentation:

pip install "botanu[genai]"

Includes instrumentation for:

  • OpenAI
  • Anthropic
  • Google Vertex AI
  • Google GenAI
  • LangChain

Everything

To install all optional dependencies:

pip install "botanu[all]"

Development

For development and testing:

pip install "botanu[dev]"

Verify Installation

import botanu
print(botanu.__version__)

Docker

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"]

Poetry

[tool.poetry.dependencies]
botanu = { version = "^0.1.0", extras = ["sdk"] }

pip-tools / requirements.txt

# requirements.in
botanu[sdk]>=0.1.0

Generate with:

pip-compile requirements.in

Collector Setup

Botanu 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:latest

See Collector Configuration for detailed setup.

Next Steps