Skip to content

Feat: automatic environment and telemetry settings - #267

Merged
hisenb3rg merged 2 commits into
mainfrom
feat/auto-env-telemetry
Jul 31, 2026
Merged

Feat: automatic environment and telemetry settings#267
hisenb3rg merged 2 commits into
mainfrom
feat/auto-env-telemetry

Conversation

@hisenb3rg

Copy link
Copy Markdown
Contributor

This PR changes how telemetry (sentry) is enabled.

The intent here is:

  • that our development use of codeplain cli doesn't pollute our sentry feed, so telemetry must be disabled by default
  • that production use of codeplain cli continues to get logged to sentry by default

First the environment setting is exposed in SystemConfig and set to:

  • CODEPLAIN_ENV if set
  • "production" if codeplain pkg is installed from index
  • "development" otherwise (run from source, etc..)

Then telemetry is enabled according to the environment:

  • in production it is enabled by default (can be explicitly disabled with CODEPLAIN_TELEMETRY=0)
  • in any other environment it is disabled by default (can be explicitly enabled)

Add "environment" and "installed" fields to system config. Environment
was only used by sentry telemetry, so was moved from there.

Environment is set to:
- CODEPLAIN_ENV env variable (if explicitly set)
- production (if package was installed from index)
- development (otherwise, default)
Disable telemetry in non-production environments by default.
@hisenb3rg
hisenb3rg requested a review from zanjonke July 31, 2026 07:36

@zanjonke zanjonke left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good! 🚀

@hisenb3rg
hisenb3rg merged commit ba6cda7 into main Jul 31, 2026
10 checks passed
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.

2 participants