Menu
Platform
AI
App store purchases
Database
Flags
Jobs and cron
Localization
Monitoring
Notifications
Payments
Queues
Sandboxes
Webhooks
Getting Started
Authentication
KV Store
Deploy & Infrastructure
Reference
Monitoring quickstart
One of each signal in, and the same three read back out
This page sends one log entry, one span and one error, then reads each one
back. Every step exists in the console too, but the calls are the clearest
statement of what is happening. The TypeScript lines are the reference's own:
they call the same methods through sylphx.observability.
#1. Send a log entry
A Log Entry needs log_time, severity and body.
The write is a batch, and the batch is ingested atomically:
sylphx observability log-entries write orgs/acme/projects/shop/envs/productioncurl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/log_entries:write" \
-H "Authorization: Bearer $SYLPHX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"log_entries":[{"body":"…","log_time":{},"severity":"trace"}]}'const response = await sylphx.observability.logEntries.write({ logEntries: [{ body: '…', logTime: {}, severity: 'trace' }], parent: 'orgs/acme/projects/shop/envs/production' })The answer is admitted_count, the entries the call took. Send the same batch
again under the same Idempotency-Key and the same digest and it replays; send
a different body under that key and the call conflicts instead of writing a
second copy. Add trace_id and span_id to an entry and it is readable as
part of that trace.
#2. Report a span
A span needs trace_id, span_id, span_name, service_name, start_time
and end_time, and the call validates a span's parent and time invariants
before it admits anything:
sylphx observability traces write-spans orgs/acme/projects/shop/envs/productioncurl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/traces:writeSpans" \
-H "Authorization: Bearer $SYLPHX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"spans":[{"end_time":{},"service_name":"…","span_id":"…","span_name":"…","start_time":{},"trace_id":"…"}]}'const response = await sylphx.observability.traces.writeSpans({ parent: 'orgs/acme/projects/shop/envs/production', spans: [{ endTime: {}, serviceName: '…', spanId: '…', spanName: '…', startTime: {}, traceId: '…' }] })Nothing creates a Trace on its own. A trace is every span
that shares one W3C trace id, so reporting the spans is what brings it into
being — a root span is simply the one whose parent_span_id is empty.
#3. Capture an error
capture takes one occurrence, and the occurrence needs event_time and
exception_type. The answer carries the occurrence as it was stored:
sylphx observability error-groups capture orgs/acme/projects/shop/envs/productioncurl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/error_groups:capture" \
-H "Authorization: Bearer $SYLPHX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"error_event":{"event_time":{},"exception_type":"…"}}'const response = await sylphx.observability.errorGroups.capture({ errorEvent: { eventTime: {}, exceptionType: '…' }, parent: 'orgs/acme/projects/shop/envs/production' })Leave fingerprint out and the Error Group is chosen
for you, from the exception type and the symbolicated in-app stack. Set it and
the group is whatever you say. Errors covers the
grouping rules and what happens to a resolved group.
In a browser the same call goes out with a publishable key that holds
observability:ingest.
#4. Read each one back
#Log entries
A query covers a bounded interval and answers with entries and a page token, and
one trace is followed with trace_id = "...":
sylphx observability log-entries query orgs/acme/projects/shop/envs/productioncurl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/log_entries:query" \
-H "Authorization: Bearer $SYLPHX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"start_time":{}}'const response = await sylphx.observability.logEntries.query({ parent: 'orgs/acme/projects/shop/envs/production', startTime: {} })#Traces
The query answers with summaries — no spans — and the read answers with the spans themselves:
sylphx observability traces query orgs/acme/projects/shop/envs/production
sylphx observability traces get orgs/acme/projects/shop/envs/production/traces/traceconst response = await sylphx.observability.traces.query({ parent: 'orgs/acme/projects/shop/envs/production', startTime: {} })#Errors
List the environment's groups, then the occurrences inside one group:
sylphx observability error-groups list orgs/acme/projects/shop/envs/production
sylphx observability error-events list orgs/acme/projects/shop/envs/production/error_groups/error-groupconst response = await sylphx.observability.errorGroups.list({ parent: 'orgs/acme/projects/shop/envs/production' })Each occurrence is one immutable record, with its breadcrumbs oldest first and
the trace_id and span_id that connect it to the trace you just read.