-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add airbrake project key environment variable #147
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, could you add the PR comment straight into the commit message? That way it will stay with the repo forever.
(Suggestions to edit in the body:
Allow setting the airbrake api key via the AIRBRAKE_API_KEY environment
variable. If this variable is set, it will override the `project_key`
field in the airbrake section of config file.
README.md
Outdated
@@ -172,6 +172,8 @@ Data is encapsulated into protobuf messages of different types. Protos can be re | |||
```sh | |||
make generate-protos | |||
``` | |||
## Airbrake | |||
Fleet telemetry allows you to monitor error using [airbrake](https://www.airbrake.io/error-monitoring). The integration test runs fleet telemetry with [errbit](https://github.com/errbit/errbit), which is airbrake compliant self-hosted error catcher. You can set project key for airbrake using either the config file or via environment variable `AIRBRAKE_PROJECT_KEY`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- ... to monitor
errors
using ... - ... which is
an
airbrake ... - ... You can set
a
project key - ... or via
an
environment
return githubairbrake.NewNotifierWithOptions(&githubairbrake.NotifierOptions{ | ||
projectKey, ok := os.LookupEnv("AIRBRAKE_PROJECT_KEY") | ||
if !ok { | ||
projectKey = c.Airbrake.ProjectKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some logging here, it's always hard to debug these things without visibility.
Something like:
using airbrake project key from AIRBRAKE_PROJECT_KEY env variable
(<- use const)using airbrake project key from config file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated with some modifications
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. If we had the actual env variable name in the log that'd be helpful for debugging ("ahhhh I have a typo, I was setting AIRBRAKE_API_KEY
, silly me!) but at least now we know which path it's taking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated!
dcc6d82
to
bed0088
Compare
return githubairbrake.NewNotifierWithOptions(&githubairbrake.NotifierOptions{ | ||
projectKey, ok := os.LookupEnv("AIRBRAKE_PROJECT_KEY") | ||
if !ok { | ||
projectKey = c.Airbrake.ProjectKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. If we had the actual env variable name in the log that'd be helpful for debugging ("ahhhh I have a typo, I was setting AIRBRAKE_API_KEY
, silly me!) but at least now we know which path it's taking.
bed0088
to
4a1806a
Compare
Allow setting the airbrake api key via the AIRBRAKE_API_KEY environment variable. If this variable is set, it will override the field in the airbrake section of config file.
4a1806a
to
5fa9b98
Compare
Description
Allow setting
AIRBRAKE_API_KEY
environment variable so that key can be avoided being stored in plaintext. If the env variable is set, it will override whatever is stored in Airbrake.ProjectId field of config file.Type of change
Please select all options that apply to this change:
Checklist:
Confirm you have completed the following steps: