Skip to main content

obskitpy

obskitpy

Observabilidade (OpenTelemetry → Elasticsearch → Kibana) em qualquer projeto Python, via CLI.

Documentação completa na raiz do repositório: docs/. Este arquivo é um resumo.

Começar (2 comandos)

uv add "obskitpy[requests]"      # ou pip install; o extra 'requests' adiciona spans HTTP automáticos
cd meu-projeto
obskitpy init                   # cria observability/ (stack + dashboard base); --service NOME opcional
obskitpy up                     # sobe ES + Kibana + Collector e cria o dashboard

No código:

import logging, obskitpy

log = logging.getLogger(__name__)
shutdown = obskitpy.setup("meu-servico")     # logs + traces + métricas via OTLP (localhost:4317)

@obskitpy.traced()                            # um span por chamada, marca erro se a exceção propagar
def processar(item): ...

try:
    processar(x)
except Exception:
    log.exception("falhou")                 # já sai com error.type, error.origin e error.chain

shutdown()                                  # descarrega os dados pendentes

Métricas próprias: obskitpy.meter().create_counter("pedidos.processados") (API do OpenTelemetry).

Comandos

Comando O que faz
obskitpy init [--service N] [--kibana-port P ...] cria observability/ (compose, collector, dashboard.ndjson, .env)
obskitpy up sobe a stack, espera ficar saudável e aplica o dashboard
obskitpy down [-v] derruba (-v apaga os dados)
obskitpy status / obskitpy open containers + link / abre o dashboard
obskitpy dashboard export grava no arquivo o dashboard como está no Kibana
obskitpy dashboard apply importa observability/dashboard.ndjson no Kibana

Todos aceitam --dir (padrão observability).

Evoluindo o dashboard

  1. obskitpy up já cria o dashboard <servico>-observability com os painéis básicos: logs, erros, execuções (traces), duração de spans, erros por tipo/origem e lista de erros com trace_id.
  2. Edite no Kibana (adicione painéis, métricas do seu domínio, filtros).
  3. obskitpy dashboard export e versione observability/dashboard.ndjson no git.
  4. Em outra máquina/CI: obskitpy up (ou obskitpy dashboard apply) recria tudo.

Os painéis filtram por resource.attributes.service.name, então vários serviços podem compartilhar uma stack (use o mesmo --dir/portas) ou ter uma cada (use portas diferentes no init).

Observações

  • Ambiente local: segurança do Elasticsearch desligada, portas só em 127.0.0.1.
  • Os dados demoram alguns segundos para ficar pesquisáveis após o primeiro envio.
  • Colima/Docker: o docker compose precisa enxergar a pasta do projeto (no Colima, só $HOME é montado por padrão).
  • Requer Docker com o plugin Compose v2.

Metadata

Release files for obskitpy 0.2.1

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

Source distribution (sdist)

Source distribution for obskitpy 0.2.1
File Size Uploaded Provenance Actions
obskitpy-0.2.1.tar.gz 90.8 kB With provenance Details for obskitpy-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for obskitpy 0.2.1
File Interpreter ABI Platform Actions
obskitpy-0.2.1-py3-none-any.whl Python 3 none any Details for obskitpy-0.2.1-py3-none-any.whl

Total release size: 180.0 kB

Release files / obskitpy-0.2.1.tar.gz

Download URL obskitpy-0.2.1.tar.gz
Size 90.8 kB
Tags Source
SHA-256 checksum
How to use checksums
85b01bb0b2470b37fcd210184652f9881fe2e2915e7903f025bfdf829da7ed36
BLAKE2b-256 checksum
How to use checksums
3ef08ade57b45134113425c6d8268785d9b7ada115db4af3a3bf3d70cbcf7ee7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / obskitpy-0.2.1-py3-none-any.whl

Download URL obskitpy-0.2.1-py3-none-any.whl
Size 89.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2e6aff628fc916926ad7c411164ba44b3d65ceaba35ae06dfc428e48dbd83a9
BLAKE2b-256 checksum
How to use checksums
e9aafc597138fecd7a9972cf642bb4754fab2d1cb3d649d5a1615ee2e868edae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for obskitpy 0.2.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for obskitpy-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

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.

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