fluent-plugin-indicative 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7843f2da828e79b082ce75329b832e8299f50d8970d408be615c37eba450ad2
4
- data.tar.gz: 64664e64232f705abc6fd7271c6bc554fafd52a38cf2dcc45fbf7d360ef538bd
3
+ metadata.gz: 1a1f7e33dbe67ed7c98c51b31abb341fc46d6305d53e450cb2097b7fb95e0836
4
+ data.tar.gz: a3a89d0dba472abbc7ec0bc4d5a541f473dac6ed792e1e8ad113e5622c588061
5
5
  SHA512:
6
- metadata.gz: c6eda450181334ba1faf9e3b079b4083fa9e5a776ccad3248ae207737492c98639b652a890fcbb74b1708930e9f8502639076724a4df7836dd45a4a504704160
7
- data.tar.gz: 39a44e66a2cc3e26354eacbb6f2999659195b46e43d4c45ac7492250be8a8673f945af500fa95b19676fa28c679113179e2b096fd0ea07941da02c307e626c77
6
+ metadata.gz: c47a09e0bd2ac51f238fb2d72e749ae25eec3773eb61561e75c04af27bdd0a632bfe9305af451154bfe3583810764248d561dcaa818504917dec0e909112132c
7
+ data.tar.gz: bd7f03755abd0411e136a7cec65f78c21d2c01647a4a0d8a303f997d796cc126a983d874e204bb33dcc60ef289f71a521ca8878dbff3c62313e773ec7250a5d7
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ *.gem
2
+ *.rbc
3
+ .ruby-version
4
+ .ruby-gemset
5
+ Gemfile.lock
File without changes
data/README.md CHANGED
@@ -1 +1,16 @@
1
1
  # fluent-plugin-indicative
2
+
3
+ Fluentd output plugin to send events to [Indicative](https://www.indicative.com/)
4
+
5
+ ## Configuration
6
+
7
+ ```
8
+ <match tag>
9
+ @type indicative
10
+
11
+ api_key INDICATIVE_API_KEY
12
+ event_name_key event_name
13
+ event_time_key created_at
14
+ event_unique_id_keys user_id, cookie_id, session_id # keys to search for unique user ID value, in order of priority
15
+ </match>
16
+ ```
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "fluent-plugin-indicative"
6
- s.version = "0.1.0"
6
+ s.version = "0.1.1"
7
7
  s.authors = ["Sam Millar"]
8
8
  s.email = ["sam@millar.io"]
9
9
  s.homepage = "https://github.com/millar/fluent-plugin-indicative"
@@ -1,3 +1,4 @@
1
+ require 'date'
1
2
  require 'net/http'
2
3
  require 'net/https'
3
4
  require 'uri'
@@ -44,7 +45,7 @@ class Fluent::Plugin::IndicativeOutput < Fluent::Plugin::Output
44
45
  eventName: data[@event_name_key],
45
46
  eventUniqueId: unique_id_key && data[unique_id_key],
46
47
  properties: flatten_hash(data),
47
- eventTime: data[@event_time_key]
48
+ eventTime: Date.parse(data[@event_time_key]).rfc3339
48
49
  }
49
50
 
50
51
  http = Net::HTTP.new(uri.host, uri.port)
@@ -52,5 +53,9 @@ class Fluent::Plugin::IndicativeOutput < Fluent::Plugin::Output
52
53
  request = Net::HTTP::Post.new(uri.request_uri, headers)
53
54
  request.body = payload.to_json
54
55
  response = http.request(request)
56
+
57
+ if response.code != 200
58
+ log.warn("Indicative responded with error: #{response.body} for #{payload.to_json}")
59
+ end
55
60
  end
56
61
  end
@@ -48,7 +48,7 @@ class IndicativeOutputTest < Test::Unit::TestCase
48
48
  'user_id' => nil,
49
49
  'screen.id' => 'index'
50
50
  },
51
- 'eventTime' => '2015-01-01T00:00:00.000Z'
51
+ 'eventTime' => '2015-01-01T00:00:00+00:00'
52
52
  }.to_json, times: 1
53
53
  end
54
54
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-indicative
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Millar
@@ -85,10 +85,10 @@ executables: []
85
85
  extensions: []
86
86
  extra_rdoc_files: []
87
87
  files:
88
+ - ".gitignore"
88
89
  - ".travis.yml"
89
90
  - Gemfile
90
- - Gemfile.lock
91
- - LICENSE.txt
91
+ - LICENSE
92
92
  - README.md
93
93
  - Rakefile
94
94
  - fluent-plugin-indicative.gemspec
data/Gemfile.lock DELETED
@@ -1,61 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- fluent-plugin-indicative (0.1.0)
5
- fluentd (>= 0.14.15, < 2)
6
-
7
- GEM
8
- remote: http://rubygems.org/
9
- specs:
10
- addressable (2.6.0)
11
- public_suffix (>= 2.0.2, < 4.0)
12
- cool.io (1.5.4)
13
- crack (0.4.3)
14
- safe_yaml (~> 1.0.0)
15
- dig_rb (1.0.1)
16
- fluentd (1.6.0)
17
- cool.io (>= 1.4.5, < 2.0.0)
18
- dig_rb (~> 1.0.0)
19
- http_parser.rb (>= 0.5.1, < 0.7.0)
20
- msgpack (>= 0.7.0, < 2.0.0)
21
- serverengine (>= 2.0.4, < 3.0.0)
22
- sigdump (~> 0.2.2)
23
- strptime (>= 0.2.2, < 1.0.0)
24
- tzinfo (~> 1.0)
25
- tzinfo-data (~> 1.0)
26
- yajl-ruby (~> 1.0)
27
- hashdiff (0.4.0)
28
- http_parser.rb (0.6.0)
29
- msgpack (1.3.0)
30
- power_assert (1.1.4)
31
- public_suffix (3.1.1)
32
- rake (12.3.2)
33
- safe_yaml (1.0.5)
34
- serverengine (2.1.1)
35
- sigdump (~> 0.2.2)
36
- sigdump (0.2.4)
37
- strptime (0.2.3)
38
- test-unit (3.3.3)
39
- power_assert
40
- thread_safe (0.3.6)
41
- tzinfo (1.2.5)
42
- thread_safe (~> 0.1)
43
- tzinfo-data (1.2019.2)
44
- tzinfo (>= 1.0.0)
45
- webmock (3.6.0)
46
- addressable (>= 2.3.6)
47
- crack (>= 0.3.2)
48
- hashdiff (>= 0.4.0, < 2.0.0)
49
- yajl-ruby (1.4.1)
50
-
51
- PLATFORMS
52
- ruby
53
-
54
- DEPENDENCIES
55
- fluent-plugin-indicative!
56
- rake
57
- test-unit (>= 3.1.0)
58
- webmock (>= 3.6.0, < 4)
59
-
60
- BUNDLED WITH
61
- 1.16.1