Skip to content

Commit

Permalink
Revert "Revert "PMM-5777 Inventory add external exporter endpoint."" (#…
Browse files Browse the repository at this point in the history
…523)

* Revert "Revert "PMM-5777 Inventory add external exporter endpoint. (#516)""

This reverts commit bd0fb8d.

* PMM-5777 Rename metric_path to metrics_path.

Co-authored-by: Nurlan Moldomurov <[email protected]>
  • Loading branch information
AlekSi and BupycHuk authored May 5, 2020
1 parent 9d73153 commit f0ed62d
Show file tree
Hide file tree
Showing 26 changed files with 3,409 additions and 460 deletions.
1 change: 1 addition & 0 deletions api/inventorypb/agents.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ func (*QANMySQLSlowlogAgent) sealedAgent() {}
func (*QANMongoDBProfilerAgent) sealedAgent() {}
func (*QANPostgreSQLPgStatementsAgent) sealedAgent() {}
func (*RDSExporter) sealedAgent() {}
func (*ExternalExporter) sealedAgent() {}
978 changes: 719 additions & 259 deletions api/inventorypb/agents.pb.go

Large diffs are not rendered by default.

156 changes: 156 additions & 0 deletions api/inventorypb/agents.pb.gw.go

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

87 changes: 86 additions & 1 deletion api/inventorypb/agents.proto
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ message PostgresExporter {
uint32 listen_port = 10;
}

// ProxySQLExporter runs on Generic or Container Node and exposes MySQL Service metrics.
// ProxySQLExporter runs on Generic or Container Node and exposes ProxySQL Service metrics.
message ProxySQLExporter {
// Unique randomly generated instance identifier.
string agent_id = 1;
Expand Down Expand Up @@ -325,6 +325,28 @@ message RDSExporter {
bool enhanced_metrics_disabled = 10;
}

// ExternalExporter runs on any Node type, including Remote Node.
message ExternalExporter {
// Unique randomly generated instance identifier.
string agent_id = 1;
// Node identifier where this instance runs.
string runs_on_node_id = 2;
// If disabled, metrics from this exporter will not be collected.
bool disabled = 3;
// Service identifier.
string service_id = 4;
// HTTP basic auth username for collecting metrics.
string username = 5;
// Scheme to generate URI to exporter metrics endpoints.
string scheme = 6;
// Path under which metrics are exposed, used to generate URI.
string metrics_path = 7;
// Custom user-assigned labels.
map<string, string> custom_labels = 10;
// Listen port for scraping metrics.
uint32 listen_port = 8;
}

// ChangeCommonAgentParams contains parameters that can be changed for all Agents.
message ChangeCommonAgentParams {
// Enable this Agent. Can't be used with disabled.
Expand Down Expand Up @@ -366,6 +388,7 @@ message ListAgentsResponse {
repeated QANMongoDBProfilerAgent qan_mongodb_profiler_agent = 9;
repeated QANPostgreSQLPgStatementsAgent qan_postgresql_pgstatements_agent = 10;
repeated RDSExporter rds_exporter = 11;
repeated ExternalExporter external_exporter = 12;
}

// Get
Expand All @@ -392,6 +415,7 @@ message GetAgentResponse {
QANMongoDBProfilerAgent qan_mongodb_profiler_agent = 9;
QANPostgreSQLPgStatementsAgent qan_postgresql_pgstatements_agent = 10;
RDSExporter rds_exporter = 11;
ExternalExporter external_exporter = 12;
}
}

Expand Down Expand Up @@ -893,6 +917,53 @@ message ChangeRDSExporterResponse {
RDSExporter rds_exporter = 1;
}

// Add/Change ExternalExporter

message AddExternalExporterRequest {
// The node identifier where this instance is run.
string runs_on_node_id = 1 [
(validator.field) = {
string_not_empty: true
}
];
// Service identifier.
string service_id = 2;
// HTTP basic auth username for collecting metrics.
string username = 3;
// HTTP basic auth password for collecting metrics.
string password = 4;
// Scheme to generate URI to exporter metrics endpoints(default: http).
string scheme = 6;
// Path under which metrics are exposed, used to generate URI(default: /metrics).
string metrics_path = 7;
// Listen port for scraping metrics.
uint32 listen_port = 8 [
(validator.field) = {
int_gt: 0
int_lt: 65536
}
];
// Custom user-assigned labels.
map<string, string> custom_labels = 10;
}

message AddExternalExporterResponse {
ExternalExporter external_exporter = 1;
}

message ChangeExternalExporterRequest {
string agent_id = 1 [
(validator.field) = {
string_not_empty: true
}
];
ChangeCommonAgentParams common = 2;
}

message ChangeExternalExporterResponse {
ExternalExporter external_exporter = 1;
}

// Remove

message RemoveAgentRequest {
Expand Down Expand Up @@ -1070,6 +1141,20 @@ service Agents {
body: "*"
};
}
// AddExternalExporter adds external_exporter Agent.
rpc AddExternalExporter(AddExternalExporterRequest) returns (AddExternalExporterResponse) {
option (google.api.http) = {
post: "/v1/inventory/Agents/AddExternalExporter"
body: "*"
};
}
// ChangeExternalExporter changes external_exporter Agent.
rpc ChangeExternalExporter(ChangeExternalExporterRequest) returns (ChangeExternalExporterResponse) {
option (google.api.http) = {
post: "/v1/inventory/Agents/ChangeExternalExporter"
body: "*"
};
}
// RemoveAgent removes Agent.
rpc RemoveAgent(RemoveAgentRequest) returns (RemoveAgentResponse) {
option (google.api.http) = {
Expand Down
Loading

0 comments on commit f0ed62d

Please sign in to comment.