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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74b815d4e264c1d731d4c525c0178b944889d7ba64622e1808dfcb07ac1bf684
4
- data.tar.gz: 80ff786898637a053f43c4802456669efb166b11cc4a3428e73ed9ebd2f664a8
3
+ metadata.gz: 9bd4c79e88a97fa9e5b02083cfccc7c8a7b6100843693dbcc5ba711e982d8c77
4
+ data.tar.gz: b7a1dd40adb50c2d829cfb9a1c99984bc2ca2b10c8ff9642d503970657cc096a
5
5
  SHA512:
6
- metadata.gz: 97a306915c7e181be0b043aa0cf79a922e4cf601ab0da71134ae8799888547b506bdf56fa58046d1b277fb21dc1392fe3a1016a5b149c887d5cd0c44a54f856f
7
- data.tar.gz: d97351b8bf00421f33d73f9e6b46c375ba6176f677c6a2e335220f65f318ccd7d0a22f88f20a1d5b1f1c67ffa9da2660e4c75f1b91f24b618b0c9bddb8c820db
6
+ metadata.gz: 74147ebd54540b94b5ba09032f371b9e53d7e82936add26d8fefaecaa4356ede397bb3bfc04cb666e117867123e3ab4788521a9e28d3f3d4cc7d9139ca464870
7
+ data.tar.gz: 79377b96d6e2f531a1c0f218393f8bcd8e9c43ac29ebe3d79cfb27b6c518ddc91b45d8b9a87304e2b5ebc3e4ea2e3ee63439aa5cfab5d9cf232636a18b80c613
@@ -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.1"
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.to_json}]}]}
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.1
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: []