Skip to content

Commit

Permalink
feat: add new agent.proto func
Browse files Browse the repository at this point in the history
  • Loading branch information
jin-xiaofeng authored and askyrie committed Oct 23, 2024
1 parent c582bd6 commit 4464b2b
Show file tree
Hide file tree
Showing 52 changed files with 9,389 additions and 97 deletions.
625 changes: 625 additions & 0 deletions cli/ctl/agent_check.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions cli/ctl/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func Execute(version string) {
root.AddCommand(RegisterPluginCommand())
root.AddCommand(RegisterPrometheusCommand())
root.AddCommand(RegisterPromQLCommand())
root.AddCommand(AgentCheckRegisterCommand())

cmd.RegisterIngesterCommand(root)

Expand Down
18 changes: 7 additions & 11 deletions message/agent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ service Synchronizer {
rpc KubernetesAPISync(KubernetesAPISyncRequest) returns (KubernetesAPISyncResponse) {}
rpc GetKubernetesClusterID(KubernetesClusterIDRequest) returns (KubernetesClusterIDResponse) {}
rpc GPIDSync(GPIDSyncRequest) returns (GPIDSyncResponse) {}
rpc ShareGPIDLocalData(ShareGPIDSyncRequests) returns (ShareGPIDSyncRequests) {}
rpc Plugin(PluginRequest) returns (stream PluginResponse) {}
// because gRPC cannot be initiated by server, the req/resp of this rpc is reversed
rpc RemoteExecute(stream RemoteExecResponse) returns (stream RemoteExecRequest) {}
Expand All @@ -25,7 +26,6 @@ service Debug {
rpc DebugGPIDAgentData(GPIDSyncRequest) returns (GPIDAgentData) {}
rpc DebugRealGlobalData(GPIDSyncRequest) returns (RealGlobalData) {}
rpc DebugRIPToVIP(GPIDSyncRequest) returns (RVData) {}
rpc DebugAgentCache(AgentCacheRequest) returns (AgentCacheResponse) {}
}

enum AgentType {
Expand Down Expand Up @@ -622,6 +622,12 @@ enum GPIDSyncCompressAlgorithm {
COMPRESS_ALGO_IGNORE_IF_EQUAL_TO_PREVIOUS = 1;
}

message ShareGPIDSyncRequests {
optional string server_ip = 1;
repeated GPIDSyncRequest sync_requests = 2;
optional uint32 org_id = 3;
}

message GPIDSyncRequest {
optional string ctrl_ip = 1;
optional string ctrl_mac = 2;
Expand Down Expand Up @@ -698,16 +704,6 @@ message GPIDAgentData {
optional GPIDSyncRequest sync_request = 2;
}

message AgentCacheRequest {
optional string ctrl_ip = 1;
optional string ctrl_mac = 2;
optional string team_id = 3; // agent team identity
}

message AgentCacheResponse {
optional bytes content = 1; // json数据
}

message AgentId {
optional string ip = 1;
optional string mac = 2;
Expand Down
2 changes: 1 addition & 1 deletion server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ generated_libs = libs/hmap/idmap/ubig_id_map.go libs/hmap/idmap/ubig_id_map_test
libs/hmap/lru/ubig_lru.go libs/hmap/lru/ubig_lru_test.go \
libs/flow-metrics/pooled_meters.go libs/kubernetes/watcher.gen.go

proto = vendor/${MESSAGE}/common/common.pb.go vendor/${MESSAGE}/trident/trident.pb.go vendor/${MESSAGE}/agent/agent.pb.go vendor/${MESSAGE}/controller/controller.pb.go vendor/${MESSAGE}/alert_event/alert_event.pb.go vendor/${MESSAGE}/k8s_event/k8s_event.pb.go libs/datatype/pb/flow_log.pb.go libs/flow-metrics/pb/metric.pb.go libs/stats/pb/stats.pb.go
proto = vendor/${MESSAGE}/common/common.pb.go vendor/${MESSAGE}/trident/trident.pb.go vendor/${MESSAGE}/agent/agent.pb.go vendor/${MESSAGE}/controller/controller.pb.go vendor/${MESSAGE}/alert_event/alert_event.pb.go vendor/${MESSAGE}/k8s_event/k8s_event.pb.go libs/datatype/pb/flow_log.pb.go libs/flow-metrics/pb/metric.pb.go libs/stats/pb/stats.pb.go

$(generated_libs): $(generate_sources)
go generate ./...
Expand Down
Loading

0 comments on commit 4464b2b

Please sign in to comment.