Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce some logging. #234

Merged
merged 2 commits into from
Dec 13, 2021
Merged

Introduce some logging. #234

merged 2 commits into from
Dec 13, 2021

Conversation

paddycarver
Copy link
Contributor

Start logging using tflog. This largely just inserts logging at decision
points in the serve.go file of tfsdk, which is where the most invisible,
impactful decisions are made. Over time, logging should be introduced in
more places on an as-needed basis or as we touch those parts of the
code.

Fixes #63.

@paddycarver paddycarver requested a review from a team December 13, 2021 18:33
@bflad bflad self-assigned this Dec 13, 2021
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me -- using this branch with terraform-provider-corner acceptance testing is nicely populating the logs and receiving the terraform-plugin-go contextual information. We can adjust this as necessary going forward, but this is a good first iteration. 🚀

2021-12-13T14:18:10.598-0500 [TRACE] GRPCProvider.v6: ValidateResourceConfig
2021-12-13T14:18:10.598-0500 [TRACE] sdk.proto: Received request: tf_proto_version=6 tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=c51464da-de24-368d-18a9-d35d46a62795 tf_resource_type=framework_user tf_rpc=ValidateResourceConfig
2021-12-13T14:18:10.598-0500 [TRACE] sdk.proto: Calling downstream: tf_proto_version=6 tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=c51464da-de24-368d-18a9-d35d46a62795 tf_resource_type=framework_user tf_rpc=ValidateResourceConfig
2021-12-13T14:18:10.598-0500 [TRACE] sdk.proto: Called downstream: tf_proto_version=6 tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=c51464da-de24-368d-18a9-d35d46a62795 tf_resource_type=framework_user tf_rpc=ValidateResourceConfig
2021-12-13T14:18:10.598-0500 [TRACE] sdk.proto: Served request: tf_proto_version=6 tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=c51464da-de24-368d-18a9-d35d46a62795 tf_resource_type=framework_user tf_rpc=ValidateResourceConfig
2021-12-13T14:18:10.598-0500 [TRACE] GRPCProvider.v6: PlanResourceChange
2021-12-13T14:18:10.599-0500 [TRACE] sdk.proto: Received request: tf_proto_version=6 tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=23f980b6-6bc0-8950-0072-1d985a917858 tf_resource_type=framework_user tf_rpc=PlanResourceChange
2021-12-13T14:18:10.599-0500 [TRACE] sdk.proto: Calling downstream: tf_proto_version=6 tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=23f980b6-6bc0-8950-0072-1d985a917858 tf_resource_type=framework_user tf_rpc=PlanResourceChange
2021-12-13T14:18:10.599-0500 [TRACE] sdk: marking computed null values as unknown: tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=23f980b6-6bc0-8950-0072-1d985a917858 tf_resource_type=framework_user tf_rpc=PlanResourceChange
2021-12-13T14:18:10.599-0500 [DEBUG] sdk: marking computed attribute that is null in the config as unknown: tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=23f980b6-6bc0-8950-0072-1d985a917858 tf_resource_type=framework_user tf_rpc=PlanResourceChange path=AttributeName("date_joined")
2021-12-13T14:18:10.599-0500 [TRACE] sdk: attribute not null in config, not marking unknown: tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=23f980b6-6bc0-8950-0072-1d985a917858 tf_resource_type=framework_user tf_rpc=PlanResourceChange path=AttributeName("email")
2021-12-13T14:18:10.599-0500 [TRACE] sdk: attribute not null in config, not marking unknown: tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=23f980b6-6bc0-8950-0072-1d985a917858 tf_resource_type=framework_user tf_rpc=PlanResourceChange path=AttributeName("id")
2021-12-13T14:18:10.599-0500 [DEBUG] sdk: marking computed attribute that is null in the config as unknown: tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=23f980b6-6bc0-8950-0072-1d985a917858 tf_resource_type=framework_user tf_rpc=PlanResourceChange path=AttributeName("language")
2021-12-13T14:18:10.599-0500 [TRACE] sdk: attribute not null in config, not marking unknown: tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=23f980b6-6bc0-8950-0072-1d985a917858 tf_resource_type=framework_user tf_rpc=PlanResourceChange path=AttributeName("name")
2021-12-13T14:18:10.599-0500 [TRACE] sdk: attribute not null in config, not marking unknown: tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=23f980b6-6bc0-8950-0072-1d985a917858 tf_resource_type=framework_user tf_rpc=PlanResourceChange path=AttributeName("age")
2021-12-13T14:18:10.599-0500 [TRACE] sdk: at least one value was changed to unknown: tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=23f980b6-6bc0-8950-0072-1d985a917858 tf_resource_type=framework_user tf_rpc=PlanResourceChange
2021-12-13T14:18:10.599-0500 [TRACE] sdk.proto: Called downstream: tf_proto_version=6 tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=23f980b6-6bc0-8950-0072-1d985a917858 tf_resource_type=framework_user tf_rpc=PlanResourceChange
2021-12-13T14:18:10.599-0500 [TRACE] sdk.proto: Served request: tf_proto_version=6 tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=23f980b6-6bc0-8950-0072-1d985a917858 tf_resource_type=framework_user tf_rpc=PlanResourceChange
2021-12-13T14:18:10.599-0500 [TRACE] checkPlannedChange: Verifying that actual change (action Create) matches planned change (action Create)
2021-12-13T14:18:10.599-0500 [TRACE] readResourceInstanceState: reading state for framework_user.foo
2021-12-13T14:18:10.599-0500 [TRACE] readResourceInstanceState: no state present for framework_user.foo
2021-12-13T14:18:10.599-0500 [INFO]  Starting apply for framework_user.foo
2021-12-13T14:18:10.599-0500 [DEBUG] framework_user.foo: applying the planned Create change
2021-12-13T14:18:10.599-0500 [TRACE] GRPCProvider.v6: ApplyResourceChange
2021-12-13T14:18:10.600-0500 [TRACE] sdk.proto: Received request: tf_proto_version=6 tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=2440e8c7-a199-c759-b6a9-5e6f6b48dc1e tf_resource_type=framework_user tf_rpc=ApplyResourceChange
2021-12-13T14:18:10.600-0500 [TRACE] sdk.proto: Calling downstream: tf_proto_version=6 tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=2440e8c7-a199-c759-b6a9-5e6f6b48dc1e tf_resource_type=framework_user tf_rpc=ApplyResourceChange
2021-12-13T14:18:10.600-0500 [TRACE] sdk: running create: tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=2440e8c7-a199-c759-b6a9-5e6f6b48dc1e tf_resource_type=framework_user tf_rpc=ApplyResourceChange
2021-12-13T14:18:10.600-0500 [TRACE] sdk.proto: Called downstream: tf_proto_version=6 tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=2440e8c7-a199-c759-b6a9-5e6f6b48dc1e tf_resource_type=framework_user tf_rpc=ApplyResourceChange
2021-12-13T14:18:10.600-0500 [TRACE] sdk.proto: Served request: tf_proto_version=6 tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=2440e8c7-a199-c759-b6a9-5e6f6b48dc1e tf_resource_type=framework_user tf_rpc=ApplyResourceChange

Start logging using tflog. This largely just inserts logging at decision
points in the serve.go file of tfsdk, which is where the most invisible,
impactful decisions are made. Over time, logging should be introduced in
more places on an as-needed basis or as we touch those parts of the
code.

Fixes #63.
@paddycarver
Copy link
Contributor Author

Happy with that changelog?

@paddycarver paddycarver merged commit 574e52c into main Dec 13, 2021
@paddycarver paddycarver deleted the paddy_logging branch December 13, 2021 22:06
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integration with terraform-plugin-log
2 participants