Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/cli/gateway_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func parseGatewayLogs(logDir string, verbose bool) (*GatewayMetrics, error) {

// processGatewayLogEntry processes a single log entry and updates metrics
func processGatewayLogEntry(entry *GatewayLogEntry, metrics *GatewayMetrics, verbose bool) {
gatewayLogsLog.Printf("Processing gateway log entry: event=%s, server=%s, tool=%s", entry.Event, entry.ServerName, entry.ToolName)
// Parse timestamp for time range
if entry.Timestamp != "" {
if t, err := time.Parse(time.RFC3339, entry.Timestamp); err == nil {
Expand Down Expand Up @@ -243,6 +244,7 @@ func getOrCreateTool(server *GatewayServerMetrics, toolName string) *GatewayTool

// calculateGatewayAggregates calculates aggregate statistics
func calculateGatewayAggregates(metrics *GatewayMetrics) {
gatewayLogsLog.Printf("Calculating aggregates for %d servers", len(metrics.Servers))
for _, server := range metrics.Servers {
for _, tool := range server.Tools {
if tool.CallCount > 0 {
Expand Down Expand Up @@ -378,6 +380,7 @@ func truncateString(s string, maxLen int) string {

// extractMCPToolUsageData creates detailed MCP tool usage data from gateway metrics
func extractMCPToolUsageData(logDir string, verbose bool) (*MCPToolUsageData, error) {
gatewayLogsLog.Printf("Extracting MCP tool usage data from: %s", logDir)
// Parse gateway logs
gatewayMetrics, err := parseGatewayLogs(logDir, verbose)
if err != nil {
Expand Down Expand Up @@ -531,6 +534,7 @@ func extractMCPToolUsageData(logDir string, verbose bool) (*MCPToolUsageData, er

// displayAggregatedGatewayMetrics aggregates and displays gateway metrics across all processed runs
func displayAggregatedGatewayMetrics(processedRuns []ProcessedRun, outputDir string, verbose bool) {
gatewayLogsLog.Printf("Aggregating gateway metrics from %d processed runs", len(processedRuns))
// Aggregate gateway metrics from all runs
aggregated := &GatewayMetrics{
Servers: make(map[string]*GatewayServerMetrics),
Expand Down
3 changes: 3 additions & 0 deletions pkg/cli/interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func CreateWorkflowInteractively(workflowName string, verbose bool, force bool)

// promptForWorkflowName asks the user for a workflow name
func (b *InteractiveWorkflowBuilder) promptForWorkflowName() error {
interactiveLog.Print("Prompting user for workflow name")
form := huh.NewForm(
huh.NewGroup(
huh.NewInput().
Expand All @@ -102,6 +103,7 @@ func (b *InteractiveWorkflowBuilder) promptForWorkflowName() error {

// promptForConfiguration organizes all prompts into logical groups with titles and descriptions
func (b *InteractiveWorkflowBuilder) promptForConfiguration() error {
interactiveLog.Print("Prompting user for workflow configuration")
// Prepare trigger options
triggerOptions := []huh.Option[string]{
huh.NewOption("Manual trigger (workflow_dispatch)", "workflow_dispatch"),
Expand Down Expand Up @@ -287,6 +289,7 @@ func (b *InteractiveWorkflowBuilder) generateWorkflow(force bool) error {

// generateWorkflowContent creates the workflow markdown content
func (b *InteractiveWorkflowBuilder) generateWorkflowContent() string {
interactiveLog.Printf("Generating workflow content: engine=%s, tools=%v, outputs=%v", b.Engine, b.Tools, b.SafeOutputs)
var content strings.Builder

// Write frontmatter
Expand Down
2 changes: 2 additions & 0 deletions pkg/cli/trial_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func ensureTrialRepository(repoSlug string, cloneRepoSlug string, forceDeleteHos
}

func cleanupTrialRepository(repoSlug string, verbose bool) error {
trialRepoLog.Printf("Cleaning up trial repository: %s", repoSlug)
if verbose {
fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("Cleaning up host repository: %s", repoSlug)))
}
Expand All @@ -139,6 +140,7 @@ func cleanupTrialRepository(repoSlug string, verbose bool) error {
}

func cloneTrialHostRepository(repoSlug string, verbose bool) (string, error) {
trialRepoLog.Printf("Cloning trial host repository: %s", repoSlug)
// Create temporary directory
tempDir := filepath.Join(os.TempDir(), fmt.Sprintf("gh-aw-trial-%x", time.Now().UnixNano()))

Expand Down