Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified api/descriptor.bin
Binary file not shown.
20 changes: 16 additions & 4 deletions api/management/v1/azure.pb.go

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

2 changes: 2 additions & 0 deletions api/management/v1/azure.pb.validate.go

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

2 changes: 2 additions & 0 deletions api/management/v1/azure.proto
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ message AddAzureDatabaseRequest {
google.protobuf.Duration connection_timeout = 26 [(validate.rules).duration = {
gte: {seconds: 0}
}];
// The pmm-agent identifier which should run agents. Defaults to the PMM Server's own pmm-agent.
string pmm_agent_id = 27;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}

message AddAzureDatabaseResponse {}

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

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

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

15 changes: 15 additions & 0 deletions api/management/v1/json/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,11 @@
"description": "True if this node is a PMM Server node (HA mode).",
"type": "boolean",
"x-order": 18
},
"is_pmm_internal_node": {
"description": "True if this node belongs to the internal infrastructure of a PMM deployment\n(e.g. the HA persistence layer) and must not host user monitoring workloads.",
"type": "boolean",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
"x-order": 19
}
}
},
Expand Down Expand Up @@ -1360,6 +1365,11 @@
"description": "True if this node is a PMM Server node (HA mode).",
"type": "boolean",
"x-order": 18
},
"is_pmm_internal_node": {
"description": "True if this node belongs to the internal infrastructure of a PMM deployment\n(e.g. the HA persistence layer) and must not host user monitoring workloads.",
"type": "boolean",
"x-order": 19
}
},
"x-order": 0
Expand Down Expand Up @@ -7131,6 +7141,11 @@
"description": "Connection timeout for exporter (if set).",
"type": "string",
"x-order": 25
},
"pmm_agent_id": {
"description": "The pmm-agent identifier which should run agents. Defaults to the PMM Server's own pmm-agent.",
"type": "string",
"x-order": 26
}
}
}
Expand Down
19 changes: 15 additions & 4 deletions api/management/v1/node.pb.go

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

2 changes: 2 additions & 0 deletions api/management/v1/node.pb.validate.go

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

3 changes: 3 additions & 0 deletions api/management/v1/node.proto
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ message UniversalNode {
string instance_id = 18;
// True if this node is a PMM Server node (HA mode).
bool is_pmm_server_node = 19;
// True if this node belongs to the internal infrastructure of a PMM deployment
// (e.g. the HA persistence layer) and must not host user monitoring workloads.
bool is_pmm_internal_node = 20;
}

message ListNodesRequest {
Expand Down
15 changes: 15 additions & 0 deletions api/swagger/swagger-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -22326,6 +22326,11 @@
"description": "True if this node is a PMM Server node (HA mode).",
"type": "boolean",
"x-order": 18
},
"is_pmm_internal_node": {
"description": "True if this node belongs to the internal infrastructure of a PMM deployment\n(e.g. the HA persistence layer) and must not host user monitoring workloads.",
"type": "boolean",
"x-order": 19
}
}
},
Expand Down Expand Up @@ -22883,6 +22888,11 @@
"description": "True if this node is a PMM Server node (HA mode).",
"type": "boolean",
"x-order": 18
},
"is_pmm_internal_node": {
"description": "True if this node belongs to the internal infrastructure of a PMM deployment\n(e.g. the HA persistence layer) and must not host user monitoring workloads.",
"type": "boolean",
"x-order": 19
}
},
"x-order": 0
Expand Down Expand Up @@ -28654,6 +28664,11 @@
"description": "Connection timeout for exporter (if set).",
"type": "string",
"x-order": 25
},
"pmm_agent_id": {
"description": "The pmm-agent identifier which should run agents. Defaults to the PMM Server's own pmm-agent.",
"type": "string",
"x-order": 26
}
}
}
Expand Down
15 changes: 15 additions & 0 deletions api/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -21353,6 +21353,11 @@
"description": "True if this node is a PMM Server node (HA mode).",
"type": "boolean",
"x-order": 18
},
"is_pmm_internal_node": {
"description": "True if this node belongs to the internal infrastructure of a PMM deployment\n(e.g. the HA persistence layer) and must not host user monitoring workloads.",
"type": "boolean",
"x-order": 19
}
}
},
Expand Down Expand Up @@ -21910,6 +21915,11 @@
"description": "True if this node is a PMM Server node (HA mode).",
"type": "boolean",
"x-order": 18
},
"is_pmm_internal_node": {
"description": "True if this node belongs to the internal infrastructure of a PMM deployment\n(e.g. the HA persistence layer) and must not host user monitoring workloads.",
"type": "boolean",
"x-order": 19
}
},
"x-order": 0
Expand Down Expand Up @@ -27681,6 +27691,11 @@
"description": "Connection timeout for exporter (if set).",
"type": "string",
"x-order": 25
},
"pmm_agent_id": {
"description": "The pmm-agent identifier which should run agents. Defaults to the PMM Server's own pmm-agent.",
"type": "string",
"x-order": 26
Comment thread
ademidoff marked this conversation as resolved.
}
}
}
Expand Down
22 changes: 22 additions & 0 deletions managed/cmd/pmm-managed/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,20 @@
versionCache *versioncache.Service
vmdb *victoriametrics.Service
vmalert *vmalert.Service
internalNodePrefixes []string
}

// parseNodeNamePrefixes splits a comma-separated list of Node name prefixes.
func parseNodeNamePrefixes(value string) []string {
var prefixes []string
for p := range strings.SplitSeq(value, ",") {
p = strings.TrimSpace(p)
if p != "" {
prefixes = append(prefixes, p)
}
}

return prefixes
}

// runGRPCServer runs gRPC server until context is canceled, then gracefully stops it.
Expand Down Expand Up @@ -304,6 +318,8 @@
deps.db, deps.agentsRegistry, deps.agentsStateUpdater,
deps.connectionCheck, deps.serviceInfoBroker, deps.vmdb,
deps.versionCache, deps.grafanaClient, v1.NewAPI(*deps.vmClient),
deps.internalNodePrefixes,
deps.ha.Params().Enabled,
)

managementv1.RegisterManagementServiceServer(gRPCServer, managementSvc)
Expand Down Expand Up @@ -571,7 +587,7 @@
deps.l.Warnf("Failed to get settings: %s.", err)
return false
}
err = deps.supervisord.UpdateConfiguration(settings)

Check failure on line 590 in managed/cmd/pmm-managed/main.go

View workflow job for this annotation

GitHub Actions / Checks

Function `UpdateConfiguration->saveConfigAndReload->saveConfigAndReload$1->reload` should pass the context parameter (contextcheck)
if err != nil {
deps.l.Warnf("Failed to update supervisord configuration: %s.", err)
return false
Expand Down Expand Up @@ -743,6 +759,11 @@
Default("9762").
Int()

internalNodePrefixesF := kingpin.Flag("internal-node-name-prefixes",
"Comma-separated list of Node name prefixes reserved for the internal infrastructure of this PMM deployment").
Envar("PMM_INTERNAL_NODE_NAME_PREFIXES").
String()

supervisordConfigDirF := kingpin.Flag("supervisord-config-dir", "Supervisord configuration directory").Required().String()

logLevelF := kingpin.Flag("log-level", "Set logging level").Envar("PMM_LOG_LEVEL").Default("info").Enum("trace", "debug", "info", "warn", "error", "fatal")
Expand Down Expand Up @@ -1192,6 +1213,7 @@
grafanaClient: grafanaClient,
handler: agentsHandler,
ha: haService,
internalNodePrefixes: parseNodeNamePrefixes(*internalNodePrefixesF),
jobsService: jobsService,
minioClient: minioClient,
pbmPITRService: pbmPITRService,
Expand Down
14 changes: 14 additions & 0 deletions managed/cmd/pmm-managed/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,17 @@ func formatPkgName(t *testing.T, name string) string {

return name
}

func TestParseNodeNamePrefixes(t *testing.T) {
for _, tc := range []struct {
value string
expected []string
}{
{value: "", expected: nil},
{value: ",,", expected: nil},
{value: "pmm-pmm-ha-pg-db-", expected: []string{"pmm-pmm-ha-pg-db-"}},
{value: " pmm-pmm-ha-pg-db- , pmm-pmm-ha-ch- ", expected: []string{"pmm-pmm-ha-pg-db-", "pmm-pmm-ha-ch-"}},
} {
assert.Equal(t, tc.expected, parseNodeNamePrefixes(tc.value), tc.value)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestAddServiceExporterTimeout(t *testing.T) {
vmClient.AssertExpectations(t)
})

s := NewManagementService(db, ar, state, cc, sib, vmdb, vc, grafanaClient, vmClient)
s := NewManagementService(db, ar, state, cc, sib, vmdb, vc, grafanaClient, vmClient, nil, false)
want := durationpb.New(17 * time.Second)

t.Run("MySQL", func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion managed/services/management/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func setup(t *testing.T) (context.Context, *ManagementService, func(t *testing.T
vmClient.AssertExpectations(t)
}

s := NewManagementService(db, ar, state, cc, sib, vmdb, vc, grafanaClient, vmClient)
s := NewManagementService(db, ar, state, cc, sib, vmdb, vc, grafanaClient, vmClient, nil, false)

return ctx, s, teardown
}
Expand Down
2 changes: 1 addition & 1 deletion managed/services/management/annotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func TestAnnotations(t *testing.T) {
vmClient := &mockVictoriaMetricsClient{}
vmClient.Test(t)

s := NewManagementService(db, ar, state, cc, sib, vmdb, vc, grafanaClient, vmClient)
s := NewManagementService(db, ar, state, cc, sib, vmdb, vc, grafanaClient, vmClient, nil, false)

teardown := func(t *testing.T) {
t.Helper()
Expand Down
Loading
Loading