Closed joeblubaugh closed 1 month ago
This issue is happening in github.com/hashicorp/go-plugin As @joeblubaugh indicated, t's indeed an problem related to unmarshalling and marshalling the logs. The host pipes the plugin logs, unmarshal and marshal it to wrap it into the host logger and the issue comes from this process which is not deterministic.
I created an issue on their repo: https://github.com/hashicorp/go-plugin/issues/266 And I've also submitted a PR for the issue: https://github.com/hashicorp/go-plugin/pull/267
Once this is accepted we can update the package and fix the issue
I'm re-opening since the issue isn't actually addressed yet (waiting on upstream submission to hashicorp plugin library).
What happened:
I'm using the github.com/grafana/grafana-plugin-sdk-go/backend/log package in my SDK code, writing logs like so:
Log messages are printed with nondeterministic ordering after the message field:
The logger uses hclog and marshals to JSON at some point, passing through a
map[string]interface{}
, which makes the output order non-deterministicWhat you expected to happen: Log fields should always be written to Grafana logs in the order that they're provided.
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment: