jQuery
Not available yet. TracePath does not publish a jQuery package, and there is no TracePath
script on any CDN. The @tracepath scope on npm belongs to an unrelated third party — do not
run an install command against it, and do not load a script from it. This page describes the
planned integration. Email [email protected] to hear when
it ships.
The planned jQuery package is the browser SDK plus one extra source of errors: jQuery's own AJAX failures, which never surface as uncaught exceptions and are therefore invisible to the generic SDK.
What it will add
- AJAX error capture through
$(document).ajaxError(), recording the URL, HTTP method, status code and error message of every failed$.ajax()call. - Trace header injection into same-origin
$.ajax()requests —$.ajax()usesXMLHttpRequest, which the SDK instruments — as well as same-originfetch()calls. See Distributed Tracing.
Everything else is the shared browser SDK: uncaught errors and unhandled promise rejections captured automatically, batching, session recording on by default with the last ~30 s of DOM events attached to each exception.
One structural detail to plan for: the AJAX hook binds to the global jQuery. If jQuery is
only a bundled module and never lands on window, uncaught errors and explicit captures still
work but AJAX errors are silently skipped. A jQuery loaded from a <script> tag is global
already and needs nothing.
Options
The jQuery package will take the shared browser SDK options documented under
Initialization, plus captureHttpServerErrors, which reports
every fetch response with status >= 500 as a synthetic exception. That option is wired into
the fetch wrapper only, so $.ajax() does not trigger it — the ajaxError capture above is
what covers jQuery requests.
Error filtering and AJAX
By default the SDK ignores 4xx responses, network errors and timeouts, on the grounds that
they are usually expected behaviour rather than bugs. That means a $.ajax() call returning
401 or 422 will not appear in your Issues feed unless you opt in by clearing
ignoreErrors.
Because the jQuery package records the HTTP status code as an attribute on each captured AJAX
error, the useful middle ground is to clear the default patterns and then filter by status in
beforeCapture — keeping 5xx, dropping 4xx. See
Error Filtering.
What to do today
If the pages served to those jQuery clients come from a backend you control, instrument that
backend with OpenTelemetry now. A failing $.ajax() call is usually a failing
endpoint, and the endpoint side is fully supported today — including the
distributed tracing middleware, which is ready for the
browser half to arrive.
For availability alone, synthetic monitors can watch the site from the outside with no code in the page.