Skip to content

[plan] Split gateway_logs.go by concern #26266

@github-actions

Description

@github-actions

Objective

Split pkg/cli/gateway_logs.go (1,066 lines) into concern-aligned files.

Context

Discussion: #26221

This file mixes four independent concerns: type definitions, RPC message parsing, gateway log parsing, MCP tool-call extraction, and aggregation.

Approach

  • gateway_logs_types.go — all type/struct definitions
  • gateway_logs_rpc.goparseRPCMessages, findRPCMessagesPath, buildToolCallsFromRPCMessages
  • gateway_logs_parsing.goparseGatewayLogs, processGatewayLogEntry, getOrCreateServer, getOrCreateTool
  • gateway_logs_aggregation.gocalculateGatewayAggregates, buildGuardPolicySummary
  • gateway_logs_mcp.goextractMCPToolUsageData

Files to Modify

  • Split: pkg/cli/gateway_logs.go
  • Create: pkg/cli/gateway_logs_types.go
  • Create: pkg/cli/gateway_logs_rpc.go
  • Create: pkg/cli/gateway_logs_parsing.go
  • Create: pkg/cli/gateway_logs_aggregation.go
  • Create: pkg/cli/gateway_logs_mcp.go

Acceptance Criteria

  • Original gateway_logs.go is ≤ 300 lines (or removed if entirely replaced)
  • Each new file is ≤ 300 lines
  • make build && make test-unit pass without errors
  • make fmt && make lint pass without errors

Generated by Plan Command for issue #discussion #26221 · ● 150.1K ·

  • expires on Apr 16, 2026, 5:18 PM UTC

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions