Unified telemetry library for the provide.io ecosystem — structured logging, distributed tracing, and metrics
Project description
Provide Telemetry
Unified telemetry library for structured logging, distributed tracing, and metrics across Python, TypeScript, Go, and Rust. Graceful OTel degradation — works without OpenTelemetry installed, activates full export when OTel SDK is present.
Install
Python:
pip install provide-telemetry # core (structlog)
pip install "provide-telemetry[otel]" # + OpenTelemetry export
TypeScript:
npm install @provide-io/telemetry # core (pino + @opentelemetry/api)
Rust:
cargo add provide-telemetry
cargo add provide-telemetry --features otel
Quick Start
Python:
from provide.telemetry import setup_telemetry, shutdown_telemetry, get_logger, event
setup_telemetry()
log = get_logger(__name__)
log.info("app.start.ok", request_id="req-1")
shutdown_telemetry()
TypeScript:
import { setupTelemetry, getLogger, shutdownTelemetry } from '@provide-io/telemetry';
setupTelemetry({ serviceName: 'my-app' });
const log = getLogger('api');
log.info({ event: 'app.start.ok', requestId: 'req-1' });
await shutdownTelemetry();
All implementations share the same API surface, event naming conventions, and configuration environment variables. The Rust crate lives in rust/ and uses guard-based context binding for task-safe restoration.
Configuration
All runtime config is via environment variables:
| Variable | Default | Description |
|---|---|---|
PROVIDE_TELEMETRY_SERVICE_NAME |
provide-service |
Service identity |
PROVIDE_LOG_LEVEL |
INFO |
Log level |
PROVIDE_LOG_FORMAT |
console |
Renderer: console, json, or pretty |
PROVIDE_TELEMETRY_ENV |
dev |
Deployment environment |
PROVIDE_TELEMETRY_VERSION |
0.0.0 |
Service version |
PROVIDE_TRACE_ENABLED |
true |
Enable OTel tracing |
PROVIDE_METRICS_ENABLED |
true |
Enable OTel metrics |
See the Configuration Reference for all 60+ environment variables.
Event Naming
Event names follow the DA(R)S pattern — Domain, Action, (Resource), Status — as 3 or 4 dot-separated lowercase segments. event() returns a structured Event (a str subclass with .domain, .action, .resource, and .status fields):
# Python
log.info("auth.login.success", user_id="u-123")
log.info(event("auth", "login", "failed"), reason="bad_password")
// TypeScript
log.info({ event: 'auth.login.success', userId: 'u-123' });
See Conventions for full naming rules.
API Surface
All implementations export equivalent APIs:
| Category | Functions |
|---|---|
| Lifecycle | setup_telemetry(), shutdown_telemetry() |
| Logging | get_logger(), bind_context(), clear_context() |
| Tracing | get_tracer(), trace (decorator/wrapper), extract_w3c_context() |
| Metrics | counter(), gauge(), histogram() |
| Policies | set_sampling_policy(), set_queue_policy(), set_exporter_policy() |
| Safety | register_cardinality_limit(), register_pii_rule(), replace_pii_rules(), get_pii_rules() |
| Health | get_health_snapshot() |
| Runtime | update_runtime_config(), reconfigure_telemetry(), reload_runtime_from_env() |
Full reference: Python API | TypeScript API | Go API | Rust crate
Polyglot Architecture
provide-telemetry/
src/provide/telemetry/ # Python package
typescript/ # TypeScript package (@provide-io/telemetry)
go/ # Go module (github.com/provide-io/provide-telemetry/go)
rust/ # Rust crate (provide-telemetry)
spec/ # Canonical API spec — all languages validate against it
e2e/ # Cross-language E2E tests (W3C trace propagation)
A shared spec/telemetry-api.yaml defines the required API surface. CI validates that Python, TypeScript, Go, and Rust exports conform to it. Cross-language distributed tracing is tested end-to-end via W3C traceparent propagation.
Quality
- 100% branch coverage (Python + TypeScript + Go; Rust crate verified with
cargo test) - 100% mutation kill score (mutmut + Stryker + gremlins)
- Strict type checking (mypy + ty + tsc)
- CodeQL SAST scanning
- SHA-pinned GitHub Actions
- Sigstore artifact signing
- CycloneDX SBOM on releases
Documentation
- Configuration Reference — all environment variables
- API Reference — Python function signatures and examples
- Architecture — component design and data flow
- Internals — implementation details
- Conventions — event naming and schema rules
- Operations Runbook — troubleshooting and CQ matrix
- Production Profiles — recommended configs
- Release Runbook — versioning and publishing
- TypeScript README — TypeScript-specific docs
- Go README — Go-specific docs
- Rust crate — Rust-specific source and examples
- Examples — runnable examples for the polyglot repo
License
Apache-2.0. See LICENSES/.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file provide_telemetry-0.2.6.tar.gz.
File metadata
- Download URL: provide_telemetry-0.2.6.tar.gz
- Upload date:
- Size: 56.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddc12116cbefd4d0069300a0c11639253689fecdbe190dcc0a9d87d61133bf4c
|
|
| MD5 |
e8bee4eee393e0f731b470938744441e
|
|
| BLAKE2b-256 |
4b1d97000a51acc3db3f5c62799c4254d0b1ce952704da9753c7fcee6880a1f7
|
Provenance
The following attestation bundles were made for provide_telemetry-0.2.6.tar.gz:
Publisher:
release.yml on provide-io/provide-telemetry
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
provide_telemetry-0.2.6.tar.gz -
Subject digest:
ddc12116cbefd4d0069300a0c11639253689fecdbe190dcc0a9d87d61133bf4c - Sigstore transparency entry: 1273738078
- Sigstore integration time:
-
Permalink:
provide-io/provide-telemetry@5b99eec3f25b74e5e61086ca20b6f8a427b80682 -
Branch / Tag:
refs/tags/v0.2.6 - Owner: https://github.com/provide-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5b99eec3f25b74e5e61086ca20b6f8a427b80682 -
Trigger Event:
release
-
Statement type:
File details
Details for the file provide_telemetry-0.2.6-py3-none-any.whl.
File metadata
- Download URL: provide_telemetry-0.2.6-py3-none-any.whl
- Upload date:
- Size: 68.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95936fb666c97c21472373565a0ded33d669eeade5b87ceeebb87d651daca754
|
|
| MD5 |
1396643c08932aa76af6c3dca75b4487
|
|
| BLAKE2b-256 |
595ea953a78e6e0bb36cf2a677d3226d8274e4e2865a69324d97a1bf28d0500e
|
Provenance
The following attestation bundles were made for provide_telemetry-0.2.6-py3-none-any.whl:
Publisher:
release.yml on provide-io/provide-telemetry
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
provide_telemetry-0.2.6-py3-none-any.whl -
Subject digest:
95936fb666c97c21472373565a0ded33d669eeade5b87ceeebb87d651daca754 - Sigstore transparency entry: 1273738121
- Sigstore integration time:
-
Permalink:
provide-io/provide-telemetry@5b99eec3f25b74e5e61086ca20b6f8a427b80682 -
Branch / Tag:
refs/tags/v0.2.6 - Owner: https://github.com/provide-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5b99eec3f25b74e5e61086ca20b6f8a427b80682 -
Trigger Event:
release
-
Statement type: