Skip to content

Commit ab76d81

Browse files
author
Martijn Russchen
committed
Replace raven with appsignal
1 parent 89a5722 commit ab76d81

File tree

4 files changed

+21
-33
lines changed

4 files changed

+21
-33
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dokku config:set proxy-production redirect_for_no_url='https://factlink.com' \
1515
hostname='fct.li' \
1616
host='http://fct.li' \
1717
jslib_uri='https://static.factlink.com/lib/dist/factlink_loader.min.js?o=proxy' \
18-
raven_dsn='...'
18+
APPSIGNAL_PUSH_API_KEY='...'
1919
```
2020

2121
## Contributing

lib/appsignal_goliath_listener.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
require 'appsignal'
2+
3+
Appsignal.config =
4+
Appsignal::Config.new(ENV['PWD'], Goliath.env, name: "Factlink Proxy")
5+
Appsignal.start_logger(nil)
6+
Appsignal.start
7+
8+
class AppsignalGoliathListener
9+
include Goliath::Rack::AsyncMiddleware
10+
11+
def post_process(env, status, headers, body)
12+
if Appsignal.active? && env['rack.exception']
13+
Appsignal.send_exception(env['rack.exception'])
14+
end
15+
16+
[status, headers, body]
17+
end
18+
end

lib/raven_catcher.rb

Lines changed: 0 additions & 30 deletions
This file was deleted.

server.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
require_relative './lib/redirect_root_url'
99
require_relative './lib/redirect_if_publisher'
1010
require_relative './lib/strip_publisher_script'
11-
require_relative './lib/raven_catcher'
11+
require_relative './lib/appsignal_goliath_listener'
1212

1313
class Server < WebProxy
14-
use RavenCatcher
14+
use AppsignalGoliathListener
1515
use RedirectRootUrl
1616
use AddFactlinkToPage
1717
if Goliath.env == :production

0 commit comments

Comments
 (0)