fluent-plugin-datadog_event 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3d8bfa53cae290705b8ff6f54b9bce6dbbb0c965
4
- data.tar.gz: 0e551b58a5225263b34e0dfbcf55ffccf3df4e07
2
+ SHA256:
3
+ metadata.gz: 84eedb6ff68ca19b14a61c7d73296fbe24f61952660f4cabd226c0d82574e2a6
4
+ data.tar.gz: 8a43830de5c19b630576587954614dd4d04416b742ac819c14e17c5211d191d6
5
5
  SHA512:
6
- metadata.gz: 5c2e62acdc076b5bf7bf77469e5632aded7afea72b803c74083c9d9a638c2fa2dfe5fc64a8fb12732ccec20291982f306c3388c361601c498bac322dd44abdb4
7
- data.tar.gz: 2a71062b608b0dcf8f693dbe1d4e50c09ec88d27f0ff3fd2210e3731a4b7c71c0ab8a0194dfb8a30e3f27094a213cddaca437f1a8d6c9d68468ef8868cf88cb9
6
+ metadata.gz: '08510a3d1c94a81b9ae98b87a4b652a662e4b28ce6b237a142630fdfd3aed46f41b0fc01a293357baaac931a741ad51ee6a110f412e6a69a5581884012cc7b2c'
7
+ data.tar.gz: 12ca661e685b26c9af31a656d730247146bca2dfabae7a1b4b997c53d71fc2c0970bf29eaafd5ca11be1bd6b4577da4ca49fa65f43454a1bd9a6e8b45991dbe2
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Fluent::Plugin::DatadogEvent
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/fluent/plugin/datadog_event`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Generates Datadog events from matching fluent records.
6
4
 
7
5
  ## Installation
8
6
 
@@ -20,20 +18,46 @@ Or install it yourself as:
20
18
 
21
19
  $ gem install fluent-plugin-datadog_event
22
20
 
23
- ## Usage
21
+ (latter path depending upon acceptance)
22
+
23
+ ## Configuration
24
24
 
25
- TODO: Write usage instructions here
25
+ ### Syntax
26
26
 
27
- ## Development
27
+ ```
28
+ <match ddevents.info>
29
+ type datadog_event
30
+ # DD api key - mandatory
31
+ api_key MyApIKey110123kjla7
32
+ # all other config parameters are optional
33
+ # datadog specific tags associated with event
34
+ tags fluentevent
35
+ # alert type: info, warning, error, or success
36
+ alert_type info
37
+ # aggregation key - anything with this unique value will be considered an additional instance of the same event
38
+ aggregation_key "my_aggregation_key"
39
+ # Message title
40
+ msg_title "My app event"
41
+ # Source name - for filtering by event source
42
+ source_type_name "my_app_named"
43
+ </match>
44
+ ```
28
45
 
29
- 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.
46
+ ### Dynamic config
30
47
 
31
- 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).
48
+ Tag values can be used for configuration, leading to a config style such as:
49
+
50
+ ```
51
+ <match ddevents.**>
52
+ type datadog_event
53
+ api_key yOuraPIKeyaaAAAAaA
54
+ tags fluentevent
55
+ alert_type $tag_parts[2]
56
+ aggregation_key $tag_parts[1]
57
+ msg_title "App event: ${tag_parts[1]}"
58
+ source_type_name "fluent-${tag_parts[1])"
59
+ </match>
60
+ ```
32
61
 
33
- ## Contributing
62
+ With the above config, an event tagged as 'ddevents.myapp.info' would be handled at the level of info, with "myapp" as part of the messahe, source_type, and aggregation key - Use of rewrite-tag-names can make this very flexible.
34
63
 
35
- 1. Fork it ( https://github.com/[my-github-username]/fluent-plugin-datadog_event/fork )
36
- 2. Create your feature branch (`git checkout -b my-new-feature`)
37
- 3. Commit your changes (`git commit -am 'Add some feature'`)
38
- 4. Push to the branch (`git push origin my-new-feature`)
39
- 5. Create a new Pull Request
@@ -22,4 +22,5 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake", "~> 10.0"
23
23
  spec.add_runtime_dependency "dogapi"
24
24
  spec.add_runtime_dependency "fluentd"
25
+ spec.add_runtime_dependency "fluent-mixin-rewrite-tag-name"
25
26
  end
@@ -1,7 +1,7 @@
1
1
  module Fluent
2
2
  module Plugin
3
3
  module DatadogEvent
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
6
6
  end
7
7
  end
@@ -1,3 +1,5 @@
1
+ require 'fluent/mixin/rewrite_tag_name'
2
+
1
3
  module Fluent
2
4
  class InDatadogEvent < Fluent::Input
3
5
  Fluent::Plugin.register_input('datadog_event', self)
@@ -10,6 +12,8 @@ module Fluent
10
12
  define_method("router") { Fluent::Engine }
11
13
  end
12
14
 
15
+ include Fluent::HandleTagNameMixin
16
+ include Fluent::Mixin::RewriteTagName
13
17
  config_param :api_key, :string
14
18
  config_param :app_key, :string, :default => nil
15
19
  config_param :priority, :string, :default => nil
@@ -63,6 +67,8 @@ module Fluent
63
67
  event_id = e["id"]
64
68
  unless read_id(event_id) then
65
69
  time = e["date_happened"]
70
+ emit_tag = tag.dup
71
+ filter_record(emit_tag, time, record)
66
72
  router.emit(@tag, time, e)
67
73
  store_read_id(event_id)
68
74
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-datadog_event
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yohei Kawahara(inokappa)
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-12 00:00:00.000000000 Z
11
+ date: 2018-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: fluent-mixin-rewrite-tag-name
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'
69
83
  description: fluentd plugin for datadog event
70
84
  email:
71
85
  - ''
@@ -101,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
115
  version: '0'
102
116
  requirements: []
103
117
  rubyforge_project:
104
- rubygems_version: 2.6.4
118
+ rubygems_version: 2.7.6
105
119
  signing_key:
106
120
  specification_version: 4
107
121
  summary: fluentd plugin for datadog event