Zum Inhalt springen
GigadriveDocs

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

FieldWhat it holds
idThe request id the edge minted, also returned to the client as x-request-id
request.methodHTTP method sent by the client
request.hostnameHostname that received the request, including custom domains and storage hostnames
request.pathPath used for route matching
request.querySanitized query string without the leading ?, or null
request.protocolProtocol observed at the edge, usually https
request.countryISO 3166-1 alpha-2 country inferred at the edge
request.userAgent, request.refererSanitized client headers, kept for tracing traffic sources
response.statusStatus returned to the client, null when the request never completed
response.cacheStatushit, miss, bypass, revalidated, stale, updating, or null
response.cacheHitWhether the body came from cache instead of your Function or an origin
response.edgeLocationEdge location closest to the client
metrics.requestBodyBytesSize of the client request body
metrics.responseBodyBytesSize of the response body produced by the Function or origin
metrics.bytesSentTotal bytes the edge sent to the client
metrics.durationMsEnd to end duration observed at the edge
startedAt, completedAtWhen the platform started and finished handling the request
deployment, deploymentFunction, deploymentAssetWhich build, function route or static asset answered
storageBucket, storageObjectWhich bucket and object answered, for File Storage delivery
requestHeaders, responseHeadersSanitized 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.

EventMeaning
itemOne feed entry, keyed by its kind and id
endThe stream reached its time budget. Reconnect to continue; the only reason is budget
errorA 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.

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.