Skip to content

Commit

Permalink
Add DiscoveryConfigStatus AWS EC2 resource counters (proto) (#45553)
Browse files Browse the repository at this point in the history
* Add DiscoveryConfigStatus AWS EC2 resource counters (proto)

This PR adds counters for AWS Instances found/enrolled/failed for a
given DiscoveryConfig and Integration.

* use a map to index on the integration name
  • Loading branch information
marcoandredinis committed Aug 27, 2024
1 parent 137b9b5 commit 86cba91
Show file tree
Hide file tree
Showing 2 changed files with 243 additions and 29 deletions.
249 changes: 220 additions & 29 deletions api/gen/proto/go/teleport/discoveryconfig/v1/discoveryconfig.pb.go

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

23 changes: 23 additions & 0 deletions api/proto/teleport/discoveryconfig/v1/discoveryconfig.proto
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ message DiscoveryConfigStatus {
uint64 discovered_resources = 3;
// last_sync_time is the timestamp when the Discovery Config was last sync.
google.protobuf.Timestamp last_sync_time = 4;

reserved 5;
reserved "aws_ec2_instances_discovered";

// IntegrationDiscoveredResources maps an integration to discovered resources summary.
map<string, IntegrationDiscoveredSummary> integration_discovered_resources = 6;
}

// DiscoveryConfigState is the state of the discovery config resource.
Expand All @@ -80,3 +86,20 @@ enum DiscoveryConfigState {
// DISCOVERY_CONFIG_STATE_SYNCING is used when the discovery process has started but didn't finished yet.
DISCOVERY_CONFIG_STATE_SYNCING = 3;
}

// IntegrationDiscoveredSummary contains the a summary for each resource type that was discovered.
message IntegrationDiscoveredSummary {
// AWSEC2 contains the summary for the AWS EC2 discovered instances.
ResourcesDiscoveredSummary aws_ec2 = 1;
}

// ResourcesDiscoveredSummary represents the AWS resources that were discovered.
message ResourcesDiscoveredSummary {
// Found holds the count of resources found.
// After a resource is found, it starts the sync process and ends in either an enrolled or a failed resource.
uint64 found = 1;
// Enrolled holds the count of the resources that were successfully enrolled.
uint64 enrolled = 2;
// Failed holds the count of the resources that failed to enroll.
uint64 failed = 3;
}

0 comments on commit 86cba91

Please sign in to comment.