Skip to main content

Stress Test the PDP with Audit Log Replay

The Audit Log Replay API allows you to replay permit.Check() requests based on your existing audit logs. This powerful feature enables you to test your PDP configuration by simulating real traffic patterns without affecting your production environment.

FYI

This feature is currently available to whitelisted organizations only!

We're rolling it out carefully to ensure the best experience. Want to use this feature? Reach out to our friendly support team via Slack and we'll be happy to add you to our VIP whitelist!

Use Cases

  • Load Testing: Test your PDP's capacity by replaying high-volume traffic
  • Regression Testing: Verify that policy changes don't break existing permissions
  • Debugging: Reproduce issues by replaying the exact request patterns from a specific time period
  • Performance Tuning: Measure latency and throughput under different configurations

API Endpoint

For complete API details and schema information, see the Audit Log Replay API Reference.

POST /v2/audit-log-replay

Request Parameters

ParameterTypeDescription
pdp_urlstringThe URL of the target PDP instance to replay logs against
start_timestring (UNIX Timestamp)Beginning of time range to replay logs from
end_timestring (UNIX Timestamp)End of time range to replay logs from
concurrency_limitintegerNumber of concurrent requests to simulate
graceful_shutdown_sobject (optional)Additional filters to apply to audit logs before replay

Example Request

{
"pdp_url": "https://example-pdp.permit.io",
"start_time": "1740832387",
"end_time": "1743507187",
"concurrency": 5,
"graceful_shutdown_s": 60
}

Example Response

{
"message": "Audit log replay started with 2599 documents",
"document_count": 2599
}

Best Practices

  1. Start Small: Begin with a short time range and low concurrency to understand the impact
  2. Target Testing PDP: Always point to a test PDP instance, not production
  3. Consider Time Patterns: Replay traffic from representative time periods (peak hours, etc.)
  4. Monitor Performance: Watch your PDP metrics during replay to identify bottlenecks

Limitations

  • Maximum replay duration: 30 days
  • Maximum concurrency: 10 (contact support for higher limits)
  • Replay requests may be throttled based on your plan
  • Maximum timeout for a session is 60 seconds
  • Certain audit log types may not be replayable (Authorized-users, Bulk check, etc.)