fluent-plugin-deis-kafka 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/fluent/mixin/deis.rb +8 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d1cabe61da7f602a89d4a817ffc764e24440bec
|
4
|
+
data.tar.gz: 15c427fb105d9cc188b6f15cad446f4d52d69fc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75709daeaca14773c0813ac7a77eb936afe70924c8bce4b4de007962b646a31d2db4408aba71fb63a1e6b10fff024cc2c09052a11f4d54406fe105e7bb1ecf75
|
7
|
+
data.tar.gz: 404a89d809fcc7b2351de81db23388f109a64b870dde0f190331e2e2f244388d73f5032fc89bd9286b5a03b39808ce0e5c9990372d56f4ee6a7243775dd7aad6
|
data/README.md
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
# fluentd-plugin-deis-kafka
|
2
|
-
[![Build Status](https://travis-ci.org/topfreegames/fluent-plugin-deis-kafka.svg?branch=master)](https://travis-ci.org/topfreegames/fluent-plugin-deis-kafka) [![Dependency Status](https://gemnasium.com/badges/github.com/topfreegames/fluent-plugin-deis-kafka.svg)](https://gemnasium.com/github.com/topfreegames/fluent-plugin-deis-kafka) [![Gem Version](https://badge.fury.io/rb/
|
2
|
+
[![Build Status](https://travis-ci.org/topfreegames/fluent-plugin-deis-kafka.svg?branch=master)](https://travis-ci.org/topfreegames/fluent-plugin-deis-kafka) [![Dependency Status](https://gemnasium.com/badges/github.com/topfreegames/fluent-plugin-deis-kafka.svg)](https://gemnasium.com/github.com/topfreegames/fluent-plugin-deis-kafka) [![Gem Version](https://badge.fury.io/rb/fluent-plugin-deis-kafka.svg)](https://badge.fury.io/rb/fluent-plugin-deis-kafka)
|
data/lib/fluent/mixin/deis.rb
CHANGED
@@ -21,22 +21,26 @@ module Fluent
|
|
21
21
|
def build_series(message)
|
22
22
|
metric = parse_router_log(message['log'], message['kubernetes']['host'])
|
23
23
|
if metric
|
24
|
+
metric_timestamp = (metric['timestamp'].to_f * 1_000_000_000).to_i
|
24
25
|
tags = { app: metric['app'], status_code: metric['status_code'], host: metric['host'] }
|
25
26
|
data = [
|
26
27
|
{
|
27
28
|
series: 'deis_router_request_time_ms',
|
28
29
|
values: { value: metric['request_time'] },
|
29
|
-
tags: tags
|
30
|
+
tags: tags,
|
31
|
+
timestamp: metric_timestamp
|
30
32
|
},
|
31
33
|
{
|
32
34
|
series: 'deis_router_response_time_ms',
|
33
35
|
values: { value: metric['response_time'] },
|
34
|
-
tags: tags
|
36
|
+
tags: tags,
|
37
|
+
timestamp: metric_timestamp
|
35
38
|
},
|
36
39
|
{
|
37
40
|
series: 'deis_router_bytes_sent',
|
38
41
|
values: { value: metric['bytes_sent'] },
|
39
|
-
tags: tags
|
42
|
+
tags: tags,
|
43
|
+
timestamp: metric_timestamp
|
40
44
|
}
|
41
45
|
]
|
42
46
|
return data
|
@@ -51,6 +55,7 @@ module Fluent
|
|
51
55
|
split_message = message.split(' - ')
|
52
56
|
return nil if split_message.length < 14
|
53
57
|
metric = {}
|
58
|
+
metric['timestamp'] = Time.parse(split_message[0])
|
54
59
|
metric['app'] = split_message[1].strip
|
55
60
|
metric['status_code'] = split_message[4].strip
|
56
61
|
metric['bytes_sent'] = split_message[6].strip.to_f
|