For the complete documentation index, see llms.txt. This page is also available as Markdown.

Python

When developers use your Python package, it signals real product usage. With Reo, you can identify and monitor usage of your PyPI packages.

Python tracking is not automatic on install. You add a single function call to your package, and it fires whenever you choose: at import, at startup, or on a key product event.


How it works

  1. A developer installs and runs your package

  2. Your code calls log_event() at the point you chose

  3. The event is sent to your telemetry endpoint, a hostname on your own domain such as packages.<your_domain>.com

  4. That hostname points to Reo's telemetry endpoint through a CNAME record, so the event arrives at Reo

  5. Reo processes it and surfaces it as a developer activity signal in your dashboard


Step 1: Send your PyPI package URL to Reo

Share your package link with the Reo team so we can configure tracking on our side:

https://pypi.org/project/your-package

Step 2: Create the product usage metric

  • From the left navigation menu, click on Settings > select Configurations

  • Spot the Product usage metrics card and click Configure

  • Click Create New

  • Name the metric pypi_download

  • Choose the Mode as Single

  • Additionally, you can also add meta parameters

Meta parameters help you capture additional data for the corresponding metric.

  • Against the 'Meta parameters' for your metric click Add new > provide a name for the parameter and choose the Data type

  • Once you've configured the meta parameters and metric, click Save


Step 3: Point your telemetry domain at Reo

Telemetry is sent to a hostname on your own domain. Add a CNAME record pointing it at Reo's telemetry endpoint:

DNS record type
Host / Name
Value (points to)

CNAME

packages.<your_domain>.com

telemetry.reo.dev

Wait for the record to propagate before moving on.


Step 4: Install the SDK


Step 5: Add it to your dependencies

Add reo-census to your package's dependency file (requirements.txt, pyproject.toml, or Pipfile) so it installs alongside your package.


Step 6: Initialise the logger

Point endpoint_url at the hostname you set up in Step 3, including the /data path:

Alternatively, set it at runtime with no code change:

Step 7: Call log_event() where usage happens

Put the call wherever it reflects real usage: application startup, CLI execution, package initialisation, or a meaningful product event.


Step 8: Verify

Run your package, then open your Reo dashboard and check the pypi_download metric. You should see:

  • The package name and version in use

  • Event timestamp and caller IP, recorded by Reo on arrival

  • Any custom properties you chose to send


Optional configuration

Sending directly to Reo instead of your own domain

If you skip Step 3, leave endpoint_url unset and the SDK falls back to Reo's endpoint:

Events are recorded the same way. You lose only the benefit of telemetry travelling under your own brand and domain.

Adjusting the timeout

timeout controls the per-request socket timeout in seconds, and defaults to 3.0. Keep it low so telemetry never holds up your users.

Defaults

Option
Default

endpoint_url

https://telemetry.reo.dev/data

timeout

3.0 seconds

Blocking mode

Non-blocking (the request runs in a background thread)


How your users opt out

Once you add log_event(), tracking is on by default. Your users can disable it by setting a single environment variable:

Variable
Values
Effect

DO_NOT_TRACK

1, true, or yes (case-insensitive)

Disables all event sending

Document this variable in your project README so your users know how to opt out.

Last updated

Was this helpful?