Skip to content

fix: honor telemetry opt-out - #48

Merged
posquit0 merged 1 commit into
mainfrom
fix/telemetry-opt-out
Oct 8, 2026
Merged

posquit0 merged 1 commit into
mainfrom
fix/telemetry-opt-out

Conversation

@posquit0

@posquit0 posquit0 commented Oct 8, 2026

Copy link
Copy Markdown
Member

Important

In previous versions, telemetry = { enabled = false } did not stop telemetry. This PR makes the opt-out work.

Summary

The check "telemetry" block wrapped the whole call in a conditional expression (var.telemetry.enabled ? provider::telemetry::capture_posthog(...) : true). HCL evaluates both results of a conditional expression before its condition (ConditionalExpr.Value in hashicorp/hcl/v2), so the function ran and sent an event even when telemetry was disabled.

Following the provider guidance (tedilabs/terraform-provider-telemetry#16), pass a null connection to disable the call instead. The function skips the capture for a null connection.

Changes

  • In every module's telemetry.tf, move the var.telemetry.enabled condition from around the call to the connection argument: var.telemetry.enabled ? { host = ..., project_token = ... } : null. The options and extra data are unchanged, and the function still always returns true.

Verification

  • With a provider built from tedilabs/terraform-provider-telemetry main and a loopback HTTP server counting requests:

    Pattern enabled = false enabled = true
    Previous (conditional around the call) 1 request 1 request
    This PR (null connection) 0 requests 1 request
  • terraform validate with the provider from the Terraform Registry.

Impact on callers

  • Callers with telemetry = { enabled = false } stop sending telemetry after upgrading.
  • No other change: the telemetry variable, the provider requirement and README.md are unchanged.

@github-actions github-actions Bot added 💾 enterprise-organization This issue or pull request is related to enterprise-organization module. 💾 org-organization This issue or pull request is related to org-organization module. 💾 org-team This issue or pull request is related to org-team module. 💾 project This issue or pull request is related to project module. 💾 repository This issue or pull request is related to repository module. 💾 webhook This issue or pull request is related to webhook module. 💾 repository-environment This issue or pull request is related to repository-environment module. 💾 repository-custom-property This issue or pull request is related to repository-custom-property module. 💾 org-ruleset This issue or pull request is related to org-ruleset module. labels Oct 8, 2026
@github-actions github-actions Bot added the size/S Small size issue or PR. label Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Terraform Integration

Directory fmt validate tflint docs
modules/enterprise-organization ✅ ✅ ✅ ✅
modules/org-organization ✅ ✅ ✅ ✅
modules/org-ruleset ✅ ✅ ✅ ✅
modules/org-team ✅ ✅ ✅ ✅
modules/project ✅ ✅ ✅ ✅
modules/repository ✅ ✅ ✅ ✅
modules/repository-custom-property ✅ ✅ ✅ ✅
modules/repository-environment ✅ ✅ ✅ ✅
modules/webhook ✅ ✅ ✅ ✅

✅ All 9 passed.

@posquit0
posquit0 merged commit 5963bb0 into main Oct 8, 2026
15 checks passed
@posquit0
posquit0 deleted the fix/telemetry-opt-out branch October 8, 2026 15:52
@tedilabs-release tedilabs-release Bot mentioned this pull request Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💾 enterprise-organization This issue or pull request is related to enterprise-organization module. 💾 org-organization This issue or pull request is related to org-organization module. 💾 org-ruleset This issue or pull request is related to org-ruleset module. 💾 org-team This issue or pull request is related to org-team module. 💾 project This issue or pull request is related to project module. 💾 repository This issue or pull request is related to repository module. 💾 repository-custom-property This issue or pull request is related to repository-custom-property module. 💾 repository-environment This issue or pull request is related to repository-environment module. 💾 webhook This issue or pull request is related to webhook module. size/S Small size issue or PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant