fluent-plugin-loki-custom 0.2.1 → 0.2.7
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 +4 -4
- data/fluent-plugin-loki.gemspec +3 -3
- data/lib/fluent/plugin/out_loki.rb +8 -7
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bd4c79e88a97fa9e5b02083cfccc7c8a7b6100843693dbcc5ba711e982d8c77
|
4
|
+
data.tar.gz: b7a1dd40adb50c2d829cfb9a1c99984bc2ca2b10c8ff9642d503970657cc096a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74147ebd54540b94b5ba09032f371b9e53d7e82936add26d8fefaecaa4356ede397bb3bfc04cb666e117867123e3ab4788521a9e28d3f3d4cc7d9139ca464870
|
7
|
+
data.tar.gz: 79377b96d6e2f531a1c0f218393f8bcd8e9c43ac29ebe3d79cfb27b6c518ddc91b45d8b9a87304e2b5ebc3e4ea2e3ee63439aa5cfab5d9cf232636a18b80c613
|
data/fluent-plugin-loki.gemspec
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = "fluent-plugin-loki-custom"
|
5
|
-
gem.version = "0.2.
|
6
|
-
gem.authors = ["Edan Shahmoon"]
|
7
|
-
gem.email = ["edan100@gmail.com"]
|
5
|
+
gem.version = "0.2.7"
|
6
|
+
gem.authors = ["Edan Shahmoon", "Saher El-Neklawy"]
|
7
|
+
gem.email = ["edan100@gmail.com", "saher.neklawy@gmail.com"]
|
8
8
|
gem.summary = %q{A Fluentd output plugin to send logs to Grafana Loki}
|
9
9
|
gem.description = gem.summary
|
10
10
|
gem.homepage = "https://github.com/eeddaann/fluent-plugin-loki"
|
@@ -126,11 +126,11 @@ class Fluent::Plugin::LokiOutput < Fluent::Plugin::Output
|
|
126
126
|
end
|
127
127
|
|
128
128
|
def send_request(req, uri)
|
129
|
-
is_rate_limited = (@rate_limit_msec != 0 and not @last_request_time.nil?)
|
130
|
-
if is_rate_limited and ((Time.now.to_f - @last_request_time) * 1000.0 < @rate_limit_msec)
|
131
|
-
log.info('Dropped request due to rate limiting')
|
132
|
-
return
|
133
|
-
end
|
129
|
+
#is_rate_limited = (@rate_limit_msec != 0 and not @last_request_time.nil?)
|
130
|
+
#if is_rate_limited and ((Time.now.to_f - @last_request_time) * 1000.0 < @rate_limit_msec)
|
131
|
+
#log.info('Dropped request due to rate limiting')
|
132
|
+
#return
|
133
|
+
#end
|
134
134
|
|
135
135
|
res = nil
|
136
136
|
|
@@ -175,14 +175,15 @@ class Fluent::Plugin::LokiOutput < Fluent::Plugin::Output
|
|
175
175
|
st+= "#{key}=\"#{val}\","
|
176
176
|
end
|
177
177
|
record.each do |key, val|
|
178
|
-
st+= "#{key}=\"#{val}\","
|
178
|
+
st+= "#{key}=\"#{val}\"," unless key == "log"
|
179
179
|
end
|
180
180
|
st[-1]="}"
|
181
181
|
return st
|
182
182
|
end
|
183
183
|
def handle_record(tag, time, record)
|
184
|
-
rec = {"streams"=>[{"labels"=>format_labels(@labels, record), "entries"=>[{"ts"=>Time.now.iso8601(3), "line"=>record
|
184
|
+
rec = {"streams"=>[{"labels"=>format_labels(@labels, record), "entries"=>[{"ts"=>Time.now.iso8601(3), "line"=>record["log"]}]}]}
|
185
185
|
# I used time now instead of at 'time' because it cause 'Entry out of order' on loki's side
|
186
|
+
log.debug(rec.to_json)
|
186
187
|
req, uri = create_request(tag, time, rec)
|
187
188
|
send_request(req, uri)
|
188
189
|
end
|
metadata
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-loki-custom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edan Shahmoon
|
8
|
+
- Saher El-Neklawy
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
@@ -89,6 +90,7 @@ dependencies:
|
|
89
90
|
description: A Fluentd output plugin to send logs to Grafana Loki
|
90
91
|
email:
|
91
92
|
- edan100@gmail.com
|
93
|
+
- saher.neklawy@gmail.com
|
92
94
|
executables: []
|
93
95
|
extensions: []
|
94
96
|
extra_rdoc_files: []
|