Skip to content

Conversation

@mcopik
Copy link
Collaborator

@mcopik mcopik commented Jan 17, 2026

This is an attempt to resolve issue #42. First attempt of doing end-to-end programming with Claude.

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
@coderabbitai
Copy link

coderabbitai bot commented Jan 17, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

if logs:
for log_line in logs:
if log_line.strip(): # Skip empty lines
print(log_line)
Copy link
Collaborator Author

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)
Copy link
Collaborator Author

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:
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants