Skip to content

feat: add startup telemetry status logs#9822

Open
abhijnyan-codes wants to merge 3 commits intokeystonejs:mainfrom
abhijnyan-codes:feat/startup-telemetry-logs
Open

feat: add startup telemetry status logs#9822
abhijnyan-codes wants to merge 3 commits intokeystonejs:mainfrom
abhijnyan-codes:feat/startup-telemetry-logs

Conversation

@abhijnyan-codes
Copy link
Copy Markdown

Closes #9299

Added log messages to runTelemetry() to inform users of telemetry status at startup:

  • Keystone Telemetry is disabled (running in CI)
  • Keystone Telemetry is disabled (NODE_ENV is production)
  • Keystone Telemetry is disabled (via KEYSTONE_TELEMETRY_DISABLED env)
  • Keystone Telemetry is disabled (via opt-out)
  • Keystone Telemetry is enabled

process.env.KEYSTONE_TELEMETRY_DISABLED === '1' // don't run if the user has disabled it
) {
if (ci.isCI) {
console.log(`Keystone Telemetry is ${r`disabled`} (running in CI)`)
Copy link
Copy Markdown
Member

@dcousens dcousens Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use the log function used by the rest of file, not console.log

please change the prefix, s/Keystone Telemetry is/telemetry is

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback! I noticed the existing log() function only outputs when KEYSTONE_TELEMETRY_DEBUG=1, which would hide these status messages from regular users. Should I use log() anyway, or is there another logging utility I should use instead?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, true, sorry, I think we want the logging approach used by the rest of the codebase for this - not the log from this file

Comment thread packages/core/src/lib/telemetry.ts Outdated
@dcousens
Copy link
Copy Markdown
Member

@abhijnyan-codes at the same time as this, did you want to add support to opt-out if the user has DO_NOT_TRACK=1 in the environment too?

@abhijnyan-codes
Copy link
Copy Markdown
Author

Added DO_NOT_TRACK=1 support as well.

@dcousens
Copy link
Copy Markdown
Member

Thanks @abhijnyan-codes, if you can add a changeset, I will resolve the last remaining tidbits

@abhijnyan-codes
Copy link
Copy Markdown
Author

Added the changeset!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update startup logs to include telemetry status

2 participants