Request logs
One record per request Gigadrive Network served, the fields it holds, and how to find a single request.
Gigadrive Network records every request that reaches one of your hostnames, whether it invoked a Function, came out of the CDN cache, or was served from File Storage. Read these when you need to know what the platform did with a request, including the ones your code never saw.
What is recorded
| Field | What it holds |
|---|---|
id | The request id the edge minted, also returned to the client as x-request-id |
request.method | HTTP method sent by the client |
request.hostname | Hostname that received the request, including custom domains and storage hostnames |
request.path | Path used for route matching |
request.query | Sanitized query string without the leading ?, or null |
request.protocol | Protocol observed at the edge, usually https |
request.country | ISO 3166-1 alpha-2 country inferred at the edge |
request.userAgent, request.referer | Sanitized client headers, kept for tracing traffic sources |
response.status | Status returned to the client, null when the request never completed |
response.cacheStatus | hit, miss, bypass, revalidated, stale, updating, or null |
response.cacheHit | Whether the body came from cache instead of your Function or an origin |
response.edgeLocation | Edge location closest to the client |
metrics.requestBodyBytes | Size of the client request body |
metrics.responseBodyBytes | Size of the response body produced by the Function or origin |
metrics.bytesSent | Total bytes the edge sent to the client |
metrics.durationMs | End to end duration observed at the edge |
startedAt, completedAt | When the platform started and finished handling the request |
deployment, deploymentFunction, deploymentAsset | Which build, function route or static asset answered |
storageBucket, storageObject | Which bucket and object answered, for File Storage delivery |
requestHeaders, responseHeaders | Sanitized headers, returned when you read a single request rather than a list |
A record can change after it first appears. The cache outcome and the delivered byte count for requests the cache answered on its own are filled in after the fact, an hour or two behind the traffic they describe, so read a record for very recent traffic as provisional.
What is removed before storage
Request and response bodies are never recorded. Header names are lowercased and values longer than
4,096 characters are truncated. These headers are replaced with the literal string [redacted]:
authorization, cookie, proxy-authorization, set-cookie, x-api-key
These query parameters are redacted in place, keeping the order of the remaining parameters so the URL stays recognisable:
expires, signature, token, x-amz-signature
Narrowing the list
The list endpoint filters on deploymentId, deploymentFunctionId, deploymentAssetId,
storageBucketId, storageObjectId, from, to, method, status, statusFamily, hostname,
pathPrefix, country, edgeLocation, cacheStatus and cacheHit. Pages are cursor based and
hold up to 1,000 records. The console offers the same dimensions in its filter panel, where several
of them take multiple values at once.
Optimized images all sit under one prefix, so pathPrefix=/_gigadrive/image/ isolates the traffic
that Image optimization served.
Following one request
The edge mints an id for every request, sets it as x-request-id on the request your Function
receives, and returns it to the client on the response. An x-request-id the client sent is
discarded and replaced, so the value is always the platform's own. Log that id from your code, quote
it in a support ticket, or read it from a browser's network panel, and it resolves straight to the
record.
import { GigadriveClient } from '@gigadrive/sdk';
// Reads GIGADRIVE_CLIENT_ID and GIGADRIVE_CLIENT_SECRET from the environment.
const client = new GigadriveClient();
const applicationId = '0197b2f1-2f4a-7a0b-8a2d-222222222222';
const { items } = await client.applications.requests.list(applicationId, {
statusFamily: 5,
limit: 100,
});
for (const request of items) {
console.log(request.startedAt, request.response.status, request.request.method, request.request.path);
}
const [failure] = items;
if (failure) {
const detail = await client.applications.requests.get(applicationId, failure.id);
console.log(detail.responseHeaders);
}The first call lists the last hundred 5xx responses, the second reads one record in full including
its sanitized headers. Both need a token carrying the network:requests:read scope. There is no CLI
command for request logs.
Live streaming
GET /applications/{applicationId}/logs/stream tails the same feed over Server-Sent Events, carrying
request records and correlated Runtime logs together. It
takes the same resource, hostname, status and cache filters, adds environmentId, kind, streams
and search, and replaces from and to with sinceMinutes. Three of them are plural here and
accept comma-separated lists: methods, statusFamilies and cacheStatuses. budgetSeconds caps
how long the connection stays open, between 5 and 600, and defaults to the maximum.
| Event | Meaning |
|---|---|
item | One feed entry, keyed by its kind and id |
end | The stream reached its time budget. Reconnect to continue; the only reason is budget |
error | A recoverable server error, carrying retryable: true |
Comment frames arrive every 15 seconds while nothing else is happening, which keeps intermediaries
from closing an idle connection. Each frame's SSE id is a resume cursor: send it back as
Last-Event-ID and the stream picks up where it stopped, which is what EventSource does on its own.
A malformed cursor tails from the present rather than failing the connection.
Treat item as an upsert
A record is updated when its runtime output lands or the CDN reports on it, so the same kind and id will arrive
more than once with refreshed fields. Key your client on that pair and replace, rather than appending.
Streams are limited on two axes: one credential may open 30 connections per 60 seconds and hold 10
open at once, and one organization may hold 40 open across all its credentials. Crossing either
returns 429 with a retry-after of 30 seconds. A 503 with the same header means the platform
itself is at capacity.
