Skip to content

Commit

Permalink
PMM-13082 Backwards compatibility with PMM v2 (#3227)
Browse files Browse the repository at this point in the history
* PMM-13082 Backward-compatibility with PMM 2 Client.

* PMM-13082 Strip prefixes, revert changes to collector.proto

* PMM-13082 remove unused proto imports

* PMM-13082 renumber agent_status.proto fields

* PMM-13082 fix the lint rules for pb/agent.proto pkg

* PMM-13082 fix the proto field numbers for AGENT_TYPE

* PMM-13082 fix the function comment

* PMM-13082 revert stripping the IDs

* PMM-13082 revert the text fix

* PMM-13082 revert slowlog_test fix

* PMM-13082 re-generate the code

* PMM-13082 fix agent_type in slowlog_test payload

* PMM-13082 leave a TODO comment

---------

Co-authored-by: Nurlan Moldomurov <[email protected]>
  • Loading branch information
ademidoff and BupycHuk authored Nov 12, 2024
1 parent 7852170 commit 6bfa326
Show file tree
Hide file tree
Showing 20 changed files with 1,118 additions and 792 deletions.
2 changes: 1 addition & 1 deletion agent/agents/mongodb/internal/profiler/profiler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func testProfiler(t *testing.T, url string) {
assert.Equal(t, "INSERT people", bucket.Common.Fingerprint)
assert.Equal(t, []string{"people"}, bucket.Common.Tables)
assert.Equal(t, "test-id", bucket.Common.AgentId)
assert.Equal(t, inventoryv1.AgentType(10), bucket.Common.AgentType)
assert.Equal(t, inventoryv1.AgentType(9), bucket.Common.AgentType)
expected := &agentv1.MetricsBucket_MongoDB{
MDocsReturnedCnt: docsCount,
MResponseLengthCnt: docsCount,
Expand Down
12 changes: 6 additions & 6 deletions agent/agents/mysql/slowlog/slowlog_expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"fingerprint": "select name, subsystem, type, comment, count from information_schema.innodb_metrics where status = ?",
"username": "root",
"agent_id": "73ee2f92-d5aa-45f0-8b09-6d3df605fd44",
"agent_type": 9,
"agent_type": 8,
"period_start_unix_secs": 1557137220,
"period_length_secs": 60,
"example": "SELECT\n\t\t name, subsystem, type, comment,\n\t\t count\n\t\t FROM information_schema.innodb_metrics\n\t\t WHERE status = 'enabled'",
Expand Down Expand Up @@ -52,7 +52,7 @@
"schema": "sbtest",
"username": "root",
"agent_id": "73ee2f92-d5aa-45f0-8b09-6d3df605fd44",
"agent_type": 9,
"agent_type": 8,
"period_start_unix_secs": 1557137220,
"period_length_secs": 60,
"example": "SELECT pad FROM sbtest1 WHERE id=775815",
Expand Down Expand Up @@ -95,7 +95,7 @@
"fingerprint": "ping",
"username": "root",
"agent_id": "73ee2f92-d5aa-45f0-8b09-6d3df605fd44",
"agent_type": 9,
"agent_type": 8,
"period_start_unix_secs": 1557137220,
"period_length_secs": 60,
"example": "Ping",
Expand Down Expand Up @@ -126,7 +126,7 @@
"fingerprint": "show global status",
"username": "root",
"agent_id": "73ee2f92-d5aa-45f0-8b09-6d3df605fd44",
"agent_type": 9,
"agent_type": 8,
"period_start_unix_secs": 1557137220,
"period_length_secs": 60,
"example": "SHOW GLOBAL STATUS",
Expand Down Expand Up @@ -170,7 +170,7 @@
"fingerprint": "set lock_wait_timeout=?",
"username": "root",
"agent_id": "73ee2f92-d5aa-45f0-8b09-6d3df605fd44",
"agent_type": 9,
"agent_type": 8,
"period_start_unix_secs": 1557137220,
"period_length_secs": 60,
"example": "SET lock_wait_timeout=2",
Expand Down Expand Up @@ -201,7 +201,7 @@
"fingerprint": "select @@version",
"username": "root",
"agent_id": "73ee2f92-d5aa-45f0-8b09-6d3df605fd44",
"agent_type": 9,
"agent_type": 8,
"period_start_unix_secs": 1557137220,
"period_length_secs": 60,
"example": "SELECT @@version",
Expand Down
83 changes: 83 additions & 0 deletions api/agent/pb/agent.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions api/agent/pb/agent.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions api/agent/pb/agent.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
syntax = "proto3";

package agent;

import "agent/v1/agent.proto";

option go_package = "api/agentpb;agentpb";

// Agent service provides private methods for pmm-agent <-> pmm-managed interactions.
service Agent {
// Connect establishes two-way communication channel between pmm-agent and pmm-managed.
rpc Connect(stream agent.v1.AgentMessage) returns (stream agent.v1.ServerMessage);
}
124 changes: 124 additions & 0 deletions api/agent/pb/agent_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6bfa326

Please sign in to comment.