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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d00d0dbdd79bb18438f880acaae5492a8b98dc245ee708663676f51f4f497706
|
|
| MD5 |
96baa369787aa6151ffe7c9ac7ab3bac
|
|
| BLAKE2b-256 |
049a7f608d29c1ff0e287749672ef9ff3429c305ba69de469ec2347063c1f160
|
Provenance
The following attestation bundles were made for faro_sdk-0.1.0.tar.gz:
Publisher:
publish-sdks.yml on IA-Portafolio/faro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
faro_sdk-0.1.0.tar.gz -
Subject digest:
d00d0dbdd79bb18438f880acaae5492a8b98dc245ee708663676f51f4f497706 - Sigstore transparency entry: 1615998265
- Sigstore integration time:
-
Permalink:
IA-Portafolio/faro@22cf6c85c077e65d5015b953bbb07c36f30702e4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/IA-Portafolio
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdks.yml@22cf6c85c077e65d5015b953bbb07c36f30702e4 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d13790dc554072ca6c3ff989aac36f04457b4f67805a1c39e4d6e99f88bf7e7
|
|
| MD5 |
8d496bce8ca93dcec299cc02b0e3dada
|
|
| BLAKE2b-256 |
9587577a8a494053f32aa0cc363f13db35bc6d4415ec22b46c16c726014d54b6
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
faro_sdk-0.1.0-py3-none-any.whl -
Subject digest:
3d13790dc554072ca6c3ff989aac36f04457b4f67805a1c39e4d6e99f88bf7e7 - Sigstore transparency entry: 1615998302
- Sigstore integration time:
-
Permalink:
IA-Portafolio/faro@22cf6c85c077e65d5015b953bbb07c36f30702e4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/IA-Portafolio
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdks.yml@22cf6c85c077e65d5015b953bbb07c36f30702e4 -
Trigger Event:
workflow_dispatch
-
Statement type: