fluent-plugin-dogstatsd 0.0.2 → 0.0.3

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
2
  SHA1:
3
- metadata.gz: f188162ad60261d59a5dd838f6885ad22f793e57
4
- data.tar.gz: 81fb1419996bf0ca51be6f212e69c752237b14b0
3
+ metadata.gz: 565969556dacf436172ed012b9a5eaed2c29d948
4
+ data.tar.gz: 491155caaad84b0c9be52a476d2166ac456d3967
5
5
  SHA512:
6
- metadata.gz: 748ec60e813ebff20e0c35dfc0d480806f0a8eec0ddc690073c13bece6c96d54a049164f080c625dbc06f823bb997996d011cc4ca499d3bf5d9d737d16352792
7
- data.tar.gz: eb3d5f4ce5f50b456df495bce922e90169ceb6ce7d1913ec46288128f97b6b9471a3db2928ff9f9f216d8a489034cf40ca7a499f7e2c08646546ab692174ccbc
6
+ metadata.gz: ddc614f843d34a7ae87f40638fc8894ddc7cb65059c83c67a94f8e3f774cd7aec7f24b118628328270e6488279363c8553e4390a212ad3e5c1a4706e86832005
7
+ data.tar.gz: 33c2369532d6ed1d1437becf77f89904968f90e37c91c021dcae3b0a891491aac9b1775a0d7367a7f61721e446bf0f163aea660fb0d7addd0e5d0cf6f096bc04
data/README.md CHANGED
@@ -32,10 +32,69 @@ Supported types are `increment`, `decrement`, `count`, `gauge`, `histogram`, `ti
32
32
  use_tag_as_key false
33
33
 
34
34
  # (Treat fields in a record as tags)
35
- # flat_tag true
35
+ # flat_tags true
36
36
 
37
37
  # (Metric type in Datadog.)
38
38
  # metric_type increment
39
+
40
+ # Default: "value"
41
+ # value_key Value
42
+ </match>
43
+ ```
44
+
45
+ ## Example
46
+
47
+ ### Count log lines
48
+
49
+ ```apache
50
+ <source>
51
+ type tail
52
+ path /tmp/sample.log
53
+ tag datadog.increment.sample
54
+ format ...
55
+ </source>
56
+
57
+ <match datadog.increment.*>
58
+ type dogstatsd
59
+ metric_type increment
60
+ flat_tags true
61
+ use_tag_as_key true
62
+ </match>
63
+ ```
64
+
65
+ ### Histogram
66
+
67
+ ```apache
68
+ <source>
69
+ type tail
70
+ path /tmp/sample.log
71
+ tag datadog.histogram.sample
72
+ format /^(?<value>[^ ]*) (?<host>[^ ]*)$/
73
+ </source>
74
+
75
+ <match datadog.histogram.*>
76
+ type dogstatsd
77
+ metric_type histogram
78
+ flat_tags true
79
+ use_tag_as_key true
80
+ </match>
81
+ ```
82
+
83
+ ### MySQL threads
84
+
85
+ ```apache
86
+ <source>
87
+ type mysql_query
88
+ tag datadog.histogram.mysql_threads
89
+ query SHOW VARIABLES LIKE 'Thread_%'
90
+ </source>
91
+
92
+ <match datadog.histogram.mysql_threads>
93
+ type dogstatsd
94
+ metric_type histogram
95
+ value_key Value
96
+ flat_tags true
97
+ use_tag_as_key true
39
98
  </match>
40
99
  ```
41
100
 
@@ -1,7 +1,7 @@
1
1
  module Fluent
2
2
  module Plugin
3
3
  module Dogstatsd
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
6
6
  end
7
7
  end
@@ -5,8 +5,10 @@ module Fluent
5
5
  config_param :host, :string, :default => nil
6
6
  config_param :port, :integer, :default => nil
7
7
  config_param :use_tag_as_key, :bool, :default => false
8
- config_param :flat_tag, :bool, :default => false
8
+ config_param :flat_tags, :bool, :default => false
9
+ config_param :flat_tag, :bool, :default => false # obsolute
9
10
  config_param :metric_type, :string, :default => nil
11
+ config_param :value_key, :string, :default => nil
10
12
 
11
13
  unless method_defined?(:log)
12
14
  define_method(:log) { $log }
@@ -47,11 +49,11 @@ module Fluent
47
49
  next
48
50
  end
49
51
 
50
- value = record.delete('value')
52
+ value = record.delete(@value_key || 'value')
51
53
 
52
54
  options = {}
53
55
 
54
- tags = if @flat_tag
56
+ tags = if @flat_tags || @flat_tag
55
57
  record
56
58
  else
57
59
  record['tags']
@@ -94,4 +96,3 @@ module Fluent
94
96
  end
95
97
  end
96
98
  end
97
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-dogstatsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-23 00:00:00.000000000 Z
11
+ date: 2015-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  version: '0'
105
105
  requirements: []
106
106
  rubyforge_project:
107
- rubygems_version: 2.2.2
107
+ rubygems_version: 2.4.5
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: Fluent plugin for Dogstatsd, that is statsd server for Datadog.