Closed letschers closed 1 year ago
Hi @letschers,
The local envs are loaded in order to determine any occurrences where you have added BUGSNAG_METADATA_xxxx formatted environment variables.
We add these as metadata to the event payload here. As it is somewhat freeform as to what the full environment variable name is, we cannot determine what that might be to just load those specifically, so we have to parse that for any variables that have the BUGSNAG_METADATA prefix
This is described in the docs here: https://docs.bugsnag.com/platforms/go/other/configuration-options/#adding-metadata.
Hello!
I'm implementing bugsnag on my application and something odd occured: some logs started to get duplicated when setting up the bugsnag integration. The log of loading .env variables was being doubled and I was questioning why necessarily the .env load log. Looking in the source code of the project, the Configure function:
That's alright, the configure function do some magic but the interesting part is the
Config.loadEnv()
function, that starts loading some related envs, but in the end of the functionConfig.loadEnv()
:metadata := loadEnvMetadata(os.Environ())
Why does the project loads all my local envs? Should not just use the envs related to the bugsnag-go (eg
BUGSNAG_API_KEY
) ?