Analytics Troubleshooting#
Getting Empty Results?#
Check these common causes:
Time Range Issues#
- Your workspace might be new with no verification data yet
- Try a shorter time range:
WHERE time >= now() - INTERVAL 1 HOUR - Verify your time filters are working:
SELECT MAX(time) as latest FROM key_verifications_v1
Filter Problems#
- Wrong
key_space_id- Find your API ID in dashboard settings - Empty
external_idvalues - Filter them out:WHERE external_id != '' - Case sensitivity - Check exact values:
SELECT DISTINCT external_id FROM key_verifications_v1 LIMIT 10
Data Availability#
- Analytics may have a few minutes delay
- Check recent data:
SELECT COUNT(*) FROM key_verifications_v1 WHERE time >= now() - INTERVAL 1 HOUR
Queries Timing Out?#
Try these optimizations:
Use Aggregated Tables#
Add Time Filters First#
Limit Result Size#
API Errors?#
Common fixes:
Missing Property 'query'#
See invalid_input error for API request format issues.
Permission Denied#
- Ensure your root key has
api.*.read_analyticsorapi.<api_id>.read_analytics - Check key is not expired or revoked
- Verify workspace ID matches your key's permissions
See the
forbiddenerror for permission issues.
Invalid Function Error#
- Check Query Restrictions for allowed functions
- Some ClickHouse functions are blocked for security
- Use alternative approaches from Quick Reference
- See
invalid_analytics_functionerror for details
Invalid Table Error#
- Only analytics tables are accessible (no
system.*orinformation_schema.*) - Use table names from Schema Reference
- See
invalid_analytics_tableerror for details
Query Not Supported#
- Only SELECT queries are allowed in analytics
- INSERT, UPDATE, DELETE, etc. are blocked
- See
invalid_analytics_query_typeerror for details
Performance Problems?#
Optimization tips:
Choose Right Table#
< 1 hour:key_verifications_v1(raw)< 24 hours:key_verifications_per_minute_v1< 30 days:key_verifications_per_hour_v1< 1 year:key_verifications_per_day_v1> 1 year:key_verifications_per_month_v1
Filter Before Grouping#
Avoid SELECT *#
- Only select columns you need
- Reduces memory usage and network transfer
Note
For complete error reference, see the Error Documentation in the sidebar. If you continue having issues, contact us at support@unkey.com with your query and error details.