EigenH observability — structured logs + AI events + distributed traces
Project description
eigenh-observe
Observability package for EigenH services — structured logs, AI generation events, and distributed traces, all routed to PostHog.
Install
pip install eigenh-observe
Quick start
import eigenh_observe
eigenh_observe.init(
service_name="my-service",
env="prod",
instrument_http=True,
)
token = eigenh_observe.set_call_context(call_id="room-123", org_id="org-abc", caller="+1234567890")
try:
with eigenh_observe.session_span():
with eigenh_observe.llm_span("gemini-2.5-flash") as span:
# ... call your LLM ...
span.set_usage(input_tokens=100, output_tokens=50)
finally:
eigenh_observe.reset_call_context(token)
Features
- Structured logs → PostHog Logs (with
call_id,org_id,calleras filterable attributes) - AI generation events → PostHog AI Observability (
$ai_generation,$ai_span) - Distributed traces → PostHog Traces (session → llm → tool span tree)
- HTTP auto-instrumentation (
requests,httpx,aiohttp) - FastAPI inbound
traceparentextraction
Environment variables
| Variable | Purpose |
|---|---|
POSTHOG_API_KEY |
PostHog project API key |
POSTHOG_HOST |
PostHog host (default: https://us.i.posthog.com) |
APP_ENV |
Environment name (dev, stage, prod) |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
eigenh_observe-0.4.0.tar.gz
(14.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eigenh_observe-0.4.0.tar.gz.
File metadata
- Download URL: eigenh_observe-0.4.0.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
894ecb4ca26c5df66de88d4ff62f7438a1ec85317fac3c217865db89ff41d0c8
|
|
| MD5 |
383e5b4243639d7ccca821de17060a23
|
|
| BLAKE2b-256 |
e21c7d43ad24019dab1cb76fd51040f73f384d52b8a35df25fecd48655bb039a
|
File details
Details for the file eigenh_observe-0.4.0-py3-none-any.whl.
File metadata
- Download URL: eigenh_observe-0.4.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30d8162f1958771832e639e6b4a80ad34b59fe2f05cac34cc540a329b2c3dd24
|
|
| MD5 |
400d12d6dffc94bda3a0e394a72f2908
|
|
| BLAKE2b-256 |
322f83d9479f4cfe1970ee5b7076760fe2260c9eda5f5234c6b3ef41a7c3bf80
|