Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds procfs-based per-PID /proc collection (cmdline/stat/status) and exposes it via the segment gRPC API, along with protobuf schema updates to carry the new data.
Changes:
- Introduces
internal/utils/procfs.goto read/proc/<pid>usinggithub.com/prometheus/procfsand map results into protobuf messages. - Adds a new gRPC handler in
internal/grpc/get_query_info.goto fetch per-PID proc information for requested segment processes. - Updates protobuf definitions/generated code to extend
GpPidProcInfopayload (includingstateandproc_io) and regenerates multiple pb.go files.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/utils/procfs.go | New procfs reader + mapping utilities to protobuf (GetPidProcInfo, conversions, cmdline parsing). |
| internal/utils/procfs_test.go | Unit tests for procfs parsing/mapping helpers and non-existent PID handling. |
| internal/utils/procfs_linux_test.go | Linux-only test validating GetPidProcInfo against the current process. |
| internal/grpc/get_query_info.go | Adds server handler intended to return proc info for a list of PIDs. |
| internal/grpc/get_query_info_test.go | Adds handler-level tests for nil/empty/non-existent PID requests and a test server helper. |
| internal/grpc/get_query_info_linux_test.go | Linux-only test validating proc info retrieval for the current process via the server handler. |
| api/proto/common/yagpcc_metrics.proto | Extends GpPidProcInfo schema (adds state, shifts fields, adds ProcIO). |
| api/proto/common/yagpcc_metrics.pb.go | Regenerated protobuf Go output reflecting GpPidProcInfo/ProcIO and related type changes. |
| api/proto/common/yagpcc_session.pb.go | Regenerated protobuf Go output (timestamp import/type changes). |
| api/proto/agent_segment/yagpcc_set_service_grpc.pb.go | Regenerated gRPC stubs (protoc version/header updates). |
| api/proto/agent_segment/yagpcc_set_service.pb.go | Regenerated protobuf Go output (timestamp import/type changes). |
| api/proto/agent_segment/yagpcc_get_service_grpc.pb.go | Regenerated gRPC stubs for GetQueryInfo service. |
| api/proto/agent_segment/yagpcc_get_service.pb.go | Regenerated protobuf Go output for GetQueryInfo messages. |
| api/proto/agent_segment/yagpcc_control_service_grpc.pb.go | Regenerated gRPC stubs (protoc version/header updates). |
| api/proto/agent_segment/yagpcc_control_service.pb.go | Regenerated protobuf Go output (timestamp import/type changes). |
| api/proto/agent_master/yagpcc_get_service_grpc.pb.go | Regenerated gRPC stubs (protoc version/header updates). |
| api/proto/agent_master/yagpcc_get_service.pb.go | Regenerated protobuf Go output (timestamp import/type changes). |
| api/proto/agent_master/yagpcc_action_service_grpc.pb.go | Regenerated gRPC stubs (emptypb import/type changes). |
| api/proto/agent_master/yagpcc_action_service.pb.go | Regenerated protobuf Go output (emptypb import/type changes). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
We use github.com/prometheus/procfs to get procfs stat
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/open-gpdb/yagpcc/sessions/9948624a-be81-4da1-8a11-d87d3b246f80 Co-authored-by: leborchuk <63977577+leborchuk@users.noreply.github.com>
Agent-Logs-Url: https://github.com/open-gpdb/yagpcc/sessions/6a34e218-f71b-462f-9a54-f59a5700fcdb Co-authored-by: leborchuk <63977577+leborchuk@users.noreply.github.com>
… range check Agent-Logs-Url: https://github.com/open-gpdb/yagpcc/sessions/8809c3c7-939b-4c9a-b1d8-f3165a0269ac Co-authored-by: leborchuk <63977577+leborchuk@users.noreply.github.com>
…y tests Agent-Logs-Url: https://github.com/open-gpdb/yagpcc/sessions/8809c3c7-939b-4c9a-b1d8-f3165a0269ac Co-authored-by: leborchuk <63977577+leborchuk@users.noreply.github.com>
700ce42 to
3826939
Compare
vovik0134
requested changes
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds procfs-based per-PID /proc collection (cmdline/stat/status) and exposes it via the segment gRPC API, along with protobuf schema updates to carry the new data.
Changes: