bugsnag-delivery-fluent 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f0e1cf241f45aa28970d3969e326dcd42d0ad0b8
4
+ data.tar.gz: 5a47e4b8e08374fadd67419776d132fd629f1814
5
+ SHA512:
6
+ metadata.gz: 79e011eac735c8ff9f8607ac4f5cb4280c479391b110c9048787bd7662a7e7acb29f5a8a0201bb840d1478051f970b59a1de241fabb5266b68f27e5dbcd03255
7
+ data.tar.gz: a7255ca6ad7e9d165c031600e489a7a808a6da6eff4a47de5a27f820a0706d223cc58bbc8fe3e1fef83c0a7ae9efc435d9e561ed16d6a59cb22939d1e1168329
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.1
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in bugsnag-delivery-fluent.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,61 @@
1
+ # Bugsnag::Delivery::Fluent
2
+
3
+ This gem adds a `delivery_method` to [bugsnag/bugsnag-ruby](https://github.com/bugsnag/bugsnag-ruby) for sending to fluentd.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'bugsnag-delivery-fluent'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install bugsnag-delivery-fluent
20
+
21
+ ## Usage
22
+
23
+ fluentd must running. Run following code, then Bugsnag sending api payload to fluentd.
24
+
25
+ ```ruby
26
+ require 'bugsnag'
27
+ require 'bugsnag/delivery/fluent'
28
+
29
+ Bugsnag.configure do |config|
30
+ config.api_key = "<BUGSNAG API KEY>"
31
+ config.delivery_method = :fluent
32
+ config.release_stage = 'production'
33
+ # config.fluent_tag_prefix = 'bugsnag'
34
+ # config.fluent_host = 'localhost'
35
+ # config.fluent_port = 24224
36
+ end
37
+
38
+ Bugsnag.notify(RuntimeError.new("bugsnag deliver to fluentd"))
39
+ ```
40
+
41
+ ### data
42
+
43
+ ```
44
+ { :url => url, :body => body }
45
+ ```
46
+
47
+ The data tagged `bugsnag.deliver`.
48
+
49
+ ## Development
50
+
51
+ 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.
52
+
53
+ 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).
54
+
55
+ ## Contributing
56
+
57
+ 1. Fork it ( https://github.com/koshigoe/bugsnag-delivery-fluent/fork )
58
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
59
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
60
+ 4. Push to the branch (`git push origin my-new-feature`)
61
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "bugsnag/delivery/fluent"
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,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'bugsnag/delivery/fluent/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "bugsnag-delivery-fluent"
8
+ spec.version = Bugsnag::Delivery::Fluent::VERSION
9
+ spec.authors = ["koshigoe"]
10
+ spec.email = ["koshigoeb@gmail.com"]
11
+
12
+ spec.summary = %q{Delivery method send to fluent for bugsnag/bugsnag-ruby.}
13
+ spec.description = %q{Delivery method send to fluent for bugsnag/bugsnag-ruby.}
14
+ spec.homepage = "https://github.com/koshigoe/bugsnag-delivery-fluent"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.8"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency 'rspec'
25
+ spec.add_development_dependency 'rspec-mocks'
26
+
27
+ spec.add_runtime_dependency 'bugsnag'
28
+ spec.add_runtime_dependency 'fluent-logger'
29
+ end
@@ -0,0 +1,40 @@
1
+ require 'bugsnag'
2
+ require 'bugsnag/delivery'
3
+ require 'bugsnag/delivery/fluent/version'
4
+ require 'fluent-logger'
5
+
6
+ module Bugsnag
7
+ module FluentConfiguration
8
+ def self.included(klass)
9
+ klass.class_eval do
10
+ attr_accessor :fluent_tag_prefix
11
+ attr_accessor :fluent_host
12
+ attr_accessor :fluent_port
13
+ end
14
+ Bugsnag.configuration.fluent_tag_prefix = 'bugsnag'
15
+ Bugsnag.configuration.fluent_host = 'localhost'
16
+ Bugsnag.configuration.fluent_port = 24224
17
+ end
18
+ end
19
+
20
+ class Configuration
21
+ include FluentConfiguration
22
+ end
23
+
24
+ module Delivery
25
+ class Fluent
26
+ def self.deliver(url, body, configuration)
27
+ logger = ::Fluent::Logger::FluentLogger.new(
28
+ configuration.fluent_tag_prefix,
29
+ :host => configuration.fluent_host,
30
+ :port => configuration.fluent_port
31
+ )
32
+ unless logger.post('deliver', { :url => url, :body => body })
33
+ configuration.logger.error logger.last_error
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+
40
+ Bugsnag::Delivery.register(:fluent, Bugsnag::Delivery::Fluent)
@@ -0,0 +1,13 @@
1
+ module Bugsnag
2
+ module Delivery
3
+ class Fluent
4
+ VERSION = "0.1.0"
5
+ end
6
+ end
7
+ end
8
+
9
+
10
+
11
+
12
+
13
+
metadata ADDED
@@ -0,0 +1,139 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bugsnag-delivery-fluent
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-21 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: '1.8'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.8'
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: rspec
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: rspec-mocks
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: bugsnag
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
+ - !ruby/object:Gem::Dependency
84
+ name: fluent-logger
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: Delivery method send to fluent for bugsnag/bugsnag-ruby.
98
+ email:
99
+ - koshigoeb@gmail.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - ".gitignore"
105
+ - ".rspec"
106
+ - ".travis.yml"
107
+ - Gemfile
108
+ - README.md
109
+ - Rakefile
110
+ - bin/console
111
+ - bin/setup
112
+ - bugsnag-delivery-fluent.gemspec
113
+ - lib/bugsnag/delivery/fluent.rb
114
+ - lib/bugsnag/delivery/fluent/version.rb
115
+ homepage: https://github.com/koshigoe/bugsnag-delivery-fluent
116
+ licenses:
117
+ - MIT
118
+ metadata: {}
119
+ post_install_message:
120
+ rdoc_options: []
121
+ require_paths:
122
+ - lib
123
+ required_ruby_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ requirements: []
134
+ rubyforge_project:
135
+ rubygems_version: 2.4.5
136
+ signing_key:
137
+ specification_version: 4
138
+ summary: Delivery method send to fluent for bugsnag/bugsnag-ruby.
139
+ test_files: []