- Notifications
You must be signed in to change notification settings - Fork1.1k
feat: add more detailed init timings in build timeline#20503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
provisioner/terraform/inittimings.go Outdated
| // resourceName maps init message codes to human-readable resource names. | ||
| // This is purely for better readability in the timing spans. | ||
| resourceName=map[initMessageCode]string{ | ||
| initInitializingBackendMessage:"Backend", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Can you stick to the existing naming convention which is all lowercase?
Also I think we need to be more explicit about the stages. What does "Backend" mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Made it lowercase 👍
I agreebackend is an unfortunate name, but it is the proper TF term.
https://developer.hashicorp.com/terraform/language/backend
For Coder,backend means thetfstate file. That is it.
This timing would likely be longer if you were using an aws s3 backend for instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I want to spend time on the build timeline in the UI more. I would like it to also go 1 more hierarchical depth.
Will defer to future work on that though
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
| // The combination of resource and provider names MUST be unique across entries. | ||
| func (e*timingSpan)hashByState(state proto.TimingState)uint64 { | ||
| id:=fmt.Sprintf("%s:%s:%s:%s:%s",e.kind.Category(),state.String(),e.action,e.resource,e.provider) | ||
| ife.messageCode!="" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Nit: we probably need to make this a slice and join with the delimiter.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
924afb7 intomainUh oh!
There was an error while loading.Please reload this page.
| var ( | ||
| version170=version.Must(version.NewVersion("1.7.0")) | ||
| version190=version.Must(version.NewVersion("1.9.0")) | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Terraform versions below 1.12 are already EOL. We also bundle Terraform in the official image. We may not need to worry about supporting older versions.
https://endoflife.date/terraform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We should update our minimum supported then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I will make a PR

Uh oh!
There was an error while loading.Please reload this page.
What this does
This uses the
terraform init -jsonlogs to add more visibility into theinitphase ofplan. Theinitlogs omitmsprecision, so we have to usetime.Now()😢Open TF PR:hashicorp/terraform#37818
Screencast.From.2025-10-27.12-38-33.webm
Follow up will be to add more details to
modulesandprovidersto single out each module/provider loaded.