Skip to main content

servicedna (Python)

Connect a Python service to ServiceDNA with one dependency and two environment variables. You get:

  • Distributed traces for FastAPI, Flask, Django, ASGI/WSGI, requests, httpx, urllib3, aiohttp, gRPC, SQLAlchemy, psycopg2, Redis and Kafka (OpenTelemetry auto-instrumentation — only libraries you actually use are instrumented)
  • Self-registration — the service appears in ServiceDNA on first start
  • Health heartbeats — the service's own /health is checked and reported every 15 s

Install

pip install servicedna

Run

Prefix your usual command with servicedna-run:

SERVICEDNA_URL=https://servicedna.example.com \
SERVICEDNA_KEY=sdna_ik_... \
servicedna-run uvicorn app.main:app --host 0.0.0.0 --port 8000

Or start it from code, first thing in your entry point:

import servicedna
servicedna.start()

servicedna-run is preferred: it instruments libraries before your code imports them. Without SERVICEDNA_URL and SERVICEDNA_KEY both do nothing, so the same build runs anywhere.

Configuration

Variable Default
SERVICEDNA_URL — ServiceDNA base URL (required)
SERVICEDNA_KEY — Organization ingestion key, from Settings → Integrations (required)
SERVICEDNA_ENV — Environment (dev, staging, prod…); each is tracked separately
OTEL_SERVICE_NAME / SERVICEDNA_SERVICE working directory name Service name
SERVICEDNA_VERSION —
SERVICEDNA_HEALTH_URL — Health URL ServiceDNA can reach, so it can also probe the service itself
SERVICEDNA_HEALTH_PATH /health Path the heartbeat checks on http://127.0.0.1:$PORT
SERVICEDNA_LOCAL_HEALTH_URL from PORT + path Full URL the heartbeat checks, if not on PORT
SERVICEDNA_HEARTBEAT_MS 15000 0 disables heartbeats
SERVICEDNA_DEGRADED_MS 2000 Health response slower than this is reported DEGRADED

Standard OTEL_* variables still apply and win over these defaults.

Metadata

Release files for servicedna 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for servicedna 0.2.0
File Size Uploaded
servicedna-0.2.0.tar.gz 11.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for servicedna 0.2.0
File Interpreter ABI Platform
servicedna-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.9 kB

Release files / servicedna-0.2.0.tar.gz

Download URL servicedna-0.2.0.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c47828ce8024fd18f7b3854573669433b87c97d91052aab4f77b2aba4fd42558
BLAKE2b-256 checksum
How to use checksums
7b9252ce9ac85d11b738d4f26d6df841f0b6b1838c7c88071af9295b23971e39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release files / servicedna-0.2.0-py3-none-any.whl

Download URL servicedna-0.2.0-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
59c8eea44b292e81bf37f55d51a2e0093b3be3f998fcf36a9c51dbd4e6e4b0f5
BLAKE2b-256 checksum
How to use checksums
43b90f3add699883f68136cb7401e230e9c7ff8e2ef9d9ad6b8e37bc84fd775b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release 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