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.4.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 obskitpy 0.4.0
File Size Uploaded Provenance Actions
obskitpy-0.4.0.tar.gz 101.5 kB With provenance Details for obskitpy-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 198.0 kB

Release files / obskitpy-0.4.0.tar.gz

Download URL obskitpy-0.4.0.tar.gz
Size 101.5 kB
Tags Source
SHA-256 checksum
How to use checksums
64f710199a58704a9f73896c03b2d6b6550746e921186ffdd617d45f656060c2
BLAKE2b-256 checksum
How to use checksums
cc971ab276b18345aa8d7fa8715a4bc375e5de7ef1f6021ee6c1ee0ddf43e93a
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.4.0-py3-none-any.whl

Download URL obskitpy-0.4.0-py3-none-any.whl
Size 96.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b21551e0f10c15c8cf775621e28a2e05536ef79d540b45acc881475342348853
BLAKE2b-256 checksum
How to use checksums
05b67495f29027e392492dd02f2f8bd28ec3faf6060842ba6f4b9976861fe64f
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.4.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.

Full provenance

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

Select from 2 files

Attestation for obskitpy-0.4.0.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