Skip to content

Use JSON.generate instead of Yajl.dump #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Component,Origin,License
plugin,github.com/brianmario/yajl-ruby,MIT
plugin,github.com/bundler/bundler,MIT
plugin,github.com/ruby/openssl,BSD-2-Clause
plugin,github.com/ruby/rake,MIT
1 change: 0 additions & 1 deletion fluent-plugin-datadog.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "bundler", "~> 2.1"
spec.add_development_dependency "test-unit", '~> 3.1'
spec.add_development_dependency "rake", "~> 12.0"
spec.add_development_dependency "yajl-ruby", "~> 1.2"
spec.add_development_dependency 'webmock', "~> 3.6.0"

spec.metadata = {
Expand Down
6 changes: 3 additions & 3 deletions lib/fluent/plugin/out_datadog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

require "socket"
require "openssl"
require "yajl"
require "json"
require "zlib"
require "fluent/plugin/output"

Expand Down Expand Up @@ -118,10 +118,10 @@ def format(tag, time, record)
# is compatible with Time.at below.
record = enrich_record(tag, time.to_f, record)
if @use_http
record = Yajl.dump(record)
record = JSON.generate(record)
else
if @use_json
record = "#{api_key} #{Yajl.dump(record)}"
record = "#{api_key} #{JSON.generate(record)}"
else
record = "#{api_key} #{record}"
end
Expand Down