Skip to main content

hostess-python

The Hostess SDK for Python. Native API Insights for FastAPI (and, later, other Python frameworks) with one line of code.

pip install "hostess-python[fastapi]"
from fastapi import FastAPI
from hostess_sdk.fastapi import instrument

app = FastAPI()
instrument(app)

That's it. When deployed on Hostess, route-level traffic, latency, status codes, and error rates appear in Studio — no OTLP, collector, or Prometheus configuration required.

What instrument(app) does

  • Applies OpenTelemetry FastAPI instrumentation, so requests produce server spans carrying the route template (/items/{item_id}), method, and status — never raw paths or query strings.
  • Exports spans over OTLP/HTTP to the Hostess collector. The endpoint is injected by the platform (HOSTESS_OTEL_ENDPOINT); override with otlp_endpoint= for local use.
  • Emits a periodic marker heartbeat so Studio can tell "installed, waiting for traffic" from "not installed".

It is idempotent, fails silent and cheap (bounded queue, never adds request latency or crashes the app), and is a clean no-op when disabled (enabled=False / HOSTESS_INSTRUMENTATION=false) or when no collector endpoint is available.

Options

instrument(
    app,
    enabled=None,            # None → env (HOSTESS_INSTRUMENTATION), default on
    service_name=None,       # defaults to the platform-injected name
    exclude_paths=["/health"],
    otlp_endpoint=None,      # local/advanced override
)

Privacy

The helper collects HTTP method, route template, status code, and duration. It never collects request/response bodies, query strings, raw URLs, headers, cookies, tokens, user IDs, or client IPs.

Development

uv sync
uv run pytest

Status

v0.1 — instrument(app) for FastAPI. Roadmap: a HostessFastAPI drop-in, opt-in exception metrics, and additional framework helpers (Django, Flask).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hostess_python-0.2.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

hostess_python-0.2.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file hostess_python-0.2.0.tar.gz.

File metadata

  • Download URL: hostess_python-0.2.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for hostess_python-0.2.0.tar.gz
Algorithm Hash digest
SHA256 22a581abed2ff100a2ea7bc719bcafb207cfd2289a1b88097569403b96797c9b
MD5 5ba3f8e1af6f6e4e7969e575da47bbcc
BLAKE2b-256 d8078ee34d32b2a3651de34e2987b1db8d78713e6096ce3c4e99a2b30801ff1a

See more details on using hashes here.

File details

Details for the file hostess_python-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: hostess_python-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for hostess_python-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8801456a75a96aaa53a0d3e1d8e43a301468941e06eda0c90d25ae14d29a7510
MD5 81ca5343b1981407a4335347460a654e
BLAKE2b-256 f8c975682b5e4b0bcccf5fb332765818384cbd7871387dd60994e303303ec9a5

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page