getsentry / team-webplatform-meta

0 stars 0 forks source link

Use same default environment #4

Closed AbhiPrasad closed 1 year ago

AbhiPrasad commented 2 years ago

See: https://github.com/getsentry/team-mobile/issues/73

The default value for the environment in the options should be production. If the user sets an environment, it precedes the default value. Sessions, transactions, events, etc., should all read the environment from the options. The SDK can set other default values if it detects different modes, such as debug or test.

In addition, sessions should use the same environment as what was configured by the user (falling back to the default production).

This issue is to track to make sure

  1. all SDKs are using the same default environment (production)
  2. sessions sent from the SDK use the same environment sent from Sentry.
cleptric commented 2 years ago

No sessions in PHP yet, environment defaults to production.

https://github.com/getsentry/sentry-php/blob/70c2269b450d9b5d629bd29ef01f4b7e893f881f/src/Event.php#L18

cleptric commented 2 years ago

No sessions in Go yet, environment defaults to os.Getenv("SENTRY_ENVIRONMENT")

https://github.com/getsentry/sentry-go/blob/b31dec1f53a6e0b4b51a6a905793675223828d56/client.go#L258-L260

sl0thentr0py commented 2 years ago

python https://github.com/getsentry/sentry-python/blob/bd99d4e560b5a6d1bdf933e90c73c298f73b4904/sentry_sdk/client.py#L84

ruby defaults to development, so will have to change https://github.com/getsentry/sentry-ruby/blob/dc7b0c6d0de1f9c470a33df85c96e3dd54209a02/sentry-ruby/lib/sentry/configuration.rb#L479