Automatic journey_id propagation for DataFramer — inbound extraction, outbound header injection, Langfuse trace stamping
Project description
dataframer-journey
Automatic journey_id propagation for DataFramer user-signal stitching. One line per service; after that the journey id flows browser → service → service → trace without anyone threading it by hand.
Install
pip install dataframer-journey
Zero runtime dependencies. Patches apply only to libraries you already have (requests, httpx, langfuse).
Usage
FastAPI / Starlette:
from dataframer_journey import instrument
app = FastAPI()
instrument(app)
Django — call instrument() at the end of settings.py and add the middleware:
MIDDLEWARE = [
...,
'dataframer_journey.django.JourneyIdMiddleware',
]
import dataframer_journey
dataframer_journey.instrument()
That's it. From then on:
- Inbound: the journey id is read off each incoming request (
baggageheader →X-Journey-Idheader →df_journey_idcookie set by@dataframer/signals) into request-scoped context. - Outbound: every outgoing
requests/httpxcall automatically carries it to the next service (bothX-Journey-Idand W3Cbaggage, so it also rides existing OpenTelemetry propagation). Explicitly-set headers are never overwritten. - Traces: every Langfuse trace created during the request gets
metadata.journey_id(and ajourney:<id>tag) stamped automatically. Explicit metadata wins; the stamp is merge-if-absent.
Non-HTTP entry points (queue consumers, scheduled jobs): take the id from the payload yourself —
from dataframer_journey import with_journey, get_journey_id
with with_journey(payload["journey_id"]):
... # traces created here are stamped; outbound calls carry the id
Notes
- Langfuse SDK v2 is supported; v3 (OpenTelemetry-based) stamping is not implemented yet and logs a warning.
- The browser side is
@dataframer/signals, which generates the journey id and sends it on requests to your API. - CORS: if your frontend and API are on different origins, allow the
X-Journey-Id(orbaggage) request header in your API's CORS config. Same-site setups need nothing — the cookie carries it.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dataframer_journey-0.1.0.tar.gz.
File metadata
- Download URL: dataframer_journey-0.1.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72240757cd4d82ce396cde613792c48bddfe0666ed0c0191d1c1439f10b9d44b
|
|
| MD5 |
1fd91f266c9516a3d79a21c93040d9fe
|
|
| BLAKE2b-256 |
5c26dc6f03d4751fabbcf18566c941daa3ca43c1c51c6ea9aab932d03b05a540
|
Provenance
The following attestation bundles were made for dataframer_journey-0.1.0.tar.gz:
Publisher:
publish.yml on aimonlabs/dataframer-journey-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dataframer_journey-0.1.0.tar.gz -
Subject digest:
72240757cd4d82ce396cde613792c48bddfe0666ed0c0191d1c1439f10b9d44b - Sigstore transparency entry: 2072740381
- Sigstore integration time:
-
Permalink:
aimonlabs/dataframer-journey-py@a35d260bcd95499663a0f9d3e4aa7be446a40595 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/aimonlabs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a35d260bcd95499663a0f9d3e4aa7be446a40595 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dataframer_journey-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dataframer_journey-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66af52e5b569eea50e0d352521892391ec1326ea6fd98cd75b26cde74e353077
|
|
| MD5 |
820aac1d6ceeca3b740b4b61a7f161b9
|
|
| BLAKE2b-256 |
95c69575bbda7caefc75b1cac14be5f51bf8782c19eb1de5e851037f70ccabe3
|
Provenance
The following attestation bundles were made for dataframer_journey-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on aimonlabs/dataframer-journey-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dataframer_journey-0.1.0-py3-none-any.whl -
Subject digest:
66af52e5b569eea50e0d352521892391ec1326ea6fd98cd75b26cde74e353077 - Sigstore transparency entry: 2072740430
- Sigstore integration time:
-
Permalink:
aimonlabs/dataframer-journey-py@a35d260bcd95499663a0f9d3e4aa7be446a40595 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/aimonlabs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a35d260bcd95499663a0f9d3e4aa7be446a40595 -
Trigger Event:
push
-
Statement type: