Skip to content

Add DEBUG or TRACE logging for get_aws_account_id() function #4389

@jan-clausen-klickrent

Description

@jan-clausen-klickrent

Describe the enhancement

Please add DEBUG or at least TRACE logging to the "get_aws_account_id()" function (e.g. here), so one can see in the logs (everytime) when this function is invoked and esspecially when it's execution is remarkable slow. Alternatively/Additionally I think it would also have helped me in my case (see context), if an additional TRACE log message like "evaluate local ${name}..." is added at e.g. https://github.com/gruntwork-io/terragrunt/blob/main/config/locals.go#L135 so one with any kind of performance issues while evaluating locals gets a better insight, which local(s) exactly might be problematic.

Additional context

I was struggeling with performance issues of my Terragrunt repository after doing some code-refactoring and cleanup there lately. While performance was good on my local machine, it turned out to be very slow on my EC2 machine which is used as a CI/CD agent. Increasing the log level revealed that the problem was somehow related to resolving the locals, and adding more dependencies between Terragrunt files to make their relations more explicit (which is a feature which make me love Terragrunt so much <3) decreased the performance even more. Finally after > 15 hours of debugging and research (I was even diving into the Terragrunt code to see what is going on when resolving locals and whether I have just poor CPU/memory/IO performance on my agent machine) it turned out, that I was facing the exact same problem as described in #3210. But getting to this point took me ages, and I think I could have saved a lot of time (and this might even be true for others which maybe just don't know they are facing a performance issue here as well) if seeing a small message in the logs like "resolving AWS account id" to get a hint that the code execution got stuck every time when invoking exactly this function (or when evaluating exactly that local which was performing the function invocation).

Thanks guys - Terragrunt really is a great tool and the work you are doing here is awesome <3

Things you might want to address include:

  • Changes required.
  • Implications of the feature.
  • Alternatives considered.
  • Level of effort.

PoC (Proof of Concept)

RFC Not Needed

  • [ X ] I have evaluated the complexity of this enhancement, and I believe it does not require an RFC.

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributions-requestedRequesting contributions from the communityenhancementNew feature or requestpreservedPreserved issues never go stale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions