Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMM-12290 Comments parsing for RDS. #2756

Merged
merged 5 commits into from
Jan 17, 2024
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
3 changes: 3 additions & 0 deletions api/managementpb/json/client/rds/add_rds_responses.go

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

5 changes: 5 additions & 0 deletions api/managementpb/json/managementpb.json
Original file line number Diff line number Diff line change
Expand Up @@ -5167,6 +5167,11 @@
"type": "boolean",
"x-order": 24
},
"disable_comments_parsing": {
"description": "Disable parsing comments from queries and showing them in QAN.",
"type": "boolean",
"x-order": 31
},
"disable_enhanced_metrics": {
"description": "Disable enhanced metrics.",
"type": "boolean",
Expand Down
170 changes: 91 additions & 79 deletions api/managementpb/rds.pb.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions api/managementpb/rds.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/managementpb/rds.proto
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ message AddRDSRequest {
string database = 30;
// Limit of databases for auto-discovery.
int32 auto_discovery_limit = 31;
// Disable parsing comments from queries and showing them in QAN.
bool disable_comments_parsing = 32;
}

message AddRDSResponse {
Expand Down
5 changes: 5 additions & 0 deletions api/swagger/swagger-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -29129,6 +29129,11 @@
"type": "integer",
"format": "int32",
"x-order": 30
},
"disable_comments_parsing": {
"description": "Disable parsing comments from queries and showing them in QAN.",
"type": "boolean",
"x-order": 31
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions api/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -20312,6 +20312,11 @@
"type": "integer",
"format": "int32",
"x-order": 30
},
"disable_comments_parsing": {
"description": "Disable parsing comments from queries and showing them in QAN.",
"type": "boolean",
"x-order": 31
}
}
}
Expand Down
32 changes: 17 additions & 15 deletions managed/services/management/rds.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,14 @@ func (s *RDSService) AddRDS(ctx context.Context, req *managementpb.AddRDSRequest
// add MySQL PerfSchema QAN Agent
if req.QanMysqlPerfschema {
qanAgent, err := models.CreateAgent(tx.Querier, models.QANMySQLPerfSchemaAgentType, &models.CreateAgentParams{
PMMAgentID: models.PMMServerAgentID,
ServiceID: service.ServiceID,
Username: req.Username,
Password: req.Password,
TLS: req.Tls,
TLSSkipVerify: req.TlsSkipVerify,
QueryExamplesDisabled: req.DisableQueryExamples,
PMMAgentID: models.PMMServerAgentID,
ServiceID: service.ServiceID,
Username: req.Username,
Password: req.Password,
TLS: req.Tls,
TLSSkipVerify: req.TlsSkipVerify,
QueryExamplesDisabled: req.DisableQueryExamples,
CommentsParsingDisabled: req.DisableCommentsParsing,
})
if err != nil {
return err
Expand Down Expand Up @@ -446,16 +447,17 @@ func (s *RDSService) AddRDS(ctx context.Context, req *managementpb.AddRDSRequest
}
}

// add MySQL PerfSchema QAN Agent
// add PostgreSQL Pgstatements QAN Agent
if req.QanPostgresqlPgstatements {
qanAgent, err := models.CreateAgent(tx.Querier, models.QANPostgreSQLPgStatementsAgentType, &models.CreateAgentParams{
PMMAgentID: models.PMMServerAgentID,
ServiceID: service.ServiceID,
Username: req.Username,
Password: req.Password,
TLS: req.Tls,
TLSSkipVerify: req.TlsSkipVerify,
QueryExamplesDisabled: req.DisableQueryExamples,
PMMAgentID: models.PMMServerAgentID,
ServiceID: service.ServiceID,
Username: req.Username,
Password: req.Password,
TLS: req.Tls,
TLSSkipVerify: req.TlsSkipVerify,
QueryExamplesDisabled: req.DisableQueryExamples,
CommentsParsingDisabled: req.DisableCommentsParsing,
})
if err != nil {
return err
Expand Down
Loading