Feat/stackittpr 788 context logging - #1704
Draft
cgoetz-inovex wants to merge 6 commits into
Draft
Conversation
demo logging for data source machine type
rubenhoenle
reviewed
Aug 18, 2026
| additionalFields = append(additionalFields, map[string]interface{}{ | ||
| "x-trace-id": runtime.GetTraceId(ctx), | ||
| }) | ||
| tflog.Warn(ctx, msg, additionalFields...) |
Member
There was a problem hiding this comment.
I guess we'll need some linting rule then so only these LogInfo, LogWarn, ... functions are used then, right?
Contributor
Author
There was a problem hiding this comment.
yes, I'd add a linter to forbid direct tflog.Info|Error|... calls in the services pkg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Proof of concept for removing
core.InitProviderCtxandcore.LogResponseand related linters.Based on
clientFactorywork.responseLoggingMiddlewareto defaultOptions to log the trace-id after each responsecore.Log*funcs to addx-trace-idfromctxto each log messageTesting
run
TF_LOG=info terraform plancheck that trace ids are present
Next steps
clientFactoriesbeing mergedcore.InitProviderCtxandcore.LogResponsetflog.Info|Error|...calls inservicesChecklist
make fmtexamples/directory)make generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)