newrelic_rpm如何向New Relic服务器发送数据?
我们在生产环境中使用 newrelic_rpm。
我将日志级别更改为调试。 每当代理将数据发送到服务器时,它都会显示:
[11/08/11 13:58:09 +0530 mubarocks.local (788)] DEBUG : Sending data to New Relic Service
[11/08/11 13:58:09 +0530 mubarocks.local (788)] DEBUG : Spool file empty.
[11/08/11 13:58:09 +0530 mubarocks.local (788)] DEBUG : Connect to newrelic.com:80/agent_listener/8/.../metric_data?run_id=327878253
[11/08/11 13:58:09 +0530 mubarocks.local (788)] DEBUG : Http Connection opened to 204.93.223.142:80
[11/08/11 13:58:10 +0530 mubarocks.local (788)] DEBUG : Uncompressed content returned
[11/08/11 13:58:10 +0530 mubarocks.local (788)] DEBUG : 2011-11-08 13:58:09 +0530: sent 8 timeslices (327878253) in 0.660168 seconds
它不显示正在发送的实际数据。
如何记录发送到服务器的实际数据?
如何调试数据格式?
We are using newrelic_rpm in production environment.
I changed the log level to debug.
Whenever agent sends data to servers it displays:
[11/08/11 13:58:09 +0530 mubarocks.local (788)] DEBUG : Sending data to New Relic Service
[11/08/11 13:58:09 +0530 mubarocks.local (788)] DEBUG : Spool file empty.
[11/08/11 13:58:09 +0530 mubarocks.local (788)] DEBUG : Connect to newrelic.com:80/agent_listener/8/.../metric_data?run_id=327878253
[11/08/11 13:58:09 +0530 mubarocks.local (788)] DEBUG : Http Connection opened to 204.93.223.142:80
[11/08/11 13:58:10 +0530 mubarocks.local (788)] DEBUG : Uncompressed content returned
[11/08/11 13:58:10 +0530 mubarocks.local (788)] DEBUG : 2011-11-08 13:58:09 +0530: sent 8 timeslices (327878253) in 0.660168 seconds
It doesn't show actual data being sent.
How can I log actual data which is being sent to server?
How can I debug the data format?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
追踪调用堆栈,需要查看gem的来源。
数据实际上是通过 Net::HTTP::Post 发送的,
但是,当数据到达这里时,它已经被压缩了。
所以
compress_data
是一个值得一看的好地方。因此,让我们添加一个初始化程序,每当发送数据时都会添加日志语句。
这应该能让你从一个不错的地方开始。
Tracing the call stack, you need to look at the source of the gem.
The data is actually send by a
Net::HTTP::Post
But, by the point the data arrives here, it's compressed.
So
compress_data
is a good place to look.So lets add an initializer that adds log statements whenever the data is sent.
And that should get you somewhere decent to start with.
New Relic 现在支持 审核日志,使应用程序传输的所有数据都能以人类可读的格式记录。
New Relic now supports an audit log, enabling all data that is transmitted by the app to be logged in human-readable format.