Skip to content
Merged
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
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenObserve Telemetry SDK
# OpenObserve Python SDK

A simple and lightweight Python SDK for exporting OpenTelemetry logs, metrics, and traces to [OpenObserve](https://openobserve.ai/).
A Python SDK for OpenObserve telemetry and evaluations.

## Features

Expand Down Expand Up @@ -36,7 +36,7 @@ export ANTHROPIC_API_KEY="your-anthropic-key"

**Install dependencies:**
```bash
pip install openobserve-telemetry-sdk openai opentelemetry-instrumentation-openai
pip install openobserve-python-sdk openai opentelemetry-instrumentation-openai
```

**Quick Example – OpenAI Instrumentation:**
Expand Down Expand Up @@ -165,7 +165,7 @@ If you already manage OpenTelemetry providers yourself, see [Native OpenTelemetr
- Standard HTTP header handling (preserves case).

**gRPC**
- Requires the optional gRPC extra: `pip install openobserve-telemetry-sdk[grpc]`.
- Requires the optional gRPC extra: `pip install openobserve-python-sdk[grpc]`.
- Uses gRPC protocol with automatic configuration:
- Organization is passed as a header (not in the URL).
- Automatically adds required headers:
Expand All @@ -182,10 +182,10 @@ Choose your preferred installation method:

```bash
# From PyPI (recommended)
pip install openobserve-telemetry-sdk
pip install openobserve-python-sdk

# With gRPC transport support (needed for protocol="grpc")
pip install "openobserve-telemetry-sdk[grpc]"
pip install "openobserve-python-sdk[grpc]"

# From source (development)
pip install -e .
Expand All @@ -194,11 +194,8 @@ pip install -e .
pip install -r requirements.txt
```

HTTP/Protobuf (the default protocol) works out of the box. The gRPC transport
is an optional extra — install `openobserve-telemetry-sdk[grpc]` if you set
`protocol="grpc"` (or `OPENOBSERVE_PROTOCOL=grpc`). Keeping it optional means a
broken or version-drifted gRPC exporter install can never affect HTTP users,
and the core install stays free of the native `grpcio` dependency.
HTTP/Protobuf is the default protocol. For gRPC, install `openobserve-python-sdk[grpc]` and set `protocol="grpc"` or `OPENOBSERVE_PROTOCOL=grpc`.
The core package does not depend on `grpcio`.

## Supported Instruments

Expand Down
2 changes: 1 addition & 1 deletion examples/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Install with: pip install -r examples/requirements.txt

# Core project dependency (install from parent directory with: pip install -e ..)
# openobserve>=0.1.0
# openobserve-python-sdk>=0.2.0

# LangChain packages for qa_chain.py example
langchain>=0.3.0
Expand Down
2 changes: 1 addition & 1 deletion openobserve/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _import_grpc_exporters():
except Exception as err:
raise ImportError(
"protocol='grpc' requires the OTLP gRPC exporter, which failed to import. "
"Install it with `pip install openobserve-telemetry-sdk[grpc]` and make "
"Install it with `pip install openobserve-python-sdk[grpc]` and make "
"sure all opentelemetry-* packages come from the same release train. "
f"Installed: {_installed_otel_versions()}"
) from err
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[project]
name = "openobserve-telemetry-sdk"
name = "openobserve-python-sdk"
version = "0.2.0"
description = "A simple Python SDK for exporting OpenTelemetry logs, metrics, and traces to OpenObserve"
description = "Python SDK for OpenObserve telemetry and evaluations"
readme = "README.md"
requires-python = ">=3.9"
license = {text = "MIT"}
authors = [
{name = "OpenObserve", email = "info@openobserve.ai"}
]
keywords = ["openobserve", "opentelemetry", "tracing", "observability", "monitoring", "openobserve-telemetry-sdk"]
keywords = ["openobserve", "opentelemetry", "tracing", "observability", "monitoring", "openobserve-python-sdk"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
Expand Down
7 changes: 4 additions & 3 deletions tests/test_broken_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ def test_http_traces_work_with_broken_grpc_exporter(broken_grpc_exporter):
mock_exporter.assert_called_once()


def test_grpc_protocol_raises_actionable_error(broken_grpc_exporter):
"""grpc users get a clear ImportError pointing at the [grpc] extra, not a deep traceback."""
def test_grpc_protocol_fails_with_broken_exporter(broken_grpc_exporter):
"""A broken gRPC exporter fails only when gRPC is used."""
client = OpenObserveClient(_grpc_config())
with pytest.raises(ImportError, match=r"openobserve-telemetry-sdk\[grpc\]"):
with pytest.raises(ImportError) as error:
client.initialize_traces()
assert isinstance(error.value.__cause__, ImportError)
Loading