From 1a95471fc45aff02e1b5a8d64fbe91245998ddc9 Mon Sep 17 00:00:00 2001 From: "turbolytics.io" Date: Tue, 17 Nov 2026 06:13:39 -0500 Subject: [PATCH 1/3] render: telemetry is off by default The Render template sent two install events unless SQLFLOW_TELEMETRY was off. It now sends nothing unless SQLFLOW_TELEMETRY is on (or true, 1, yes); blank, unset and any other value send nothing. The Blueprint prompt, README and compose comments say so. e2e: the main stack opts in for the telemetry section; probes check that unset, blank, off and an unknown value claim and send nothing, and the dead-collector probe opts in. run_probe guards its empty env array for macOS bash 3.2 under set -u. --- render.yaml | 17 +++++++++-------- render/README.md | 20 ++++++++++---------- render/bin/entrypoint.sh | 7 ++++--- render/bin/telemetry.sh | 11 +++++++---- render/docker-compose.yml | 2 +- render/test/e2e.sh | 29 +++++++++++++++++++---------- 6 files changed, 50 insertions(+), 36 deletions(-) diff --git a/render.yaml b/render.yaml index 035043dc..848a45ea 100644 --- a/render.yaml +++ b/render.yaml @@ -14,11 +14,12 @@ # SQLFLOW_SERVE_CLIENT_ID reads what you sent, as ?client_id=. A blank # one fails the API service. Letters, digits, # '.', '_', '~' and '-' only. -# SQLFLOW_TELEMETRY leave it blank, or type off. Blank sends the -# sqlflow maintainers two events, ever: that -# this was deployed, and that it received its -# first metric. render/README.md, "What this -# sends", prints both in full. +# SQLFLOW_TELEMETRY leave it blank, or type on. Blank sends +# nothing. on sends the sqlflow maintainers two +# events, ever: that this was deployed, and +# that it received its first metric. +# render/README.md, "What this sends", prints +# both in full. databases: - name: sqlflow-metrics-db plan: 0.1c-256mb @@ -59,9 +60,9 @@ services: # Prompted for during the deploy. - key: SQLFLOW_WEBHOOK_HMAC_SECRET sync: false - # Prompted for during the deploy, so that it is seen before anything is - # sent rather than found afterwards. Blank is on. off sends nothing. - # sync: false also means a later sync never touches what was typed. + # Prompted for during the deploy. Blank is off and sends nothing. on + # sends two events. sync: false also means a later sync never touches + # what was typed. - key: SQLFLOW_TELEMETRY sync: false # SQLFLOW_WEBHOOK_AUTH is not here, on purpose. Unset, the pipeline diff --git a/render/README.md b/render/README.md index 57190a8d..f77d3209 100644 --- a/render/README.md +++ b/render/README.md @@ -25,7 +25,7 @@ openssl rand -hex 16 # SQLFLOW_SERVE_CLIENT_ID |---|---| | `SQLFLOW_WEBHOOK_HMAC_SECRET` | Signs what you send. Any long random string. | | `SQLFLOW_SERVE_CLIENT_ID` | Reads what you sent, as `?client_id=`. Letters, digits, `.`, `_`, `~` and `-` only, so it can be pasted into a URL. | -| `SQLFLOW_TELEMETRY` | Leave it blank, or type `off`. See [What this sends](#what-this-sends). | +| `SQLFLOW_TELEMETRY` | Leave it blank to send nothing, or type `on`. See [What this sends](#what-this-sends). | A blank value fails its service, on purpose. The pipeline writes to your database and will not start unsigned unless you set @@ -39,10 +39,10 @@ When the deploy finishes, copy the URLs of `sqlflow-metrics-ingest` and ## What this sends -Unless you type `off` at the `SQLFLOW_TELEMETRY` prompt, this deploy sends the -sqlflow maintainers two events, once each, for as long as it exists. They -tell us that the template was deployed and that it worked. This is the whole -of both: +Nothing, unless you type `on` at the `SQLFLOW_TELEMETRY` prompt. With `on`, +this deploy sends the sqlflow maintainers two events, once each, for as long +as it exists. They tell us that the template was deployed and that it worked. +This is the whole of both: ```json {"name": "install.deployed", "type": "count", "value": 1, @@ -73,12 +73,12 @@ address it came from. The pipeline neither reads nor stores it. Render's request log for that service holds it for a while, as any host's does. The ingest service logs each event in full when it sends it. `bin/telemetry.sh` -is 91 lines and is the only code that sends anything. The sqlflow +is 97 lines and is the only code that sends anything. The sqlflow binary itself never phones home. -**To turn it off**, type `off` at the prompt, or set `SQLFLOW_TELEMETRY=off` on -`sqlflow-metrics-ingest` later. `false`, `0` and `no` also work. Nothing is -sent, and the log says so. +**To turn it on**, type `on` at the prompt, or set `SQLFLOW_TELEMETRY=on` on +`sqlflow-metrics-ingest` later. `true`, `1` and `yes` also work. Any other +value, blank included, sends nothing, and the log says so. A collector that is down, slow or gone never affects your deploy. A send is bounded at five seconds, runs in the background, and is retried later. @@ -273,7 +273,7 @@ not name and rewrites one it does, so a setting made here survives a sync. | `SQLFLOW_WEBHOOK_HMAC_SECRET` | | Required under `hmac`. | | `SQLFLOW_METRIC_NAME_PREFIX` | empty | When set, a metric whose name does not start with it is dropped. Letters, digits, `.`, `_` and `-`. | | `SQLFLOW_WEBHOOK_MAX_BODY_BYTES` | 26214400 | A larger body is refused with 413. | -| `SQLFLOW_TELEMETRY` | on | `off` sends nothing. See [What this sends](#what-this-sends). | +| `SQLFLOW_TELEMETRY` | off | `on` sends two events. See [What this sends](#what-this-sends). | ## Run it locally diff --git a/render/bin/entrypoint.sh b/render/bin/entrypoint.sh index 69ddddf8..6f2b89bf 100755 --- a/render/bin/entrypoint.sh +++ b/render/bin/entrypoint.sh @@ -63,9 +63,10 @@ export SQLFLOW_WRITER_ID /app/bin/migrate.sh # Two events per install, ever, to the sqlflow maintainers: that this was -# deployed, and that it received its first metric. SQLFLOW_TELEMETRY=off stops -# both. In the background and detached from this script's fate: it logs and -# swallows its own failures, and nothing it does can stop the pipeline below. +# deployed, and that it received its first metric. Off unless +# SQLFLOW_TELEMETRY=on. In the background and detached from this script's +# fate: it logs and swallows its own failures, and nothing it does can stop +# the pipeline below. /app/bin/telemetry.sh & # exec keeps sqlflow as PID 1, so the platform's SIGTERM reaches it and the diff --git a/render/bin/telemetry.sh b/render/bin/telemetry.sh index 7f9f96f3..33903327 100755 --- a/render/bin/telemetry.sh +++ b/render/bin/telemetry.sh @@ -3,7 +3,9 @@ # received its first metric. Two events, each sent once per install, and # nothing else, ever. render/README.md, "What this sends", prints both. # -# SQLFLOW_TELEMETRY=off sends nothing. Also: false, 0, no. +# Off by default. +# SQLFLOW_TELEMETRY=on sends the two events. Also: true, 1, yes. +# anything else sends nothing, blank and unset included. # # bin/entrypoint.sh starts this in the background after the migrations. It must # never be the reason a pipeline does not start or stops: every failure here is @@ -13,9 +15,10 @@ set -uo pipefail log() { echo "telemetry: $*" >&2; } -case "$(printf '%s' "${SQLFLOW_TELEMETRY:-on}" | tr '[:upper:]' '[:lower:]')" in - off|false|0|no) - log "off (SQLFLOW_TELEMETRY=${SQLFLOW_TELEMETRY}). Nothing is sent." +case "$(printf '%s' "${SQLFLOW_TELEMETRY:-}" | tr '[:upper:]' '[:lower:]')" in + on|true|1|yes) ;; + *) + log "off (SQLFLOW_TELEMETRY=${SQLFLOW_TELEMETRY:-}). Nothing is sent. Set it to on to send two events; see render/README.md." exit 0 ;; esac diff --git a/render/docker-compose.yml b/render/docker-compose.yml index f7d14eb6..8f45ac93 100644 --- a/render/docker-compose.yml +++ b/render/docker-compose.yml @@ -50,7 +50,7 @@ services: SQLFLOW_WEBHOOK_HMAC_SECRET: ${SQLFLOW_WEBHOOK_HMAC_SECRET-local-secret} SQLFLOW_WEBHOOK_PORT: "10000" SQLFLOW_METRIC_NAME_PREFIX: ${SQLFLOW_METRIC_NAME_PREFIX:-} - # No value: on unless the caller says off, as on Render. + # No value: off unless the caller says on, as on Render. SQLFLOW_TELEMETRY: SQLFLOW_TELEMETRY_URL: ${SQLFLOW_TELEMETRY_URL:-http://collector:10000} SQLFLOW_TELEMETRY_POLL_SECONDS: "1" diff --git a/render/test/e2e.sh b/render/test/e2e.sh index 6bed718b..31f673ea 100755 --- a/render/test/e2e.sh +++ b/render/test/e2e.sh @@ -93,7 +93,10 @@ docker compose up -d --wait postgres # Whatever ran before this, the pipelines below start with no claim held. docker compose exec -T postgres psql -U metrics -d metrics -X -Atqc "UPDATE install SET deployed_claimed_at = NULL, first_request_claimed_at = NULL" >/dev/null 2>&1 || true -docker compose up -d collector ingest ingest2 api +# Telemetry is off by default. On here, inline rather than exported, so the +# telemetry section below has events to check and the probes after it start +# with the default. +SQLFLOW_TELEMETRY=on docker compose up -d collector ingest ingest2 api wait_for ingest "$INGEST/events" wait_for ingest2 "$INGEST2/events" wait_for api "$API/healthz" @@ -280,21 +283,27 @@ reset_install() { psqlc 'UPDATE install SET deployed_claimed_at = NULL, deployed run_probe() { # run_probe