Repository navigation
Conversation
cronitor/ingest.py builds Sentry-format envelopes and sends them to
{ingest_url}/api/envelope from one daemon thread with a bounded queue.
Events go out one envelope each; log records batch to 100 or 5 seconds.
Bodies are gzipped, sends time out after 5 seconds with one retry, a 429
pauses sending for Retry-After (capped at 60 seconds), and failures are
logged, never raised. The worker starts lazily, restarts after fork, and
queued items are flushed at exit with a 2 second cap.
cronitor.ingest_url (env CRONITOR_INGEST_URL, default https://cronitor.link)
now also sets the ping URL base, so a dev stack can receive everything.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
cronitor/capture.py builds exception and message events and structured
log records. Exceptions follow __cause__ then __context__, oldest first,
with frames oldest first, five lines of source context from linecache,
and in_app false for site-packages, dist-packages and the stdlib. Local
variables are never sent. Values, messages and log bodies are truncated
to 4000/4000/8000 characters and tags and attributes to 50 entries.
cronitor.logger mirrors sentry_sdk.logger: the body is formatted with
str.format when attributes and braces are present, and the template and
parameters are recorded as sentry.message.* attributes. It replaces the
stdlib logger that was exported under that name; its configuration
methods still delegate to logging.getLogger('cronitor').
Monitor.capture_exception and Monitor.capture_message bind the monitor
key, environment and API key. New settings: cronitor.release (env
CRONITOR_RELEASE) and cronitor.capture_exceptions.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
The decorator binds the monitor key, series and environment in a context variable while the function runs, so capture_exception, capture_message and cronitor.logger calls inside it are tagged with cronitor.monitor and cronitor.series. When the function raises, the decorator sends the fail ping as before and then an exception event bound to the same series, with mechanism cronitor.job and handled false. Set cronitor.capture_exceptions = False to send only the ping. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
LogHandler ships logging records as structured log items through the same batching transport. Levels map DEBUG->debug, INFO->info, WARNING->warn, ERROR->error, CRITICAL->fatal, and anything below DEBUG to trace. Records carry logger.name, code.file.path, code.line.number and code.function.name, the %-style template and its arguments, and the cronitor.monitor/cronitor.series binding inside a job. A record with exc_info gets its formatted traceback in exception.stacktrace; no second event is sent. Records from the transport itself are ignored so a failing send cannot feed itself. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
Covers the requests session, gzip body and headers on the wire, a real 429 with Retry-After, and a ping routed through the same ingest_url. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
Adds an "Exceptions and Logs" README section: configuration, capture_exception, capture_message, cronitor.logger, LogHandler, flush, the @job behavior, and the Sentry SDK DSN alternative. Documents CRONITOR_INGEST_URL and CRONITOR_RELEASE. 5.0.0 because @cronitor.job now sends an exception event on failure by default and cronitor.logger is now the log shipper. A test keeps the SDK version reported on the wire equal to setup.py. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
Envelope payloads are now strict JSON: NaN and Infinity in extra or log attributes become strings, circular extra data is cut instead of losing the event, unencodable dict keys are skipped, and lone surrogates are replaced. A missing API key is logged once per transport instead of on every record, which matters with LogHandler on a busy logger. The test envelope parser now rejects NaN like a strict backend would. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
cronitor.app (or CRONITOR_APP) names the app monitor that exception events and log records belong to. A cronitor.app tag or attribute on a single call overrides it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
The monitor type that owns exceptions and logs is called service. The SDK setting is cronitor.service (CRONITOR_SERVICE) and the tag and log attribute are cronitor.service. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
A telemetry outage used to raise the ping's ConnectionError into the decorated function before it ran. Pings are now best effort and logged. The README points Sentry SDK users at a service monitor's dsn instead of an API key id, and restores apply_config() in two examples. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
A child that inherited the transport reused the parent's keep-alive session, so both processes wrote to the same TLS socket, and a pool lock held by a parent thread at fork time could deadlock the child. When the pid changes the session and the rate limit window are reset along with the queue and the worker thread. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
Before 5.0 cronitor.logger was logging.getLogger('cronitor'), so code
like cronitor.logger.info('x %s', 1) now raised TypeError. The logger
takes %-style arguments (falling back to the raw body when they do not
format), and adds warn, critical, exception (an error log carrying the
handled exception's type, message and stack trace) and log(level, ...)
for stdlib level numbers and names. Configuration calls still pass
through to the stdlib logger.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
The server drops event items over 1 MB, and a deep exception chain with source context or a large extra could exceed it. An event over 900 KB now loses every frame's source context, then extra, then all but the last 20 frames of each exception, stopping as soon as it fits, and extra['_trimmed'] records what was dropped. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
Attribute keys are cut to 64 characters and values to 400, except the exception stack trace and message and the message template, which keep 8,000 like the body; a record keeps at most 50 attributes. LogHandler now defaults to INFO, so a root logger at DEBUG no longer ships every library's debug lines; LogHandler(level=logging.DEBUG) opts in. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
After a 429 the sender thread slept until the limit lifted, so every item queued behind it waited too and was lost when the 2 second exit flush gave up. Envelopes sent during the limit window are now dropped, counted in Transport.dropped and logged once per window. X-Sentry-Rate-Limits is read before Retry-After, as Sentry's SDKs do. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DjN96ccpNoVRZuoCxo
…tion-ingestion-8v0m74
aflanagan
left a comment
There was a problem hiding this comment.
Claude Opus 5.5 Medium review
I reviewed git diff origin/master...HEAD at 045f0eb against the frozen Error Tracking contract (cronitorio/cronitor #810–#821). I checked the REST shapes against the errors-api.md docs and cronitor/domain/errors.py in #816, and the errors-monitor validation against #821. Local test run: 116 passed, 7 skipped (the skips are the integration tests that need CRONITOR_TEST_API_KEY).
Contract alignment (verified)
- Ingest: the DSN is parsed as
https://<ingest_key>@host/<project_id>(the default/1is a placeholder). The client POSTs a gzipped envelope to{scheme}://{netloc}{prefix}/api/{project_id}/envelope/and sends bothX-Sentry-Auth: Sentry sentry_key=<ingest_key>, sentry_version=7, ...and the envelope headerdsn.cronitor.api_keyis never used as the ingest key:test_capturesets a REST key and still requires a DSN. - Capture:
capture_exceptionandcapture_message(module-level and onMonitor) takelevel,fingerprint(always sent as a list of strings),extra, andtags. Messages go out as{"formatted": ...}. Exceptions carry the__cause__/__context__chain and frames with 5 lines of source context. No locals are sent. Every capture path is wrapped and returnsNoneon failure. The transport runs on a daemon thread with a bounded queue, handles fork safety, and backs off on 429. - Logger and version:
cronitor.loggeris stilllogging.getLogger('cronitor'), and there is noLogHandler. Version is 4.10.0 in bothsetup.pyand_version.py. - REST:
ErrorApp(create/list/get/update/delete/rotate_key →/api/error-apps[/:key[/rotate-key]]) andErrorGroup(list with every documented filter/update(status, env)/events(env, app, cursor, limit)/event →/api/errors...) use basic authapi_key:. List parsing handles the server's{"data": [...]}envelope. HTTP 4xx/5xx map toAuthenticationError,APIValidationError,ErrorAppNotFound/ErrorGroupNotFound, orAPIError. Only opaque keys are used. @cronitor.job: auto-captures by default (mechanism=cronitor.job,handled=False), andcronitor.capture_exceptionsand the decorator'scapture_exceptions=override it correctly. Run/fail/complete pings go through_safe_ping, so a ping failure no longer raises into the job. The ContextVar binding is always reset infinally.- Errors monitors:
apply_configcounts theerrors:key, andMonitor.putpassestype: errorsthrough unchanged. No numeric DB primary keys appear anywhere.
Issue to fix
- The README
errors:YAML example fails backend validation.README.md(thebilling-error-spikesexample) useswindow: 5 minutes. In #821,parse_spike_windowonly accepts an integer or a string matching^(\d+)\s*m?$after strip/lower, and the API serializes the value back as"5m"."5 minutes"fails that match, so the server raiseswindow: must be whole minutes between 1m and 60m. A user who copies this example intocronitor.yamlgets a validation error fromapply_config(), and the whole config sync fails. Change it towindow: 5m(orwindow: 5). The other fields in that example (trigger: spike,apps: [app_...],threshold,per: fingerprint,notify) match #821.
Non-blocking
ErrorApp.listandErrorGroup.listwithauto_paginate=Truestop whenlen(result) < pageSize. The server clampspageSizeto 200, so passingpageSize=500returns only the first page.Monitor.listbehaves the same way. You could clamppageSizeclient-side or paginate onpage_count.- The REST helpers call
resp.json()without a guard, and network failures surface asrequestsexceptions rather than package exceptions. This matches the existingMonitorcode, but you could wrap a non-JSON 2xx body (for example a proxy error page) inAPIError. cronitor.ingest_urlonly changes the ping host; the envelope host comes from the DSN. The README states this correctly, but the name suggests it also controls error ingest. Consider a short note in the docstring or the env-var docs.ErrorGroup.event()raisesErrorGroupNotFoundfor a missing event. That's acceptable because both share the 404, but the exception name may surprise users.
I found no comments that narrate old behavior.
Verdict: REQUEST CHANGES
Interrogate + Review R1 (Gemini 4 Neon Medium)HEAD: 045f0eb IntentAdds native Cronitor Error Tracking support for
Verification Run
FindingsNO VERIFIED FINDINGS Dropped
Verdict: APPROVE |
The backend accepts window as an integer or a string like 5m, not "5 minutes", so a copied README example would fail apply_config.
|
Follow-up on the Claude Opus 5.5 Medium review at 045f0eb: Fixed in 9d073b6:
Skipped, with reasons:
|
aflanagan
left a comment
There was a problem hiding this comment.
Claude Opus 5.5 Medium (delta review)
Range reviewed: 045f0eb..9d073b6 (README.md, cronitor/init.py; 3 lines changed)
Previous blocking finding: fixed
- The README
errors:YAML example now sayswindow: 5m(README.md:309) instead ofwindow: 5 minutes.5mmatches the backend'sparse_spike_windowpattern (^(\d+)\s*m?$) and is the same form the backend writes back out, soapply_configwon't reject it anymore.
Clarifications: done
- The package-config docs now say
cronitor.ingest_urlis the host for telemetry pings only, and that error envelopes use the host incronitor.dsn. That matches how the transport works: envelopes go to the DSN's host and never fall back toingest_url. - There's a short inline comment on
ingest_urlincronitor/__init__.pythat says the same thing. It describes current behavior.
Non-blocking notes I raised before
The PR comment says these were skipped because they work the same way as the existing Monitor helpers (pagination clamp, unwrapped resp.json() and network errors, ErrorGroupNotFound for a missing event). That's a reasonable call for this PR, and I don't need any changes for them.
Verification
uv run --with pyyaml --with requests --with pytest pytest -q: 116 passed, 7 skipped (the skipped ones are the live integration tests) at 9d073b6.
New findings
None. The delta only touches docs and a comment, so runtime behavior is unchanged.
Verdict: APPROVE
Interrogate R2 regression-only (Gemini 4 Neon Medium)HEAD: 9d073b6 Scope Checked
NO VERIFIED FINDINGS Verdict: APPROVE |
Cronitor SDKs now take ingest_key and optional ingest_url, and post to /e. DSN config still works but is no longer the documented path.
|
Posts envelopes to |
|
Interrogate R3 regression-only (final allowed round) (local fallback, Grok 4.7 pending: cloud seats paused) on 3c5ec1b (adversary: Gemini 4 Neon Medium via agy on the mini) IntentSwitch native error capture to post gzipped Sentry envelopes to Prior findings
FindingsNone. Verification run:
Dropped
NO VERIFIED FINDINGS |
aflanagan
left a comment
There was a problem hiding this comment.
Gemini 4 Neon Medium (agy on the mini), review of 3c5ec1b
Verdict: APPROVE
No findings.
Checked git diff 9d073b633..HEAD (README.md, cronitor/__init__.py, cronitor/errors.py, cronitor/ingest.py, cronitor/tests/test_errors.py, cronitor/tests/test_ingest.py). Verified credentials_from_key, parse_dsn, and Transport._resolve_dsn route envelopes to {ingest_url}/e with X-Sentry-Auth sentry_key, keep cronitor.dsn working as a fallback, and add no new environment variables. Ran uv run --with pyyaml --with requests --with pytest pytest -q: 117 passed, 7 skipped.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
A failing job in a process without cronitor.ingest_key logged 'No ingest_key detected' at ERROR level and built the full event before it found there was nowhere to send it. Users who only send pings saw that line in their job output after upgrading. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
The text of a failed requests call holds the ping URL, which holds the API key. The warning names the exception class instead. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
Every other setting has an environment variable. Without this one, a deployment configured only through the environment had to use the undocumented CRONITOR_DSN. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
capture_exception() followed by a re-raise inside @cronitor.job sent two events for one failure, and so did an exception that crossed two nested jobs. Both doubled the counts that spike monitors read. A sent exception now carries its event id, and auto-capture skips it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
cronitor.celery sent the fail ping for a failed task but no exception event, and capture_exception() inside a task was not bound to the task's monitor or run. The failure handler now sends an unhandled event with the task id as the series, except for errors the task lists in throws. The run binding lives from task_prerun to task_postrun. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
On Python 3.12 and older a multiprocessing child leaves through os._exit without running atexit handlers, so an event captured just before the child ended was never sent. The transport now also registers its exit flush as a multiprocessing finalizer in each process that starts a worker thread. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
An asyncio.TaskGroup failure arrived as 'unhandled errors in a TaskGroup (1 sub-exception)' with no trace of the error that caused it. The members, and their own chains, are now in the event ahead of the group, so the stack trace and the default grouping show the real cause. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
These fields had no limit, so the size trim could not bring an event with a very large fingerprint under the 1 MB the server accepts, and the server dropped it. The caps match the lengths the server keeps. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
Every exception captured by the decorator began with the SDK's own wrapped() frame. It is noise in the trace, and it was part of the default grouping when no frame of the trace counted as in-app. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
A wrong or rotated key logged 'rejected an envelope with HTTP 403' for every event. It now logs one error that names cronitor.ingest_key. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
The README told users to create monitors with type 'errors' and the fields trigger, threshold, window and per. The Monitors API has none of those: the type is 'error', the events to watch go in an 'error' object and the alert conditions are 'error.*' assertions, so the documented call returned 400. The cronitor.yaml key stays 'errors', which the API maps to the 'error' type. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
Capture could be configured two ways: an ingest key plus the ingest URL, or a Sentry-style DSN in cronitor.dsn / CRONITOR_DSN that carried both. The two could disagree, and messages talked about a "DSN" that the dashboard never shows. cronitor.dsn, CRONITOR_DSN, the DSN parser and the per-call dsn argument of submit_event are gone. cronitor.ingest_key with cronitor.ingest_url is the only configuration, and ingest.configured() looks at the ingest key alone. A URL or DSN given as the ingest key is reported once as an invalid cronitor.ingest_key and nothing is sent. The envelope header still carries the dsn field built from the key and URL, and X-Sentry-Auth is unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
Telemetry pings and envelope posts each used a fixed 5 second timeout that could not be changed, and cronitor.timeout only covers REST API calls. cronitor.ingest_timeout (CRONITOR_INGEST_TIMEOUT, seconds, default 5) is the timeout for every request to the ingest host: pings and envelopes. A value that is not a positive number, from the environment or assigned at run time, is ignored and 5 seconds is used; it never raises. cronitor.timeout keeps its meaning. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
While the ingest host was unreachable or answering 5xx, every captured event wrote its own warning, so an outage on Cronitor's side could flood the application's log. The transport logs the first failed send (connection error, timeout or a rejected status) and says that later failures are not logged. It stays silent until a send succeeds; the next failure after that is logged again. The rejected ingest key and rate limit messages are unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
ErrorApp.list and ErrorGroup.list stop at the first page that holds fewer rows than pageSize. The API never returns more than 200 rows in a page, so with auto_paginate=True and pageSize above 200 the first page looked like the last one and the rest of the rows were left out. With auto_paginate the page size is at most 200, the API maximum. Monitor.list is unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
cronitor.ingest_url is the one host for telemetry pings and error envelopes. Envelopes already got https:// when the value had no scheme, but pings used the value as written, so with CRONITOR_INGEST_URL=eu.cronitor.link every ping failed with an invalid URL while events were delivered. Pings are built from the same normalised value: surrounding whitespace is dropped, a missing scheme becomes https://, and a path prefix is kept. The README says that ingest_url moves both pings and error events and gives the EU value, https://eu.cronitor.link. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
Summary
Adds native error tracking to
cronitor-python4.10.0. There are no new dependencies.cronitor.ingest_key(CRONITOR_INGEST_KEY) to an Error App's ingest key.cronitor.ingest_url(CRONITOR_INGEST_URL) is the one host for telemetry pings and error events. It is optional and defaults tohttps://cronitor.link; EU accounts sethttps://eu.cronitor.link. A value without a scheme getshttps://. Events go toPOST {ingest_url}/eas gzipped Sentry envelopes, authenticated by the ingest key inX-Sentry-Auth. There is no DSN setting: the ingest key and the ingest URL are the only configuration.cronitor.capture_exception(exc=None, *, monitor=None, series=None, level='error', tags=None, extra=None, fingerprint=None)cronitor.capture_message(message, level='info', ...)Monitor.capture_exceptionandMonitor.capture_message, bound to the monitor and its environment.Each returns the event id, or
Nonewhen nothing was queued.cronitor.release(CRONITOR_RELEASE) and the environment. Local variables are never sent.fingerprintaccepts a string or a list. The fingerprint, release, environment and hostname are capped to the lengths the server keeps.cronitor.ingest_timeout(CRONITOR_INGEST_TIMEOUT, default 5 seconds) applies to every ping and every error envelope.cronitor.timeout(CRONITOR_TIMEOUT, default 10 seconds) applies to the REST API. A value ofingest_timeoutthat is not a positive number gives the default.ingest_timeout, and 429 responses are honoured. A failed send is logged once, then not again until a send succeeds. A rejected ingest key (401/403) is reported once. The transport is fork-safe,cronitor.flush(timeout=2.0)also runs at exit, and amultiprocessingchild flushes before it exits. It never raises into application code.@cronitor.jobauto-capture: on by default (cronitor.capture_exceptions), and it does nothing, with no log line, until an ingest key is set. It can be turned off per job withcapture_exceptions=False. It sends afailping, then an unhandled-exception event bound to the same monitor and run series. An exception that your code already captured, or that an inner job captured, is not sent again.cronitor.celery.initialize(app), a failed monitored task sends an unhandled event bound to the task's monitor, with the task id as the series. Errors listed in the task'sthrowsare not sent, and a retry sends nothing until the last attempt fails. Captures made inside a task are bound to it.cronitor.ErrorApp:create,list,data,update,delete, androtate_key, which refreshesingest_key.cronitor.ErrorGroup:listwith filters and pagination,data,update,events, andevent.list(auto_paginate=True)returns every row. With apageSizeabove 200 it uses 200, the largest page the API returns.type: 'error'monitors work inMonitor.put, and incronitor.yamlandapply_configunder theerrors:key. The README examples use theerrorobject anderror.*assertions the Monitors API accepts.Behaviour changes for existing users
@cronitor.jobno longer raises into the job. Before, a failedrunping stopped the job from starting. The failure is logged as a warning that names the exception class only, because the exception text holds the API key.cronitor.ingest_url/CRONITOR_INGEST_URLalso sets the host for telemetry pings.cronitor.ingest_timeout, with the same default.Testing
pytest: 129 passed, 7 skipped on Python 3.11, 3.12 and 3.13, each in a clean virtualenv withrequirements.txtandpytestonly.MonitorPingTests::test_endpointswas not run locally because it needs the real network.cronitor/errors/in cronitorio/cronitor). The key, event id, level, exception order,handled, mechanism, and the monitor and series tags all came out as sent.throws, a manual capture followed by a re-raise, and a retried task.multiprocessingflush was run withProcessandProcessPoolExecutorchildren on 3.11, 3.12 and 3.13. Before the change, 3.11 and 3.12 delivered 0 of 3 events; now all three versions deliver 3 of 3.Not in this PR
async deffunction under@cronitor.jobreportscompleteas soon as the coroutine is created and captures nothing. This is older behaviour of the decorator.https://claude.ai/code/session_01B4Z4DoMhfFfszcdpy4ifSi
Generated by Claude Code