semvec/pypi-packages huggingface dataset:
otlp-proto 0.10.1
🐍Lightweight OTEL span to binary converter, written in Rust🦀
License: MIT
Requires Python: >=3.10

# otlp-proto

`otlp-proto` is a lightweight OTLP serialisation library.

It's written in Rust 🦀, and doesn't have any run-time dependencies.

It serialises a bunch of spans into OTLP 1.5 binary (protobuf) format.

# ⚠️ Looking for maintainer! ⚠️

I don't have time to work on this project.

It's in a usable state now, but will lag behind features introduced in OpenTelemetry.

Please get in touch (e.g. open an issue) if you're interested!

### Motivation

Tracing should be on by default.

OTLP is the standard data format and API, and the standard Python package is `opentelemetry-exporter-otlp-proto-http`. It brings in a total of 18 packages and adds 9MB to the project virtual environment.

A typical Python application, that's being instrumented, only generates own tracing data and needs to send it out. It doesn't need that much complexity.


### Usage

```py
from otlp_proto import CONTENT_TYPE, encode_spans


class SomeExporter:
    def export(self, spans: Sequece[ReadableSpan]) -> None:
        requests.post(
            "http://localhost:4318/v1/traces",
            data=encode_spans(spans),
            headers={"Content-Type": CONTENT_TYPE},
        )
```

### Library size

- 170KB whl, containing, depending on the target platform
  - 350KB dylib
  - ???KB so

### TODO(doc)

- link to pure Python library
- link to urllib sender
- link to test vector generator

### TODO(features)

- Events
- Links
- Baggage
- Schemata, when https://github.com/open-telemetry/opentelemetry-python/pull/4359 lands

### TODO(fixes)

- validate what fields are in fact optional
- ???

### Limitations

This library is meant to marshal tracing data that's collected in the same Python process.

It is not meant to be used for data receive and forwarded.