Documentation

Observability

Charts of who reaches your project and how it responds, and the logs of every service, searchable by field or with SQL.

There is nothing to instrument. Every request that reaches your project, every Edge Function run and every message sent is recorded as it happens. The console shows it in two places: Observability, with charts, and Logs, with the individual records.

Charts

Observability in the project charts the selected period, with filters:

Audience

Distinct users active each day, and when in the week they are most active.

Traffic

Request volume, by status code and by path.

Performance

Latency and error rate.

Network

Data in and out of the project, including calls to third-party services.

Logs

Logs lists records from each service the project uses, newest first:

All logs

Every source together.

Requests

One record per request: method, path, status, latency, sizes, client and the user who made it.

Functions

What your Edge Functions write with console, and each run's latency and memory.

Notifications

Each email and SMS: template, destination, language, provider and result.

System

What the platform does for the project, such as builds.

Open a record to see its details. From there, Show this trace lists every record with the same track id, which follows one operation across services, and Show logs from this user narrows everything to that user.

Logs can take a few minutes to appear.

The search box takes a field, a colon and a value. Combine conditions with AND, OR and NOT:

level:(error, fatal)
metadata.http.response.status:>=500
metadata.timing.latency:>1000
message:*timeout* AND NOT service:api-gateway
field:value
Equals.
field:"two words"
Exact phrase.
field:*text*
Contains. field:text* starts with.
field:(a, b)
Any of the values.
field:>=500
Comparison, also >, < and <=.
field:[400 TO 499]
Range, inclusive.
field:*
The field exists.

The fields you will use most:

level
trace, debug, info, warn, error or fatal.
message
The log message.
service · source
The service that wrote it, and where inside it.
environment
The project environment.
track_id
Groups the records of one operation.
metadata.http.request.method · metadata.http.request.path
The request.
metadata.http.response.status
The response status.
metadata.timing.latency
How long the request took, in milliseconds.
metadata.identity.user.id
The user who made the request.

SQL

In organizations with SQL queries enabled, Query also takes SQL against a read-only logs table. Queries stop after 10 seconds.

SELECT metadata->'http'->'request'->>'path' AS path,
  round(avg((metadata->'timing'->>'latency')::numeric)) AS avg_ms,
  count(*) AS requests
FROM logs
WHERE metadata->'timing'->>'latency' IS NOT NULL
  AND timestamp > now() - interval '24 hours'
GROUP BY path
ORDER BY avg_ms DESC
LIMIT 20

The columns are timestamp, level, message, service, service_version, source, environment, track_id, metadata (JSON) and id.

What a record says about the caller

The user and session on a request record come from the access token the caller sent, read without checking its signature. They show who the token claims to be, which is what you need to follow a user's requests, but they are not proof of identity. Your code proves it with verify.

Values of sensitive query parameters, such as token, code, otp, password and client_secret, are masked before the record is written.

Retention

How long logs are kept depends on the organization's plan:

Free
24 hours.
Pro
7 days.
Scale
28 days.
Enterprise
Agreed in the contract.

Next

On this page