pamoja-telemetry
Observability that ships only what is worth the bytes as link cost rises, while counting everything. One capability of pamoja, one memory-safe Rust core with bindings for TypeScript, Python, and C#.
Install
pip install pamoja-telemetry
from pamoja import telemetry
This pulls in pamoja-native, the compiled engine. pip install pamoja is the whole framework in one package.
Example
The script the test suite runs, spliced here as it ran.
From bindings/python/guides/telemetry.py:
from pamoja.telemetry import Event, Level, LinkCost, Reporter, link_cost_threshold
# The node is willing to record everything, then finds out it is reporting over a metered
# link, which puts the bar at INFO.
reporter = Reporter(Level.TRACE)
reporter.adapt_to(LinkCost.METERED)
print(f"on a metered link, nothing below {reporter.threshold.value} is sent")
# Routine detail stops going out. A reading and the warning that follows it still do, and
# a shipped event comes back with the measurement that triggered it.
tick = reporter.record(Event(Level.DEBUG, "loop.tick"))
reading = reporter.record(Event(Level.INFO, "reading.ok", 4.8))
print(f"loop.tick sent: {tick is not None}")
print(f"reading.ok sent: {reading is not None}")
warned = reporter.record(Event(Level.WARN, "battery.low", 0.18))
print(f"sent {warned.code} carrying {warned.value}")
# The node falls back to satellite, which raises the bar to WARN. The same reading is no
# longer worth its bytes; a failure still is.
reporter.adapt_to(LinkCost.EXPENSIVE)
dearer = reporter.record(Event(Level.INFO, "reading.ok", 4.9))
lost = reporter.record(Event(Level.ERROR, "link.lost"))
print(f"on satellite, reading.ok sent: {dearer is not None}")
print(f"on satellite, link.lost sent: {lost is not None}")
# Only the stream was thinned, not the counts, so every event is still accounted for and
# the snapshot is what the node ships in place of them.
counts = reporter.snapshot()
print(f"of {reporter.total} events, {counts.emitted} went out and {counts.dropped} were counted only")
The same capability in every language
| Language | Package | Reference |
|---|---|---|
| Rust | pamoja-telemetry |
reference, docs.rs, install |
| TypeScript | @pamoja/telemetry |
reference, install |
| Python | pamoja-telemetry |
reference, install |
| C# | Pamoja.Telemetry |
reference, install |
Documentation
pamoja.telemetryreference, every class and function in this module.- The Telemetry guide, with the same example in Rust, TypeScript, and C#.
- Every capability, and the install page.
License
MIT
Release files for pamoja-telemetry 0.1.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pamoja_telemetry-0.1.18.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pamoja_telemetry-0.1.18-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.2 kB
Release files / pamoja_telemetry-0.1.18.tar.gz
| Download URL | pamoja_telemetry-0.1.18.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b123814f5da8e7562457d46a33630597652ed52c8abe0af13a8e08c6d12a1f24
|
|
BLAKE2b-256 checksum How to use checksums |
8503b0e5ba10ccbc00fba617dfca35dcd5aac0c6d5a7a8e8514991fc5db900ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Release files / pamoja_telemetry-0.1.18-py3-none-any.whl
| Download URL | pamoja_telemetry-0.1.18-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
707ca794b8545a37acf0330b920243abe9e5d4b6da3e7b7a758b867bcec68ef7
|
|
BLAKE2b-256 checksum How to use checksums |
b7f9f237e7c6927edc4d3f6ccdc721d0f4362e628cff30131d7bbddcf9f4e71b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|