mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
[OpenTelemetry] Add module init tracing (#2711)
Signed-off-by: James Humphries <james@james-humphries.co.uk>
This commit is contained in:
@@ -34,7 +34,7 @@ import (
|
||||
|
||||
var planConfigurationVersionsPollInterval = 500 * time.Millisecond
|
||||
|
||||
func (b *Cloud) opPlan(stopCtx, cancelCtx context.Context, op *backend.Operation, w *tfe.Workspace) (*tfe.Run, error) {
|
||||
func (b *Cloud) opPlan(ctx, stopCtx, cancelCtx context.Context, op *backend.Operation, w *tfe.Workspace) (*tfe.Run, error) {
|
||||
log.Printf("[INFO] cloud: starting Plan operation")
|
||||
|
||||
var diags tfdiags.Diagnostics
|
||||
@@ -97,7 +97,7 @@ func (b *Cloud) opPlan(stopCtx, cancelCtx context.Context, op *backend.Operation
|
||||
}
|
||||
|
||||
// If the run errored, exit before checking whether to save a plan file
|
||||
run, err := b.plan(stopCtx, cancelCtx, op, w)
|
||||
run, err := b.plan(ctx, stopCtx, cancelCtx, op, w)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -117,7 +117,7 @@ func (b *Cloud) opPlan(stopCtx, cancelCtx context.Context, op *backend.Operation
|
||||
return run, nil
|
||||
}
|
||||
|
||||
func (b *Cloud) plan(stopCtx, cancelCtx context.Context, op *backend.Operation, w *tfe.Workspace) (*tfe.Run, error) {
|
||||
func (b *Cloud) plan(ctx, stopCtx, cancelCtx context.Context, op *backend.Operation, w *tfe.Workspace) (*tfe.Run, error) {
|
||||
if b.CLI != nil {
|
||||
header := planDefaultHeader
|
||||
if op.Type == backend.OperationTypeApply || op.Type == backend.OperationTypeRefresh {
|
||||
@@ -264,7 +264,7 @@ in order to capture the filesystem context the remote workspace expects:
|
||||
}
|
||||
}
|
||||
|
||||
config, _, configDiags := op.ConfigLoader.LoadConfigWithSnapshot(op.ConfigDir, op.RootCall)
|
||||
config, _, configDiags := op.ConfigLoader.LoadConfigWithSnapshot(ctx, op.ConfigDir, op.RootCall)
|
||||
if configDiags.HasErrors() {
|
||||
return nil, fmt.Errorf("error loading config with snapshot: %w", configDiags.Errs()[0])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user