Pinpoint Python Agent
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-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-service", # required
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.
- Web frameworks — flask_demo.py + flask_upstream.py (two services: distributed tracing over
requests, plus four MySQL clients), django_demo.py, fastapi_demo.py (every supported PostgreSQL client), starlette_demo.py, pyramid_demo.py, falcon_demo.py (WSGI and ASGI), tornado_demo.py, aiohttp_demo.py (withelasticsearch) - Framework-less apps — wsgi_demo.py, asgi_demo.py: wrapping an app in the Pinpoint middleware by hand
- Message queues — producer/consumer pairs for kafka, aiokafka, confluent_kafka, pika and aio_pika
- RPC — grpc: client and server, with context propagated across the call
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
- Pinpoint APM - Main Pinpoint project
- Pinpoint Documentation - Official documentation
- Pinpoint C++ Agent - The native core this agent embeds
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.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pinpoint_python_agent-1.0.1.tar.gz | 1.1 MB | Without provenance | Details |
Built distributions (wheels)
Total release size: 84.5 MB
Release files / pinpoint_python_agent-1.0.1.tar.gz
| Download URL | pinpoint_python_agent-1.0.1.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
94a5067638db4adc48dab920569c6fce737104747997a3f5e7b884e7dc21e866
|
|
BLAKE2b-256 checksum How to use checksums |
5fad5e4a4d92a4083dfdf0e756696640c043ec8b0ff9ae38b51a0c9f9081a0af
|
| 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.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pinpoint_python_agent-1.0.1-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 |
327db518b0ea939e746d63d55d06e74510edf5496cc02f13987514768cd102e5
|
|
BLAKE2b-256 checksum How to use checksums |
1f8ddc40741922b600b4ed039e2e95c9c8a0cf45e1fad8ac7a5032f06218a235
|
| 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.0.1-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | pinpoint_python_agent-1.0.1-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 |
7f383e81dd348d8a62cb059c33d0cefd1ce29d21fcddaac0f0817d8d30694485
|
|
BLAKE2b-256 checksum How to use checksums |
92bb4fcc4fce72bf58c2e315380f30561cf87168abd1527de3ad1b04e48b5410
|
| 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.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pinpoint_python_agent-1.0.1-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 |
a516818f52e2859357ccb2de8226ff6ff982bf58915348210dd42370f63c804b
|
|
BLAKE2b-256 checksum How to use checksums |
922115ce80df50705e90eacc6720a0166d2327e72aa83312957fa7dd65a30c5c
|
| 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.0.1-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | pinpoint_python_agent-1.0.1-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 |
b8216c19d864086071e8dabfee76f8703362836262ba5322e33831c466fe112a
|
|
BLAKE2b-256 checksum How to use checksums |
9136feeff1183c8430fb0e115d03d82c1cf3eef9aa6399f357fc988337ab5771
|
| 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.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pinpoint_python_agent-1.0.1-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 |
8c3d92cb220d3115c1ca2ec99fb12b4d9d8f31e4ef5653c839411b594e683dbd
|
|
BLAKE2b-256 checksum How to use checksums |
0e5d108ddf30cc1e26a42ee0dea6ec4131f1f9d859c3614b22bc66640ad3fd36
|
| 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.0.1-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | pinpoint_python_agent-1.0.1-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 |
b578456d49966fd7d58112dd77bfe1df4d2461920ca97f6c395874c77412e086
|
|
BLAKE2b-256 checksum How to use checksums |
9135d4be26c19916425cf4a9dfb7effab5386d9880933279abd0a8421beaaff9
|
| 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.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pinpoint_python_agent-1.0.1-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 |
27fe0b4a6f2896409e02058b6ca2ba3558e694a7d39b58d8e9a772acdb047c4a
|
|
BLAKE2b-256 checksum How to use checksums |
415da91a042449e157bc19f94b248683bb78dae2b58661ef8de22486a95ebb49
|
| 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.0.1-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | pinpoint_python_agent-1.0.1-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 |
233f0f2e3e57535a3359b85358c028185f2ad601c11369a96c15fdde65abe444
|
|
BLAKE2b-256 checksum How to use checksums |
d692464336b750501c224ddfad38929ad82c7e8dc905fffd19b4cfa8b82c4831
|
| 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.0.1
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.