Skip to main content

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, caller as 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 traceparent extraction

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eigenh_observe-0.4.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

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

Hashes for eigenh_observe-0.4.0.tar.gz
Algorithm Hash digest
SHA256 894ecb4ca26c5df66de88d4ff62f7438a1ec85317fac3c217865db89ff41d0c8
MD5 383e5b4243639d7ccca821de17060a23
BLAKE2b-256 e21c7d43ad24019dab1cb76fd51040f73f384d52b8a35df25fecd48655bb039a

See more details on using hashes here.

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

Hashes for eigenh_observe-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30d8162f1958771832e639e6b4a80ad34b59fe2f05cac34cc540a329b2c3dd24
MD5 400d12d6dffc94bda3a0e394a72f2908
BLAKE2b-256 322f83d9479f4cfe1970ee5b7076760fe2260c9eda5f5234c6b3ef41a7c3bf80

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page