gruntwork-io / terragrunt

Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale.
https://terragrunt.gruntwork.io/
MIT License
8.06k stars 980 forks source link

Opentelemetry Logs #3440

Open uptickmetachu opened 1 month ago

uptickmetachu commented 1 month ago

Describe the enhancement

Add support for opentelemetry logs.

Traces are very helpful but it would be even better if we can also view the logs for a specific trace / module execution.

yhakbar commented 2 weeks ago

Hey @uptickmetachu ,

This seems like a very sensible ask. Do you mind providing more context in the form of design considerations? What would need to be done, in your mind, to have this enhancement delivered?

uptickmetachu commented 2 weeks ago

Terraform and opentofu both support json logging https://opentofu.org/docs/internals/debugging/ https://developer.hashicorp.com/terraform/internals/debugging

What I envision is the terragrunt process captures the json log outputs from opentofu and terraform and inject extra tracing metadata such as:

The end goal would be able to see all the logs of a terragrunt apply-all or of individual runs.

A user should be able to find logs for all terraform applys to an individual module (for auditing / debugging)