Skip to main content

Step 1: Create an API Key

Create an API key in Promptwatch. Go to Settings → API Keys in your Promptwatch dashboard.

Step 2: Create HTTPS Logging Endpoint

Create an HTTPS logging endpoint following these instructions. Use these settings: URL:
https://logs.promptwatch.com/event/fastly
Logging format:
{
  "timestamp": "%{strftime({\"%Y-%m-%dT%H:%M:%S%z\"}, time.start)}V",
  "host": "%{if(req.http.Fastly-Orig-Host, req.http.Fastly-Orig-Host, req.http.Host)}V",
  "status_code": %{resp.status}V,
  "request_method": "%{json.escape(req.method)}V",
  "request_path": "%{json.escape(req.path)}V",
  "query_string": "%{json.escape(req.url.qs)}V",
  "content_type": "%{json.escape(resp.http.Content-Type)}V",
  "client_ip": "%{req.http.Fastly-Client-IP}V",
  "user_agent": "%{json.escape(req.http.User-Agent)}V",
  "referrer": "%{json.escape(req.http.referer)}V"
}
Advanced settings:
  • Content Type: application/json
  • Custom header name: X-API-Key
  • Custom header value: YOUR_API_KEY
  • Method: POST
  • JSON log entry format: Array of JSON
The rest of the settings should keep their default values.

Step 3: Finish

Create and activate your configuration to start sending logs to Promptwatch. Logs should be visible in a few minutes.