Skip to content

Commit

Permalink
Merge pull request #1402 from autopp/port-1393-to-v0.12
Browse files Browse the repository at this point in the history
Port #1393 to v0.12
  • Loading branch information
repeatedly authored Jan 7, 2017
2 parents 93b8edb + cbf8fc2 commit 60b6bd9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/fluent/plugin/in_monitor_agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def build_object(req, res)
opts[:pretty_json] = true
end

if ivars = (qs['with_ivars'] || []).first
opts[:ivars] = ivars.split(',')
end

if with_config = get_search_parameter(qs, 'with_config'.freeze)
opts[:with_config] = Fluent::Config.bool_value(with_config)
end
Expand Down Expand Up @@ -415,6 +419,13 @@ def get_monitor_info(pe, opts={})
}
end
obj['instance_variables'] = iv
elsif ivars = opts[:ivars]
iv = {}
ivars.each {|name|
iname = "@#{name}"
iv[name] = pe.instance_variable_get(iname) if pe.instance_variable_defined?(iname)
}
obj['instance_variables'] = iv
end

obj
Expand Down

0 comments on commit 60b6bd9

Please sign in to comment.