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.5.0.tar.gz (15.2 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.5.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file eigenh_observe-0.5.0.tar.gz.

File metadata

  • Download URL: eigenh_observe-0.5.0.tar.gz
  • Upload date:
  • Size: 15.2 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.5.0.tar.gz
Algorithm Hash digest
SHA256 8a7fd2366b83c9e059135079607d8f1c5ea216e6269c4235a7d0a7746c33e0dc
MD5 7d8fd1b846f3e64643bde8a0554ac5a0
BLAKE2b-256 33bb5863e90e436e63bcfc62e719f584a435178d34f6a568a8b5ff79541ebbfa

See more details on using hashes here.

File details

Details for the file eigenh_observe-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: eigenh_observe-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1486877be248c92a362c1a8e60faa3f9e8c8ab3321b003a6aa79192548ececba
MD5 4333bd06b99e47a7b97a21921069c908
BLAKE2b-256 894c0e67bcac467da0cd8b9de956d8dad7ef7d9a4ac794322b80adefd92d31c7

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