Lightweight OpenTelemetry collector
Project description
pyrotel
Python package for the Rotel lightweight OpenTelemetry collector.
Description
This package provides an embedded OpenTelemetry collector, built on the lightweight Rotel collector. When invoked, it spawns a background daemon that accepts OpenTelemetry metrics, traces, and logs. Designed for minimal overhead, Rotel reduces resource consumption while simplifying telemetry collection and processing in complex Python applications—without requiring additional sidecar containers.
By default, the Rotel agent listens for OpenTelemetry (OTel) data over gRPC (port 4317) and HTTP (port 4318) on localhost. It efficiently batches telemetry signals and forwards them to a configurable OTLP endpoint. Future updates will introduce support for additional filtering, transformations, and endpoints.
Usage
Add the rotel Python package to your project's dependencies.
Create the following __rotel__.py file and place it at the top of your project directory.
from rotel import Rotel, OTLPExporter
rotel = Rotel(
exporter = OTLPExporter(
endpoint="{ROTEL_ENDPOINT}",
),
)
In your main.py, add the following to load the Rotel agent:
import rotel
rotel.start()
In your deployment configuration, add the following environment variables to configure Rotel:
ROTEL_ENABLED=true(Rotel will only be started if this is set, allowing you to disable it in dev environments)ROTEL_ENDPOINT=https://foo.example.com(match to your provider's API endpoint)
To configure the OpenTelemetry SDK, point the exporter configuration to the localhost Rotel agent. Adjust these depending on whether you are using the grpc or http exporter in your code.
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317OTEL_EXPORTER_OTLP_PROTOCOL=grpc
See the configuration documentation for more configuration options.
Development
Install the latest version of the hatch build tool. We'll use this to manage the environments, run tests and perform builds.
Managing Python versions
Hatch will default to the system's Python version.
If you want to install additional Python versions, you can use hatch to manage those.
The following will install Python 3.9:
hatch python install 3.9
Then you can run tests against version 3.9 with:
hatch run test.py39:pytest
Wheel builds
To build locally using an existing Rotel agent binary, run:
hatch run build:me ../path/to/agent/file
You can always download the latest rotel agent binary from Github. Make sure to create a Github Personal Access Token (PAT) that allows you to pull Github release artifacts. Set that as GITHUB_API_TOKEN for the commands below.
To build using the latest Github built binary:
GITHUB_API_TOKEN=1234 hatch run build:me
Finally, to build for all supported platforms:
GITHUB_API_TOKEN=1234 hatch run build:all
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
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 rotel-0.0.1a2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.
File metadata
- Download URL: rotel-0.0.1a2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
- Upload date:
- Size: 3.8 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
191223ff8db54b22e6236e5bc51b15eee5e156b514312b523933a4c1a616a340
|
|
| MD5 |
fe172ec3154ed5735604ae4de7b02afe
|
|
| BLAKE2b-256 |
c5130dc4d60ce507015e8f57ed4ee9e7052ff02863a1030edef251459762be36
|
Provenance
The following attestation bundles were made for rotel-0.0.1a2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:
Publisher:
build-release.yml on streamfold/pyrotel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rotel-0.0.1a2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl -
Subject digest:
191223ff8db54b22e6236e5bc51b15eee5e156b514312b523933a4c1a616a340 - Sigstore transparency entry: 176420307
- Sigstore integration time:
-
Permalink:
streamfold/pyrotel@9a4d5dee602bc00994215772c55ad8e7e231d4e8 -
Branch / Tag:
refs/tags/v0.0.1a2 - Owner: https://github.com/streamfold
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-release.yml@9a4d5dee602bc00994215772c55ad8e7e231d4e8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rotel-0.0.1a2-py3-none-macosx_10_9_universal2.macosx_12_3_arm64.whl.
File metadata
- Download URL: rotel-0.0.1a2-py3-none-macosx_10_9_universal2.macosx_12_3_arm64.whl
- Upload date:
- Size: 3.5 MB
- Tags: Python 3, macOS 10.9+ universal2 (ARM64, x86-64), macOS 12.3+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e58b5d2bae7722d9f7bf7f76f9387811423220cc41aba42e0b2618bda4aaa1d8
|
|
| MD5 |
dc6b9849bea7fe504cfc5f8a27bcbb05
|
|
| BLAKE2b-256 |
aa0b6563330184164a5b5af6611d046e7b22c679a535c4de4365c77308fd948d
|
Provenance
The following attestation bundles were made for rotel-0.0.1a2-py3-none-macosx_10_9_universal2.macosx_12_3_arm64.whl:
Publisher:
build-release.yml on streamfold/pyrotel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rotel-0.0.1a2-py3-none-macosx_10_9_universal2.macosx_12_3_arm64.whl -
Subject digest:
e58b5d2bae7722d9f7bf7f76f9387811423220cc41aba42e0b2618bda4aaa1d8 - Sigstore transparency entry: 176420308
- Sigstore integration time:
-
Permalink:
streamfold/pyrotel@9a4d5dee602bc00994215772c55ad8e7e231d4e8 -
Branch / Tag:
refs/tags/v0.0.1a2 - Owner: https://github.com/streamfold
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-release.yml@9a4d5dee602bc00994215772c55ad8e7e231d4e8 -
Trigger Event:
push
-
Statement type: