You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

New Relic数据库慢查询无法显示带实际参数的SQL语句求助

Troubleshooting Missing Raw SQL with Parameters in New Relic for Kinto + PostgreSQL

Hey there! Let's work through this issue together since you're new to New Relic and trying to capture slow SQL queries with their actual parameters for your Kinto setup connected to PostgreSQL. Here are the key steps to check:

  • Double-check your kinto.ini configuration
    First, make sure the transaction_tracer.record_sql = raw setting is placed correctly under the [newrelic] section of your kinto.ini file. Typos or wrong section placement are super easy to miss! Also, don't forget to restart your Kinto service after making configuration changes—this is a common oversight that keeps new settings from kicking in.

  • Verify New Relic Agent Compatibility & Version
    Since Kinto is a Python application, you're using the New Relic Python agent. Ensure you're running a recent, stable version of the agent—older versions might have limitations on capturing raw SQL with parameters. Also, confirm that you have the necessary PostgreSQL driver (like psycopg2) installed, as the agent relies on this to intercept database calls.

  • Check Transaction Tracer Prerequisites
    Raw SQL recording won't work if transaction tracing itself is disabled. Make sure you have transaction_tracer.enabled = true in your New Relic config. Additionally, check the transaction_tracer.threshold value—this determines how slow a query needs to be to get recorded. If your "slow" queries don't meet this threshold, they won't show up. Try temporarily setting it to 0.1 (100ms) to test if you can capture queries with parameters.

  • Confirm You're Looking in the Right Place in New Relic
    It's easy to navigate to the wrong section! Raw SQL with parameters should appear under:

    • Transactions → Select the specific Kinto transaction → Databases tab
    • Or Database → Query analysis
      Also, make sure you're viewing data collected after you updated your configuration—old data won't reflect the new settings.
  • Rule Out Obfuscation or Middleware Interference
    Check if New Relic's SQL obfuscation is accidentally enabled—this replaces parameters with ?. Ensure transaction_tracer.obfuscate_sql = false is set in your config. Additionally, verify that Kinto itself isn't doing any parameter masking that would prevent the agent from capturing the actual values (though the agent intercepts at the driver level, so this is less likely).

内容的提问来源于stack exchange,提问作者Dhairya

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 08:27:41