Comments (3)
Quick msgpack notes:
b, _ := msgpack.Marshal(/* ... */)
fmt.Printf("Bytes: %v", b) // [142 161 98 207 0 0 0 0 0 0 0 5 161 100 ...
var ret interface{}
decoder := msgpack.NewDecoder(bytes.NewReader(b))
decoder.UseDecodeInterfaceLoose(true)
err := decoder.Decode(&ret)
fmt.Printf("Friendlier: %v", ret) // map[a:5 b:5 c:5 d:true e:foo f:[102 111 111] ...
from terraform-plugin-go.
Since the data is a little unwieldy, maybe this could dump files separately from the logging. e.g. {TIMESTAMP}_{RPC}_(request|response).msgpack
then those could be inspected.
Some additional references for inspection tooling:
- https://github.com/tagomoris/msgpack-inspect
- https://pkg.go.dev/github.com/nokute78/msgpack-microscope
- https://pkg.go.dev/github.com/nokute78/msgpack-microscope/cmd/msgpack2json (and
jq
) - wader/fq#25
from terraform-plugin-go.
To flush out the file-based proposal a little more:
Support a new environment variable, TF_LOG_SDK_PROTO_DATA_DIR
, which sets a directory to save request and response DynamicValue
data. When set and a RPC request or response with DynamicValue
data crosses the server logic, open a file and save the raw data:
- If len(msgpack) > 0,
{TIMESTAMP}_{RPC}_(Request|Response|{MESSAGE})_{FIELD}.msgpack
- If len(json) > 0,
{TIMESTAMP}_{RPC}_(Request|Response|{MESSAGE})_{FIELD}.json
Enabling this also should automatically trace log the filenames as they are created.
from terraform-plugin-go.
Related Issues (20)
- Unable to build provider as ParseRawProviderSourceString is undefined (v0.9.1) HOT 1
- Implement Protocol Version 5.3 and 6.3 (ServerCapabilities and PlanResourceChange on Destroy) HOT 4
- Unexpected ElementKeyValue Error Output from (tfprotov#.RawState).Unmarshal with Undefined Attributes
- Unmarshal should ignore elements in JSON that do not have a corresponding attribute
- Bump Expected Minimum Go Version to 1.18
- Include Resource Private State In Protocol Data Output HOT 1
- Introduce Go Fuzz Testing for Critical Code Paths HOT 2
- Protocol Data Files Overwritten HOT 2
- `NewValue` function should also return an `Error` type HOT 1
- Bump Minimum Go Version to 1.19 HOT 2
- Dynamic Pseudo Types inside of Blocks with nested mode of list cant be unmarshalled to tfvalues HOT 2
- Bump Expected Minimum Go Version to 1.19 HOT 2
- Consider Raising Error Diagnostic If Any Diagnostic Is Missing Severity
- tfprotov5+tfprotov6: Add DynamicValue Null Checking Without Type Information HOT 1
- tftypes: Remove Extraneous Memory Allocations in ApplyTerraform5AttributePathStep HOT 1
- Introduce Protocol Server Capability for Optional GetProviderSchema RPC HOT 1
- tftypes: Surface Protocol Unknown Value Refinements
- Update Go Module to Go 1.20 Minimum HOT 1
- `PlanResourceChange` can't indicate whether it is for a "recreate" HOT 3
- tfprotov5+tfprotov6: Add FunctionServer to ProviderServer interface HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-plugin-go.