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
/healthis 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.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| servicedna-0.1.0.tar.gz | 11.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| servicedna-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.9 kB
Release files / servicedna-0.1.0.tar.gz
| Download URL | servicedna-0.1.0.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4fa7d96840f318e411f14e5dcb517e8ada047b77e87433bfbd41a328e80f0fdb
|
|
BLAKE2b-256 checksum How to use checksums |
9a41beb9de9338f0cff1366b74b7a41f4015e67289c606874de202c69a341592
|
| 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 Sep 26, 2026.
Transparency logRelease files / servicedna-0.1.0-py3-none-any.whl
| Download URL | servicedna-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d5c082d9c873bbeee21e24b49b85edb44d73079f9375e0c6e3d189c85654d08
|
|
BLAKE2b-256 checksum How to use checksums |
6404d33e033b8770875e27c4267ca2b97792fd511856ba9136626fc253624b8e
|
| 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 Sep 26, 2026.
Transparency log