From 4d4bd1131e900854158087a229188dc4be57e47f Mon Sep 17 00:00:00 2001 From: Shizuo Fujita Date: Thu, 17 Sep 2026 17:37:33 +0900 Subject: [PATCH] Replace Yajl with the json gem for record summarization yajl-ruby cannot be built on Ruby HEAD because it relies on internal C APIs that were removed. The json gem is a default gem, so it is always available, and it is no longer slower than yajl-ruby. --- lib/fluent/plugin/out_tdlog.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/fluent/plugin/out_tdlog.rb b/lib/fluent/plugin/out_tdlog.rb index fccc22d..819e655 100644 --- a/lib/fluent/plugin/out_tdlog.rb +++ b/lib/fluent/plugin/out_tdlog.rb @@ -1,4 +1,5 @@ require 'fileutils' +require 'json' require 'tempfile' require 'zlib' require 'stringio' @@ -136,7 +137,7 @@ def format(tag, time, record) end def summarize_record(record) - json = Yajl.dump(record) + json = JSON.generate(record) if json.size > 100 json[0..97] + "..." else