lib/fluent/plugin/out_gcloud_pubsub.rb in fluent-plugin-gcloud-pubsub-custom-1.1.0 vs lib/fluent/plugin/out_gcloud_pubsub.rb in fluent-plugin-gcloud-pubsub-custom-1.2.0
- old
+ new
@@ -1,11 +1,13 @@
require 'fluent/plugin/output'
-
require 'fluent/plugin/gcloud_pubsub/client'
+require 'fluent/plugin_helper/inject'
module Fluent::Plugin
class GcloudPubSubOutput < Output
+ include Fluent::PluginHelper::Inject
+
Fluent::Plugin.register_output('gcloud_pubsub', self)
helpers :compat_parameters, :formatter
DEFAULT_BUFFER_TYPE = "memory"
@@ -45,9 +47,10 @@
super
@publisher = Fluent::GcloudPubSub::Publisher.new @project, @key, @autocreate_topic
end
def format(tag, time, record)
+ record = inject_values_to_record(tag, time, record)
@formatter.format(tag, time, record).to_msgpack
end
def formatted_to_msgpack_binary?
true