What
RunLogsService.TailLogs (runs/service/run_logs_service.go:44) and dataproxy.Service.TailLogs (dataproxy/service/dataproxy_service.go:503) are essentially doing the same thing:
- Resolve the
LogContext for the given action attempt.
- Hand it to a
LogStreamer which streams pod logs back to the client.
The canonical home for this is now the DataProxy service. The RunLogsService.TailLogs RPC is only kept for backward compatibility with existing clients.
Why
Today both services:
- Depend on a
LogStreamer implementation (runs/service/k8s_log_streamer.go and dataproxy/logs/k8s_log_streamer.go — two copies).
- Implement their own concurrency limit / context resolution code path.
- Must be kept in sync whenever we evolve log streaming behavior (filtering, pagination, new backends, auth, etc.).
This is duplicate surface area with no good reason now that DataProxy owns logs.
Proposed change
Refactor RunLogsService.TailLogs into a thin shim that forwards to DataProxyServiceClient.TailLogs:
- Inject a
dataproxyconnect.DataProxyServiceClient into RunLogsService instead of (or in addition to) the LogStreamer.
- In
TailLogs:
- Validate
action_id / acquire the concurrency semaphore as today.
- Open a client stream to
DataProxyService.TailLogs with the same action_id + attempt.
- Forward each
dataproxy.TailLogsResponse chunk to the outbound workflow.TailLogsResponse stream (converting the proto message — the schemas need to be checked for 1:1 field compatibility).
- Delete
runs/service/k8s_log_streamer.go and its test once the delegation is in place; DataProxy's logs/k8s_log_streamer.go becomes the single implementation.
- Keep the
runs RPC registered so existing clients keep working.
Open questions
- Response proto shape: confirm
workflow.TailLogsResponse and dataproxy.TailLogsResponse are structurally compatible, or define a small converter.
- Wiring: the run service will need to be given a DataProxy client at startup (likely the in-process one in the all-in-one binary).
- Concurrency limit: decide whether the
defaultMaxConcurrentStreams semaphore stays on the run-service shim, moves entirely to DataProxy, or both.
References
runs/service/run_logs_service.go:44-61 — current run-service TailLogs
dataproxy/service/dataproxy_service.go:503-520 — DataProxy TailLogs (target delegate)
runs/service/k8s_log_streamer.go / dataproxy/logs/k8s_log_streamer.go — duplicated streamer impls
What
RunLogsService.TailLogs(runs/service/run_logs_service.go:44) anddataproxy.Service.TailLogs(dataproxy/service/dataproxy_service.go:503) are essentially doing the same thing:LogContextfor the given action attempt.LogStreamerwhich streams pod logs back to the client.The canonical home for this is now the DataProxy service. The
RunLogsService.TailLogsRPC is only kept for backward compatibility with existing clients.Why
Today both services:
LogStreamerimplementation (runs/service/k8s_log_streamer.goanddataproxy/logs/k8s_log_streamer.go— two copies).This is duplicate surface area with no good reason now that DataProxy owns logs.
Proposed change
Refactor
RunLogsService.TailLogsinto a thin shim that forwards toDataProxyServiceClient.TailLogs:dataproxyconnect.DataProxyServiceClientintoRunLogsServiceinstead of (or in addition to) theLogStreamer.TailLogs:action_id/ acquire the concurrency semaphore as today.DataProxyService.TailLogswith the sameaction_id+attempt.dataproxy.TailLogsResponsechunk to the outboundworkflow.TailLogsResponsestream (converting the proto message — the schemas need to be checked for 1:1 field compatibility).runs/service/k8s_log_streamer.goand its test once the delegation is in place; DataProxy'slogs/k8s_log_streamer.gobecomes the single implementation.runsRPC registered so existing clients keep working.Open questions
workflow.TailLogsResponseanddataproxy.TailLogsResponseare structurally compatible, or define a small converter.defaultMaxConcurrentStreamssemaphore stays on the run-service shim, moves entirely to DataProxy, or both.References
runs/service/run_logs_service.go:44-61— current run-service TailLogsdataproxy/service/dataproxy_service.go:503-520— DataProxy TailLogs (target delegate)runs/service/k8s_log_streamer.go/dataproxy/logs/k8s_log_streamer.go— duplicated streamer impls