tinelic
tinelic copied to clipboard
Not receiving data from Ruby newrelic_rpm gem
Two problems with receiving data from the Ruby newrelic_rpm gem.
First problem is that the Ruby gem sends the data specifying version, license and method to call in the URI path instead of as parameters: /agent_listener/#{PROTOCOL_VERSION}/#{@license_key}/#{method}
If I modify the Ruby gem to instead send this as parameters to the URI "/agent_listener/invoke_raw_method", then tinelic accepts the requests. The problem then being that it can't seem to parse the data.
@Excds If you can make kind of dummy ruby app that should send telemetry to newrelic I can check it
Was able to get this to work by adding this initializer:
module NewRelic
module Agent
class NewRelicService
# The path on the server that we should post our data to
def remote_method_uri(method, format)
params = {
'run_id' => @agent_id,
'marshal_format' => format,
'method' => method,
'license_key' => @license_key,
'protocol_version' => PROTOCOL_VERSION
}
uri = "/agent_listener/invoke_raw_method"
uri << '?' + params.map do |k,v|
next unless v
"#{k}=#{v}"
end.compact.join('&')
uri
end
end
end
end
Basically overriding the NewRelic RPM code. I dont think all the data is sending properly though. I only get errors and database information. No requests. Also noticed that I keep getting this returned from the server:
NewRelic::Agent::NewRelicService::CollectorError: : NewRelic: unknown method error_event_data
Looks like that isn't configured for collection.