fluent-plugin-grafana-loki: Fixes the issue when sorting entries with the same timestamps (#950)

* Fixes the issue when sorting entries with the same timestamps

* bump gem version

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Co-authored-by: Cyril Tovena <cyril.tovena@gmail.com>
pull/1211/head
Gnitry 6 years ago committed by Cyril Tovena
parent 149c70a2ca
commit 710eb78e3f
  1. 2
      fluentd/fluent-plugin-grafana-loki/fluent-plugin-grafana-loki.gemspec
  2. 2
      fluentd/fluent-plugin-grafana-loki/lib/fluent/plugin/out_loki.rb

@ -4,7 +4,7 @@ $LOAD_PATH.push File.expand_path('lib', __dir__)
Gem::Specification.new do |spec|
spec.name = 'fluent-plugin-grafana-loki'
spec.version = '1.1.0'
spec.version = '1.1.1'
spec.authors = %w[woodsaj briangann]
spec.email = ['awoods@grafana.com', 'brian@grafana.com']

@ -161,7 +161,7 @@ module Fluent
# 'labels' => '{worker="0"}',
payload.push(
'labels' => labels_to_protocol(k),
'entries' => v.sort_by { |hsh| Time.parse(hsh['ts']) }
'entries' => v.sort_by.with_index { |hsh, i| [Time.parse(hsh['ts']), i] }
)
end
payload

Loading…
Cancel
Save