Web*_*ube 7 python flask newrelic
我有一个新的relic代理配置如下:
newrelic==2.56.0.42
newrelic.agent.initialize(newrelic_ini_file, newrelic_env)
logging.info('NewRelic initialized with newrelic_env '+repr(newrelic_env))
logging.info('NewRelic config name is '+repr(newrelic.agent.application().name))
Run Code Online (Sandbox Code Playgroud)
它正在记录"正确"的东西staging,但它没有发送.
NewRelic initialized with newrelic_env 'staging'
NewRelic config name is 'My Service (Staging)'
Run Code Online (Sandbox Code Playgroud)
代理从localhost和发送数据production.
这是newrelic.ini文件中的一些配置
[newrelic]
license_key = xxxxx
app_name = My Service
monitor_mode = true
log_file = /tmp/newrelic-python-agent.log
log_level = info
Run Code Online (Sandbox Code Playgroud)
这是我的暂存配置 newrelic.ini
[newrelic:staging]
app_name = My Service (Staging)
monitor_mode = true
log_level = debug
Run Code Online (Sandbox Code Playgroud)
我认为可疑的一个日志就是这个
(14/NR-Harvest-Thread) newrelic.core.agent DEBUG - Completed harvest of all application data in 0.00 seconds.
Run Code Online (Sandbox Code Playgroud)
我认为代理商不会因为该0.00 seconds部分而收集任何数据.
我debug应该查找哪些日志,以验证200从新文件发送和接收的实际数据.
其他详细信息:正在运行暂存 Docker alpine:3.6
答案的线索确实是调试日志harvest of all application data in 0.00 seconds.
显然,newrelic.agent.initialize必须先走 app = Flask(__name__)。之前搬家了,就开始发送了。
| 归档时间: |
|
| 查看次数: |
327 次 |
| 最近记录: |