elenjical-sdk
Error tracking and logs for Python services (Django, Flask, FastAPI, Celery, scripts), reported to Elenjical.
Install
pip install "elenjical-sdk[flask]" # or [django], [fastapi], [celery], [sqlalchemy], or none
Set up
Set ELENJICAL_DSN (your service's DSN from Elenjical, Settings > Services) and, optionally,
ELENJICAL_ENVIRONMENT and ELENJICAL_RELEASE. Then, before the application starts:
import logging
import elenjical
from elenjical.integrations.flask import FlaskIntegration
from elenjical.integrations.logging import LoggingIntegration, ignore_logger
elenjical.init(
integrations=[
FlaskIntegration(),
LoggingIntegration(level=logging.INFO, event_level=logging.ERROR, logs_level=logging.INFO),
],
)
ignore_logger("gunicorn.access")
Arguments you pass take precedence over the environment. Report handled errors with
elenjical.capture_exception(error), identify people with elenjical.set_user({"id": ..., "email": ...}), write
logs with elenjical.logger.info("...").
| Variable | Meaning |
|---|---|
ELENJICAL_DSN |
where to report; unset turns reporting off |
ELENJICAL_ENVIRONMENT |
development, uat, production, ... |
ELENJICAL_RELEASE |
the deployed version, e.g. api@<git sha> |
ELENJICAL_TRACES_SAMPLE_RATE |
tracing sample rate (default 0) |
ELENJICAL_DEBUG |
true logs what the SDK does |
If browsers call this service, allow elenjical.TRACE_HEADERS in CORS (Flask-CORS:
allow_headers=["Content-Type", "Authorization", *elenjical.TRACE_HEADERS]) so their sessions link to your
errors.
See NOTICE for the open-source software this package is built on.
Metadata
Release files for elenjical-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)
| File | Size | Uploaded | |
|---|---|---|---|
| elenjical_sdk-0.1.0.tar.gz | 9.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| elenjical_sdk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.2 kB
Release files / elenjical_sdk-0.1.0.tar.gz
| Download URL | elenjical_sdk-0.1.0.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec80d79736d64026513d5133fd234c24d5a4300b9ef8b07765f38b5e8288f035
|
|
BLAKE2b-256 checksum How to use checksums |
66fdd7a35411566f8323210ce47b0fe5d86b023e83123b63c8a3fc418a5f55b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / elenjical_sdk-0.1.0-py3-none-any.whl
| Download URL | elenjical_sdk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
153efc8f9f01334a50988989d27e1701837e82c4d75fe293b36db33ef654332c
|
|
BLAKE2b-256 checksum How to use checksums |
5eb51bddf5394f0bf65e14e9161077c0384a97bfd2cbc8df62c99bef8a36291e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|