Skip to main content

Faro SDK for Python — send logs and captured exceptions to a Faro instance.

Project description

faro-sdk (Python)

pip install faro-sdk
import faro_sdk as faro

faro.init(
    endpoint="https://faro.iaportafolio.com",
    token="...",                       # visible en /projects → SDK
    service="ingesta-csv",
    environment="production",
    release="git-sha-abc123",
    attributes={"region": "eu-west-1"},
)

faro.info("arranque ok", port=8080)

try:
    procesar(archivo)
except Exception as exc:
    faro.capture_exception(exc, tags={"archivo": archivo.name})
    raise

Integración con logging

import logging
from faro_sdk import FaroHandler

logging.basicConfig(level=logging.INFO)
logging.getLogger().addHandler(FaroHandler())

logging.info("auto-enviado a Faro")
try:
    raise ValueError("boom")
except Exception:
    logging.exception("falló el job")   # incluye stack trace

Captura automática

init() instala sys.excepthook y threading.excepthook (Python 3.8+). Cualquier excepción no manejada se envía a Faro antes de imprimirla en stderr.

Para desactivar: faro.init(..., install_global_handlers=False).

Flush / cierre

faro.flush(timeout=3.0)
# o, al cerrar la app:
faro.close()

atexit ya registra un cierre limpio al terminar el proceso, pero para scripts cortos llama explícitamente para no perder eventos.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

faro_sdk-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

faro_sdk-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file faro_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: faro_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for faro_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d00d0dbdd79bb18438f880acaae5492a8b98dc245ee708663676f51f4f497706
MD5 96baa369787aa6151ffe7c9ac7ab3bac
BLAKE2b-256 049a7f608d29c1ff0e287749672ef9ff3429c305ba69de469ec2347063c1f160

See more details on using hashes here.

Provenance

The following attestation bundles were made for faro_sdk-0.1.0.tar.gz:

Publisher: publish-sdks.yml on IA-Portafolio/faro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file faro_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: faro_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for faro_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d13790dc554072ca6c3ff989aac36f04457b4f67805a1c39e4d6e99f88bf7e7
MD5 8d496bce8ca93dcec299cc02b0e3dada
BLAKE2b-256 9587577a8a494053f32aa0cc363f13db35bc6d4415ec22b46c16c726014d54b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for faro_sdk-0.1.0-py3-none-any.whl:

Publisher: publish-sdks.yml on IA-Portafolio/faro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page