spectator-py-runtime-metrics
Library to collect runtime metrics for Python applications using spectator-py.
See the Atlas Documentation site for more details on spectator-py.
Instrumenting Code
from spectator.registry import Registry
from runmetrics.stats_collector import StatsCollector
if __name__ == "__main__":
registry = Registry()
# optionally add a stable worker id tag to runtime metrics, for forked processes
StatsCollector(registry, worker_id=None).start()
Worker IDs
For long-running Python applications, it is common to use a forking process model to increase the
ability to handle load. Usually, these rely upon the pid to uniquely identify the workers, but
some of these frameworks offer either a stable worker id or the ability to create stable worker id
values through the addition of callbacks.
Ideally, the worker id is a string in the range 0..N, with N<16 in most cases. Most process
forking frameworks have a configuration setting for the maximum number of workers, which helps to
keep these values constrained.
Using raw str(os.getpid()) values as the worker id is not recommended, because it can lead to large
increases in metrics volume in the Atlas backend, if processes restart regularly over the lifetime of
an instance.
References
- Python
- Linux
Local Development
Install pyenv, possibly with Homebrew, and install a recent Python version.
make setup-venv
make test
make coverage
Metadata
Release files for netflix-spectator-py-runtime-metrics 1.0.4
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 | Actions |
|---|---|---|---|---|
| netflix_spectator_py_runtime_metrics-1.0.4.tar.gz | 9.2 kB | Without provenance | Details for netflix_spectator_py_runtime_metrics-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| netflix_spectator_py_runtime_metrics-1.0.4-py3-none-any.whl | Python 3 | none | any | Details for netflix_spectator_py_runtime_metrics-1.0.4-py3-none-any.whl |
Total release size: 17.8 kB
Release files / netflix_spectator_py_runtime_metrics-1.0.4.tar.gz
| Download URL | netflix_spectator_py_runtime_metrics-1.0.4.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c8eaf8457d100b8c7142a2d4f38b6fba5e12368b3f5f77259cf189f3324d733
|
|
BLAKE2b-256 checksum How to use checksums |
78b0587a8c680527ff033342828c1c1d5b9e97eb95fbcd17f71a60608fd674d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.5
|
Release files / netflix_spectator_py_runtime_metrics-1.0.4-py3-none-any.whl
| Download URL | netflix_spectator_py_runtime_metrics-1.0.4-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e36ec021ab5ded6398c28f3685ebdb7a795ea7473cb29ace075b63c3971aadb
|
|
BLAKE2b-256 checksum How to use checksums |
be30b8f5f3a8efcf9e99ee3ee1cb248fe727b46536735521c8e762b3e1e9c9e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.5
|
Security for netflix-spectator-py-runtime-metrics 1.0.4
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.