Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-workhorse
Commits
a341fd2a
Commit
a341fd2a
authored
May 02, 2019
by
Roger Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add option to set Sentry environment
parent
c769f123
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
README.md
README.md
+8
-1
raven.go
raven.go
+5
-0
No files found.
README.md
View file @
a341fd2a
...
...
@@ -194,17 +194,24 @@ images. If you installed GitLab:
GitLab-Workhorse supports remote error tracking with
[
Sentry
](
https://sentry.io
)
. To enable this feature set the
GITLAB_WORKHORSE_SENTRY_DSN environment variable.
You can also set the GITLAB_WORKHORSE_SENTRY_ENVIRONMENT environment variable to
use the Sentry environment functionality to separate staging, production and
development.
Omnibus (
`/etc/gitlab/gitlab.rb`
):
```
gitlab_workhorse['env'] = {'GITLAB_WORKHORSE_SENTRY_DSN' => 'https://foobar'}
gitlab_workhorse['env'] = {
'GITLAB_WORKHORSE_SENTRY_DSN' => 'https://foobar'
'GITLAB_WORKHORSE_SENTRY_ENVIRONMENT' => 'production'
}
```
Source installations (
`/etc/default/gitlab`
):
```
export GITLAB_WORKHORSE_SENTRY_DSN='https://foobar'
export GITLAB_WORKHORSE_SENTRY_ENVIRONMENT='production'
```
## Tests
...
...
raven.go
View file @
a341fd2a
...
...
@@ -13,8 +13,13 @@ func wrapRaven(h http.Handler) http.Handler {
// Use a custom environment variable (not SENTRY_DSN) to prevent
// clashes with gitlab-rails.
sentryDSN
:=
os
.
Getenv
(
"GITLAB_WORKHORSE_SENTRY_DSN"
)
sentryEnvironment
:=
os
.
Getenv
(
"GITLAB_WORKHORSE_SENTRY_ENVIRONMENT"
)
raven
.
SetDSN
(
sentryDSN
)
// sentryDSN may be empty
if
sentryEnvironment
!=
""
{
raven
.
SetEnvironment
(
sentryEnvironment
)
}
if
sentryDSN
==
""
{
return
h
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment