Skip to main content

Pinpoint Python Agent

License Python

The Python Agent for Pinpoint APM, an open-source Application Performance Management tool for large-scale distributed systems.

Pinpoint Python Agent enables you to monitor Python applications using Pinpoint. Name your application, start it through pinpoint-run, and 35 first-party integrations — web frameworks, HTTP clients, databases, caches, message queues — collect traces, analyze distributed call chains, and visualize service maps in the Pinpoint Web UI, with no changes to your code. The tracing hot path runs in the embedded pinpoint-cpp-agent.

Requirements

Requirement Version
Pinpoint Collector 3.1.0+
Python 3.11+ (CPython)
OS Linux, macOS (Windows is not supported)

Wheels bundle the native extension, so nothing is compiled at install time. An sdist install builds it and additionally needs CMake ≥ 3.21 and a C++17 compiler.

Installation

pip install pinpoint-python-agent

Building from Source

Clone the repository with its submodules (the C++ agent lives in a git submodule):

git clone --recurse-submodules https://github.com/pinpoint-apm/pinpoint-python-agent.git

Or, if you already cloned without the flag:

git submodule update --init --recursive third_party/pinpoint-cpp-agent

Then install from the checkout:

pip install .

See the Development Guide for building the extension in place, running the test suite, and the dev shell that resolves the native libraries.

Getting Started

Zero-code: pinpoint-run

The launcher starts the agent before any of your code runs and activates auto-instrumentation for every supported library your application imports:

pinpoint-run --app-name my-app --service-name my-service --agent-name my-service-web \
    --collector localhost -- python my_app.py

Or drive it from a YAML config file, optionally selecting one of its profiles:

pinpoint-run --config-file pinpoint-config.yaml --active-profile production -- python my_app.py

In-code: init() + autoload()

Call init() early in startup, then activate auto-instrumentation. Libraries already imported are instrumented immediately; everything else the moment it is imported.

import pinpoint
import pinpoint.autoload

pinpoint.init(
    application_name="my-app",       # required
    service_name="my-service",       # required for v4 (the default)
    agent_name="my-service-web",     # optional display label
    server_info="Flask",             # server metadata shown in the UI
    collector_host="localhost",
)
pinpoint.autoload.autoload()

import flask
app = flask.Flask(__name__)

Configuration comes from init() kwargs, PINPOINT_PY_* environment variables, or a YAML config file — see the Configuration Guide for every option and the precedence rules.

Manual tracing

For code paths no integration covers — cron jobs, queue consumers, in-house workers — open a span or a span event with the decorators:

import pinpoint

@pinpoint.span("nightly_billing", rpc_point="/cron/billing")   # a new transaction
def nightly_billing():
    charge(100)

@pinpoint.spanevent("billing.charge")                          # a child of the current span
def charge(amount):
    ...

Both work on async def too. Background hand-offs, context managers, annotations and header propagation are covered in the Custom Instrumentation Guide.

Examples

The examples/ directory holds one subdirectory per integration — the demo application plus a run.sh that starts its backing container and smoke-tests the stack. Each demo's module docstring carries its exact pinpoint-run command and a curl to hit it.

Documentation

Document Description
Getting Started Guide Step-by-step setup: install, configure, first traced request
Configuration Guide Every option, as an init() kwarg, environment variable and config-file key, with precedence rules
Auto-Instrumentation Catalog The 35 supported libraries, what each records, and how to turn one off
Custom Instrumentation Guide Python API reference: spans, span events, annotations, async hand-offs, distributed tracing
API Contracts Threading, end-exactly-once and overflow rules the agent enforces on spans, events and annotations
Pre-fork Integration Guide Running the agent under gunicorn, uWSGI and multiprocessing
Troubleshooting Startup verification, agent logs, common issues and solutions
Development Guide Contributors: building the native extension from source, running the tests, and adding a bundled integration

Contributing

We are looking forward to your contributions via pull requests.

To report bugs or request features, please create an Issue.

Community

License

Pinpoint Python Agent is licensed under the Apache License, Version 2.0. See LICENSE for full license text.

Metadata

Release files for pinpoint-python-agent 1.1.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 pinpoint-python-agent 1.1.0
File Size Uploaded Provenance
pinpoint_python_agent-1.1.0.tar.gz 1.1 MB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for pinpoint-python-agent 1.1.0
File
pinpoint_python_agent-1.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
pinpoint_python_agent-1.1.0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
pinpoint_python_agent-1.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
pinpoint_python_agent-1.1.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
pinpoint_python_agent-1.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
pinpoint_python_agent-1.1.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
pinpoint_python_agent-1.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
pinpoint_python_agent-1.1.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details

Total release size: 84.8 MB

Release files / pinpoint_python_agent-1.1.0.tar.gz

Download URL pinpoint_python_agent-1.1.0.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
e86f4fbe5f725a84a89eb3be2ece36e543c0b669cbf0955bdc9814c746db3cc1
BLAKE2b-256 checksum
How to use checksums
7772180bb6dbc409c497ef93a435efb49589f5e1116e85eda63df3a4cd3b72eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / pinpoint_python_agent-1.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pinpoint_python_agent-1.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 11.6 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
ad0a68b4ea78075428560818c89f8ad878b9483b1cebb4e3513bcedb1c807aee
BLAKE2b-256 checksum
How to use checksums
06b5f1574ffa37907a2b9d1ed276662f32dc98b851f555534ee27c25a35dc040
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / pinpoint_python_agent-1.1.0-cp314-cp314-macosx_11_0_arm64.whl

Download URL pinpoint_python_agent-1.1.0-cp314-cp314-macosx_11_0_arm64.whl
Size 9.3 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
671915adaf3a95f73d8e9aa36261f0bcc3ffec93708ea38e38dae4e3c9cbdd28
BLAKE2b-256 checksum
How to use checksums
ee55ac1aedf1e897c2726ad906b3d8bcd88451cb32260eb30122a44dddda3483
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / pinpoint_python_agent-1.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pinpoint_python_agent-1.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 11.6 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
4150549f3c76ab9901ffbab8584ccaac8411ae3384765bfc9226ace4bacbcb57
BLAKE2b-256 checksum
How to use checksums
63092cde164e560804ef266ca03e79ecd40fc9ca7fe4ac09a28234eddae32be0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / pinpoint_python_agent-1.1.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL pinpoint_python_agent-1.1.0-cp313-cp313-macosx_11_0_arm64.whl
Size 9.3 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
181d8be372b4280cd951463ec669378078ee9567cb91fa8ce1877f1d70f8fa68
BLAKE2b-256 checksum
How to use checksums
b5795c1afaffcb560eda4e1d8d2910c0d16d367abe7b782e7a3fbbeac185a20f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / pinpoint_python_agent-1.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pinpoint_python_agent-1.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 11.6 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
09aace4b9875993dab71c9138833eb97345d89e6f2c2546a15349320b1c910c3
BLAKE2b-256 checksum
How to use checksums
511b2b804d36d0178e6a43cbbd4365408876622ed4232b8125f624243aaf6c91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / pinpoint_python_agent-1.1.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL pinpoint_python_agent-1.1.0-cp312-cp312-macosx_11_0_arm64.whl
Size 9.3 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
27af04d742a7fd2609eb1f006204f700837d880b09c8f0ea5338100428ea00aa
BLAKE2b-256 checksum
How to use checksums
e2583cf748d2325bd0757ae828558b638487403ddd0d19c1d6aa865e43feb0cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / pinpoint_python_agent-1.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL pinpoint_python_agent-1.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 11.6 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
000fbc9eb0abd517fdd1ea4e711975c18338656a4b8dce57065f7ef1672e6d34
BLAKE2b-256 checksum
How to use checksums
015579299e302662c5cb8010d7815b3dc65de175dbea0e72ecaf32048e5c303f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / pinpoint_python_agent-1.1.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL pinpoint_python_agent-1.1.0-cp311-cp311-macosx_11_0_arm64.whl
Size 9.3 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3ebb70ac18a02dfafaa28c655c36174892c9c26787562824e7bbaba35a933367
BLAKE2b-256 checksum
How to use checksums
9dfcf0ed3fdc4a2565a2ffe136e22f5c400068833cb27bcce858b4e8fc546a15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for pinpoint-python-agent 1.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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