You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I attempted to write an aspect that would automatically set up tracing for my nodeJS lambdas. I expected this would result in full instrumentation of these functions without multiple source file edits.
Actual Behavior
Aspect fails to apply with an error "We detected an Aspect was added via another Aspect, and will not be applied".
After much debugging, I've tracked this down to the use of Tags.of() in addCdkConstructVersionTag and setTags() calls starting here - Tags.of() is an aspect as well.
Has anybody else hit this, and did you work around it successfully? Has there been any thought or exploration into how to make the datadog construct aspect-compatible?
Although not ideal, I believe this can be solved by using something like construct.tags.setTag(key, value, 100, true) to set tags directly, rather than calling the aspect to do the same. There won't be much (any?) cascading of tags to child objects in this case, so really not much is lost.
Happy to make a PR if there is no objection.
The text was updated successfully, but these errors were encountered:
Hey @mhenniges - this library wasn't specifically written to be implemented to support an Aspect, but we'd happily look at any PR you'd submit for this. Thanks!
Hey @mhenniges - we just ran into the same problem 😄 Did you come up with any workaround for this yet?
Would be great if you could share any findings - thanks!
I believe the only other suggested way to add tags is with Tag.visit(), which appears to add the tag without making use of an Aspect (thus making it compatible from within another Aspect). I implemented this as a workaround (in python):
Expected Behavior
I attempted to write an aspect that would automatically set up tracing for my nodeJS lambdas. I expected this would result in full instrumentation of these functions without multiple source file edits.
Actual Behavior
Aspect fails to apply with an error "We detected an Aspect was added via another Aspect, and will not be applied".
Steps to Reproduce the Problem
Example aspect for datadog:
apply to stack with something like this:
Specifications
Stacktrace
After much debugging, I've tracked this down to the use of Tags.of() in addCdkConstructVersionTag and setTags() calls starting here - Tags.of() is an aspect as well.
Has anybody else hit this, and did you work around it successfully? Has there been any thought or exploration into how to make the datadog construct aspect-compatible?
Although not ideal, I believe this can be solved by using something like construct.tags.setTag(key, value, 100, true) to set tags directly, rather than calling the aspect to do the same. There won't be much (any?) cascading of tags to child objects in this case, so really not much is lost.
Happy to make a PR if there is no objection.
The text was updated successfully, but these errors were encountered: