telemetry: Only send requests if data has changed #758
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.
Depends on hashicorp/terraform-schema#89
Depends on #761
According to manual testing with a single installed module from https://registry.terraform.io/modules/terraform-aws-modules/eks/aws/latest this can reduce the amount of telemetry requests to about half (from 32 to 14).
There's probably more we can do here - e.g. avoid sending telemetry for unsaved data. This is not only extra overhead, but also pollutes the data with "unfinished" provider or backend names. However this would require more effort - probably queueing the telemetry data somewhere and then adding a hook which gets triggered by
textDocument/didSave
. Either way not something I wanted to tackle in this PR.