cdk-monitoring-constructs icon indicating copy to clipboard operation
cdk-monitoring-constructs copied to clipboard

[core] Select resources to monitor based on tags

Open pchaganti opened this issue 3 years ago • 7 comments

Feature scope

Any Namespace

Describe your suggested feature

Is it possible to select resources to monitor based on tags? Looked at the docs but did not see any way to do it.

thanks!

pchaganti avatar Mar 26 '22 15:03 pchaganti

Hello! Great idea, can you please give us a specific example? It this more related about Aspects, or the monitoring in general?

voho avatar Mar 27 '22 10:03 voho

Lets say I have a project that uses ECS, Dynamo and ALB. When I build the monitoring stack, I would like to only select resources that match a certain tag (which is specific to the project). I dont want to select and monitor all ECS clusters, just specific ones. I looked at aspects, they seem to be more about validations or decorating with tags. Does this help?

thanks!

pchaganti avatar Mar 27 '22 12:03 pchaganti

Let me know if I got it right. So, instead of using .monitorEcs(ecs1) and .monitorEcs(ecs2), you would prefer to call something like monitorEcsWithTag(tag1), which would iterate over all tagged ECS clusters and generating a monitoring for them?

voho avatar Mar 27 '22 19:03 voho

Yes! If this is not too specific a usecase, would love to see something like this added.

pchaganti avatar Mar 27 '22 21:03 pchaganti

OK, got the idea. I like it very much to be honest and would like to implement it. I just need to think about how to balance between this, monitoring, and Aspect, since this look exactly like Aspect with additional filtering. Integrating the aspect more tightly with the facade and leveraging it for this might also be a solution.

voho avatar Mar 30 '22 07:03 voho

The idea is really cool. But the problem that I see is that CDK does not provide any way to identify/import/filter a resource based on just tags (at least I could not find one). Therefore we cannot use Aspects for this since the node does not have anything that we can check for tags.

ayush987goyal avatar Mar 30 '22 08:03 ayush987goyal

That is true, so far I have not found any way to get tags for the given resource. I do not understand why there is no read API for it :).

voho avatar Aug 23 '22 15:08 voho