Skip to main content

boolean-otel-sdk (Python)

Bootstrap estandar de OpenTelemetry para apps Python de Boolean. Reemplaza el config/otel.py + filtro de logging que antes se copiaba en cada repo (patron original: juzgado.back).

Contrato:

  • No-op total si falta OTEL_EXPORTER_OTLP_ENDPOINT o OTEL_SDK_DISABLED=true (dev local y tests no cambian).
  • Defaults de plataforma (http/protobuf, OTEL_LOGS_EXPORTER=none, correlacion de logs). Las variables ya definidas ganan: el gestor inyecta OTEL_SERVICE_NAME, OTEL_RESOURCE_ATTRIBUTES y OTEL_EXPORTER_OTLP_ENDPOINT en ambients production.
  • Un error al inicializar se loguea y la app arranca igual, sin telemetria.
  • Idempotente por proceso; se re-inicializa tras un fork.

Instalacion

boolean-otel-sdk[django,celery,psycopg2,redis,requests]==0.1.0

Extras: django, celery, psycopg2, psycopg, redis, requests (incluye urllib3), fastapi. Las instrumentaciones salen de los extras: el build del gestor no corre opentelemetry-bootstrap, asi que lo que no este instalado no se instrumenta. Las versiones de opentelemetry-* estan fijadas por el SDK; no las listes aparte.

Django + Celery

# config/wsgi.py  (antes de get_wsgi_application)
from boolean_otel_sdk import init
init("mi-servicio")          # default si nadie definio OTEL_SERVICE_NAME

# config/celery.py
from boolean_otel_sdk.celery import init_celery_worker
init_celery_worker("mi-servicio")   # inicializa en cada proceso worker (post-fork)

Logging (correlacion trace_id= que Loki linkea a Tempo):

from boolean_otel_sdk import TRACE_LOG_FORMAT_BRACES

LOGGING = {
    "filters": {"otel_trace_context": {"()": "boolean_otel_sdk.OtelTraceContextFilter"}},
    "formatters": {"detailed": {
        "format": "{levelname} {asctime} {module} " + TRACE_LOG_FORMAT_BRACES + " {message}",
        "style": "{",
    }},
    # en cada handler: "filters": ["otel_trace_context"]
}

Desarrollo

pip install -e ".[django,celery,dev]" && pytest
python -m build

Metadata

Release files for boolean-otel-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for boolean-otel-sdk 0.1.0
File Size Uploaded Provenance Actions
boolean_otel_sdk-0.1.0.tar.gz 7.1 kB Without provenance Details for boolean_otel_sdk-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for boolean-otel-sdk 0.1.0
File Interpreter ABI Platform Actions
boolean_otel_sdk-0.1.0-py3-none-any.whl Python 3 none any Details for boolean_otel_sdk-0.1.0-py3-none-any.whl

Total release size: 13.9 kB

Release files / boolean_otel_sdk-0.1.0.tar.gz

Download URL boolean_otel_sdk-0.1.0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
32e3e6fb891df5cd2e794ecd5163c6b689e96c2360fd903729b39abbc39d5215
BLAKE2b-256 checksum
How to use checksums
2a9162436fd2135cb764ac2e1a41c4442e12d2556a2c1c401a6f2723060b4835
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / boolean_otel_sdk-0.1.0-py3-none-any.whl

Download URL boolean_otel_sdk-0.1.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b11a2214fb4b8d7d717753d77ded43623e0ed2f8f2fc2b3c8b943a5a855adaac
BLAKE2b-256 checksum
How to use checksums
7326228911d16e45d172cf63a5f803aa9320501cde062bfd45318a8d4a7c0af1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for boolean-otel-sdk 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page