EIDA / eida-statistics

Aggregated statistics of EIDA nodes
GNU General Public License v3.0
0 stars 0 forks source link

Sentry: set DSN by environment variable #48

Closed jschaeff closed 9 months ago

jschaeff commented 9 months ago

Could you remove the DSN from the code and get it from an environment variable ?

Also, please look at how to setup the environment (dev, staging, production) so that sentry can make the difference.

https://docs.sentry.io/platforms/go/guides/martini/configuration/environments/

jschaeff commented 9 months ago

By the way, it works in staging.

We should agree on a policy with git branches. I like to never commit directly on the main branch, use the development branch for releasing in staging and merge in main when the code is ready for production.

What do you think about it ?

vpet98 commented 9 months ago

So, I will change the name of the environemnt in the code depending on whether I am developing locally or going to commit on development for staging or on main for production?

Or use an environment variable for this too?

jschaeff commented 9 months ago

Use an environment variable for this too :) Like "CONTEXT" or "RUNMODE" as you please.

vpet98 commented 9 months ago

Ok, done. Development branch. Environment variables: DSN and RUNMODE.

jschaeff commented 9 months ago

Deployed in staging and in production.

Thanks !