fluent-plugin-bugsnag 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/Gemfile +4 -0
- data/README.md +38 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/fluent-plugin-bugsnag.gemspec +27 -0
- data/lib/fluent/plugin/out_bugsnag.rb +48 -0
- data/td-agent.conf +21 -0
- metadata +125 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4d6d6b3bb386fabf9c9f1e1ea066112e213f8f85
|
4
|
+
data.tar.gz: bf6abf38be874c7e725214c4fc50ffb300964391
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d23f3ac83988b944e47bafe9a5bb5b6780a474c5800ca8c5a80c0d8596ddbae89e2b62acd4bdde1f268520f4773e0e095175b1e02a57b849077d19720d6402c9
|
7
|
+
data.tar.gz: b12dea1996a8a460d378fc02b06f4711545494fb432199860b33885743a8aa3fb6cb35e037bd97f323cead5a1ad4ec3763abc8acfe274f4bc9f3eed7304635cb
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/fluent-plugin-bugsnag.svg)](http://badge.fury.io/rb/fluent-plugin-bugsnag)
|
2
|
+
![Build Status](https://circleci.com/gh/koshigoe/fluent-plugin-bugsnag.svg?style=shield)
|
3
|
+
|
4
|
+
# Fluent::Plugin::Bugsnag
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
$ fluent-gem install fluent-plugin-bugsnag
|
11
|
+
|
12
|
+
## Usage
|
13
|
+
|
14
|
+
```
|
15
|
+
<match bugsnag.deliver>
|
16
|
+
type bugsnag
|
17
|
+
|
18
|
+
# bugsnag_proxy_host localhost
|
19
|
+
# bugsnag_proxy_port 8888
|
20
|
+
# bugsnag_proxy_user user
|
21
|
+
# bugsnag_proxy_password password
|
22
|
+
# bugsnag_timeout 10
|
23
|
+
</match>
|
24
|
+
```
|
25
|
+
|
26
|
+
## Development
|
27
|
+
|
28
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
29
|
+
|
30
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
31
|
+
|
32
|
+
## Contributing
|
33
|
+
|
34
|
+
1. Fork it ( https://github.com/koshigoe/fluent-plugin-bugsnag/fork )
|
35
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
36
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
37
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
38
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "fluent/plugin/bugsnag"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "fluent-plugin-bugsnag"
|
7
|
+
spec.version = '0.1.0'
|
8
|
+
spec.authors = ["koshigoe"]
|
9
|
+
spec.email = ["koshigoeb@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = %q{Fluentd output plubin for Bugsnag.}
|
12
|
+
spec.description = %q{Fluentd output plubin for Bugsnag.}
|
13
|
+
spec.homepage = "https://github.com/koshigoe/fluent-plugin-bugsnag"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_development_dependency 'test-unit'
|
24
|
+
spec.add_development_dependency 'webmock'
|
25
|
+
|
26
|
+
spec.add_runtime_dependency 'fluentd'
|
27
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'net/https'
|
2
|
+
require 'uri'
|
3
|
+
|
4
|
+
module Fluent
|
5
|
+
class BugsnagOutput < BufferedOutput
|
6
|
+
Plugin.register_output('bugsnag', self)
|
7
|
+
|
8
|
+
config_param :bugsnag_proxy_host, :string, :default => nil
|
9
|
+
config_param :bugsnag_proxy_port, :integer, :default => nil
|
10
|
+
config_param :bugsnag_proxy_user, :string, :default => nil
|
11
|
+
config_param :bugsnag_proxy_password, :string, :default => nil
|
12
|
+
config_param :bugsnag_timeout, :integer, :default => nil
|
13
|
+
|
14
|
+
def format(tag, time, record)
|
15
|
+
[tag, time, record].to_msgpack
|
16
|
+
end
|
17
|
+
|
18
|
+
def write(chunk)
|
19
|
+
chunk.msgpack_each do |(tag,time,record)|
|
20
|
+
request(record['url'], record['body'])
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def request(url, body)
|
27
|
+
uri = URI.parse(url)
|
28
|
+
http = Net::HTTP.new(uri.host, uri.port, @bugsnag_proxy_host, @bugsnag_proxy_port, @bugsnag_proxy_user, @bugsnag_proxy_password)
|
29
|
+
http.read_timeout = @bugsnag_timeout
|
30
|
+
http.open_timeout = @bugsnag_timeout
|
31
|
+
|
32
|
+
if uri.scheme == "https"
|
33
|
+
http.use_ssl = true
|
34
|
+
# the default in 1.9+, but required for 1.8
|
35
|
+
# http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
36
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
37
|
+
end
|
38
|
+
|
39
|
+
request = Net::HTTP::Post.new(path(uri), {"Content-Type" => "application/json"})
|
40
|
+
request.body = body
|
41
|
+
http.request(request)
|
42
|
+
end
|
43
|
+
|
44
|
+
def path(uri)
|
45
|
+
uri.path == "" ? "/" : uri.path
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/td-agent.conf
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# /usr/sbin/td-agent -c td-agent.conf --use-v1-config -p lib/fluent/plugin -vvv
|
2
|
+
|
3
|
+
<source>
|
4
|
+
type forward
|
5
|
+
</source>
|
6
|
+
|
7
|
+
# <match **>
|
8
|
+
# type stdout
|
9
|
+
# </match>
|
10
|
+
|
11
|
+
<match bugsnag.deliver>
|
12
|
+
type bugsnag
|
13
|
+
|
14
|
+
flush_interval 1s
|
15
|
+
|
16
|
+
# bugsnag_proxy_host localhost
|
17
|
+
# bugsnag_proxy_port 8888
|
18
|
+
# bugsnag_proxy_user user
|
19
|
+
# bugsnag_proxy_password password
|
20
|
+
# bugsnag_timeout 10
|
21
|
+
</match>
|
metadata
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fluent-plugin-bugsnag
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- koshigoe
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-04-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: test-unit
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: webmock
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: fluentd
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: Fluentd output plubin for Bugsnag.
|
84
|
+
email:
|
85
|
+
- koshigoeb@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- ".rspec"
|
92
|
+
- ".travis.yml"
|
93
|
+
- Gemfile
|
94
|
+
- README.md
|
95
|
+
- Rakefile
|
96
|
+
- bin/console
|
97
|
+
- bin/setup
|
98
|
+
- fluent-plugin-bugsnag.gemspec
|
99
|
+
- lib/fluent/plugin/out_bugsnag.rb
|
100
|
+
- td-agent.conf
|
101
|
+
homepage: https://github.com/koshigoe/fluent-plugin-bugsnag
|
102
|
+
licenses:
|
103
|
+
- MIT
|
104
|
+
metadata: {}
|
105
|
+
post_install_message:
|
106
|
+
rdoc_options: []
|
107
|
+
require_paths:
|
108
|
+
- lib
|
109
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
requirements: []
|
120
|
+
rubyforge_project:
|
121
|
+
rubygems_version: 2.4.5
|
122
|
+
signing_key:
|
123
|
+
specification_version: 4
|
124
|
+
summary: Fluentd output plubin for Bugsnag.
|
125
|
+
test_files: []
|