Download the PHP package tiden/telemetry-php without Composer
On this page you can find all versions of the php package tiden/telemetry-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tiden/telemetry-php
More information about tiden/telemetry-php
Files in tiden/telemetry-php
Package telemetry-php
Short Description Tiden error-tracking PHP SDK. Emits the envelope wire format to a Tiden ingest endpoint, with no third-party error-SDK dependency.
License MIT
Homepage https://github.com/qase-tms/tiden-telemetry-php
Informations about the package telemetry-php
tiden/telemetry-php
Framework-agnostic error-tracking PHP SDK for
Tiden. Emits the
envelope wire format to a Tiden ingest endpoint — no third-party error-SDK
dependency. For Laravel, use the tiden/telemetry-laravel bridge (built on this).
Scopes, custom events and the test transport
A long-running worker can isolate one unit of work (a job, a command) with a
scope stack. pushScope() continues on a copy of the current scope;
popScope() restores the saved one and discards the tags and breadcrumbs added
since (it returns false when nothing was pushed). To start a new unit of work
without losing process-wide tags, user and extra, clear only the breadcrumbs:
The same \Throwable object is sent once per client: a second
captureException() returns the first event id without sending again.
Sdk::init() takes an optional transport as its third argument, so tests can
use the real init path without the network:
What it does
- Parses the DSN to the edge URL
/api/<projectId>/envelope/?tiden_key=…. - Normalizes
\Throwable(incl. cause chains) intoexception.values[]with stack frames (in_appheuristic, app-relative paths). - Serializes the envelope and POSTs it via curl (synchronous, never
throws, bounded by
http_timeout; honors HTTP 429 + Retry-After). - Shrinks envelopes over
max_envelope_bytesbefore sending, and drops the ones it cannot shrink (see below). - Reports every event it fails to deliver to
on_transport_failure. - Scrubs likely-PII (auth headers, secret-ish keys) unless
send_default_pii. before_sendhook to mutate or drop events.
Options
Key (Options::fromArray) |
Constructor parameter | Default | Meaning |
|---|---|---|---|
dsn |
$dsn |
required | http://<publicKey>@<host:ingestPort>/<projectId> |
release, environment |
$release, $environment |
null |
Added to every event. |
send_default_pii |
$sendDefaultPii |
false |
Keep likely-PII instead of scrubbing it. |
max_breadcrumbs |
$maxBreadcrumbs |
100 |
Breadcrumbs kept per scope. |
before_send |
$beforeSend |
null |
fn (array $event): ?array; return null to drop. |
http_timeout |
$httpTimeout |
2.0 |
Total seconds per send. The connect timeout is min(http_timeout, 1.0). fromArray uses the default for empty or non-positive values. |
max_envelope_bytes |
$maxEnvelopeBytes |
921600 |
Envelope size cap (the ingest rejects bodies over 1 MiB). fromArray uses the default for empty or non-positive values. |
on_transport_failure |
$onTransportFailure |
null |
Called for every event that is not delivered. Ignored when not callable. |
retry_after_default |
$retryAfterDefault |
60.0 |
Seconds to pause after a 429 that has no Retry-After. |
Delivery and failures
Sends are synchronous, so each one is bounded: http_timeout in total, at most
1 s to connect, no signals (CURLOPT_NOSIGNAL), and no Expect: 100-continue
round trip. A send never throws.
The transport keeps two process-local pauses. While one is active, sends are
skipped and reported as suppressed:
- After a curl error (connection refused, DNS failure, timeout), sends pause for 30 s. A dead ingest costs one timeout per worker, not one per event.
- After HTTP 429, sends pause for
Retry-Afterseconds, or forretry_after_defaultwhen the header is missing.
Other non-2xx responses are reported and do not pause sending.
on_transport_failure receives one array per lost event:
reason |
When | status |
curl_errno |
|---|---|---|---|
curl_error |
curl failed (7 = connection refused, 28 = timeout, ...); starts the 30 s pause | null |
set, or null when no handle could be created |
http_error |
any non-2xx response other than 429 | set | null |
rate_limited |
HTTP 429; starts the Retry-After pause | 429 |
null |
suppressed |
skipped because a pause is active | null |
null |
envelope_too_large |
still over max_envelope_bytes after shrinking (see below) |
null |
null |
A curl_error with curl_errno null means no curl handle could be
created (ext-curl missing, or curl_init() failed); nothing was sent, so it
starts no pause.
bytes is the envelope size in bytes. The array never contains the URL (it
carries the DSN key) or the event. Exceptions thrown by the callback are
swallowed, and the callback runs inside the send, so keep it cheap.
Envelope size cap
After before_send, the client serializes the event. While the envelope is
larger than max_envelope_bytes, it shrinks the event in this order and stops
as soon as it fits:
- Drop the breadcrumbs.
- Cut each
extravalue to 1 KiB (a non-string value whose JSON is longer is replaced by its JSON, cut). - Cut each exception value and the message to 8 KiB (a Laravel
QueryExceptionmessage embeds the full SQL). - Still too large: drop the event and report
envelope_too_large.
Cuts never split a UTF-8 character. A shrunk event carries the tag
tiden.truncated with the steps applied: breadcrumbs, breadcrumbs,extra or
breadcrumbs,extra,exception. The tag records the last stage reached, even
when a stage found nothing to remove (for example, an event with no
breadcrumbs still reports breadcrumbs).
Source maps are a browser concern (JS bundles); PHP isn't minified, so there is no source-map counterpart here.
Develop
MIT © Qase
All versions of telemetry-php with dependencies
ext-curl Version *
ext-json Version *