-
Notifications
You must be signed in to change notification settings - Fork 95
Query execution logs #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Query execution logs #282
Conversation
Resolves #42 This commit implements a new CLI command `benchmark logs` that allows users to query and retrieve full output and error logs for benchmark invocations across all supported platforms (AWS, Azure, GCP, Local, and OpenWhisk). Key features: - Query logs from experiment results JSON file (containing multiple invocations) - Query logs for a specific function and invocation ID - Support for custom time ranges to narrow log searches - Platform-specific implementations: - AWS: Uses CloudWatch Logs Insights API - Azure: Uses Application Insights Analytics - GCP: Uses Cloud Logging API - Local: Retrieves Docker container logs - OpenWhisk: Uses wsk CLI activation logs Usage examples: 1. Query logs from experiment results: ./sebs.py benchmark logs --config config.json --experiments-file experiments.json 2. Query logs for specific invocation: ./sebs.py benchmark logs --config config.json --function-name my-function --request-id abc123 Changes: - sebs/faas/system.py: Added abstract method get_invocation_logs() - sebs/aws/aws.py: Implemented AWS CloudWatch log retrieval - sebs/azure/azure.py: Implemented Azure Application Insights log retrieval - sebs/gcp/gcp.py: Implemented GCP Cloud Logging retrieval - sebs/local/local.py: Implemented Docker container log retrieval - sebs/openwhisk/openwhisk.py: Implemented OpenWhisk activation log retrieval - sebs.py: Added new 'benchmark logs' CLI command
Improvements to the logs CLI command: - Changed to use positional TARGET parameter instead of flags - Auto-detect if TARGET is a file path or function name - For experiments file: automatically use begin/end time from results - For function name: require --request-id flag - Added --minutes flag (default 30) to specify lookback window - Removed --start-time and --end-time flags (not needed) Usage examples: # Query logs from experiments file ./sebs.py benchmark logs experiments.json --config config.json # Query logs for specific function invocation ./sebs.py benchmark logs my-function --request-id abc123 --config config.json # Query with custom time window (60 minutes) ./sebs.py benchmark logs my-function --request-id abc123 --minutes 60 --config config.json Linting fixes: - Fixed line too long in sebs/aws/aws.py - Removed unused variable in sebs/azure/azure.py - Fixed mypy type error in sebs/gcp/gcp.py (timestamp variable name conflict) - Fixed potential None dereference in sebs/aws/aws.py - Applied Black code formatting to all modified files
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| if logs: | ||
| for log_line in logs: | ||
| if log_line.strip(): # Skip empty lines | ||
| print(log_line) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use our logging, and aggregate logs according to invocation ID.
| sebs_client.logging.info(f"\n{'-' * 80}\nLogs:\n{'-' * 80}") | ||
| for log_line in logs: | ||
| if log_line.strip(): # Skip empty lines | ||
| print(log_line) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above
|
|
||
| # Logs might not be available yet | ||
| retries += 1 | ||
| if retries < max_retries: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Max retires should be a cli parameter
| container = c | ||
| break | ||
|
|
||
| # Retrieve logs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check our local execution actually provides logging
This is an attempt to resolve issue #42. First attempt of doing end-to-end programming with Claude.