Skip to main content
You can export HTTP logs from your AI Gateway endpoints to external systems using ngrok’s Log Exporting feature.

Current support

AI Gateway endpoints emit standard ngrok traffic logs (http_request_complete.v0). AI-specific log fields (provider selection, retry tracking, token usage) are not currently available but are on our roadmap.
Log Exporting allows you to:
  • Stream request/response logs to your analytics platform
  • Archive traffic data for compliance
  • Build custom dashboards and alerts
  • Integrate with your existing observability stack

Setting up log exporting

Log Exports are configured at the account level through the ngrok Dashboard:
1

Open Log Exporting

Go to Log Exporting in the ngrok Dashboard
2

Create a New Log Export

Click to create a new Log Export
3

Select Log Sources

Choose which log sources to capture (for example, http_request_complete.v0 for HTTP traffic)
4

Configure Destinations

Select and configure one or more destinations for your logs

Supported destinations

ngrok supports exporting logs to:
  • Amazon CloudWatch - AWS logging and monitoring
  • Amazon Firehose - AWS data streaming (can deliver to S3)
  • Amazon Kinesis - AWS data streaming
  • Azure Logs Ingestion - Azure logging
  • Datadog Logs - Monitoring and analytics
For detailed configuration of each destination type, see the Log Exporting documentation.

What logs include

Standard HTTP traffic logs from AI Gateway endpoints include:
FieldDescription
event_idUnique identifier for the log
event_timestampWhen the request completed
account_idYour ngrok account ID
conn.client_ipClient IP address
conn.server_nameEndpoint hostname
http.request.methodHTTP method (POST, GET, etc.)
http.request.url.pathRequest path (for example, /v1/chat/completions)
http.response.status_codeResponse status code
http.response.body_lengthResponse body size

What’s not yet included

AI Gateway-specific data is not currently included in logs:
  • Which provider handled the request
  • Model selection strategy results
  • Retry attempts and failover decisions
  • Token counts (input/output/total)
  • Cost estimates
  • Provider API key used
These AI-specific log fields are on our roadmap. Email [email protected] to tell us what data you need - your feedback shapes our development priorities.

Filtering logs

You can filter traffic logs using CEL expressions to capture only relevant requests:
# Only log requests to chat completions endpoint
ev.http.request.url.path == "/v1/chat/completions"

# Only log errors
ev.http.response.status_code >= 400

# Only log slow requests (if timing fields available)
ev.http.response.status_code == 200
See the Log Exporting documentation for more filter examples.

Use cases

Compliance logging

Stream all requests to long-term storage for audit trails:
  • Use Amazon Firehose to deliver to S3
  • All HTTP requests are captured with timestamps and metadata
  • Combine with Traffic Inspector for full body capture when needed

Real-time monitoring

Send logs to your monitoring platform:
  • Use Datadog or CloudWatch destinations
  • Build dashboards showing request volume and latency
  • Set up alerts for error spikes

Custom analytics

Process logs in your own systems:
  • Stream to Kinesis or Firehose
  • Build custom pipelines for your specific needs
  • Aggregate and analyze traffic patterns

See also