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 +5 -5
- data/README.md +38 -14
- data/fluent-plugin-datadog_event.gemspec +1 -0
- data/lib/fluent/plugin/datadog_event/version.rb +1 -1
- data/lib/fluent/plugin/in_datadog_event.rb +6 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 84eedb6ff68ca19b14a61c7d73296fbe24f61952660f4cabd226c0d82574e2a6
|
4
|
+
data.tar.gz: 8a43830de5c19b630576587954614dd4d04416b742ac819c14e17c5211d191d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
21
|
+
(latter path depending upon acceptance)
|
22
|
+
|
23
|
+
## Configuration
|
24
24
|
|
25
|
-
|
25
|
+
### Syntax
|
26
26
|
|
27
|
-
|
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
|
-
|
46
|
+
### Dynamic config
|
30
47
|
|
31
|
-
|
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
|
-
|
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
|
@@ -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.
|
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:
|
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
|
118
|
+
rubygems_version: 2.7.6
|
105
119
|
signing_key:
|
106
120
|
specification_version: 4
|
107
121
|
summary: fluentd plugin for datadog event
|