Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

CSS App insights - Support prepared statement to receive full SQL query in Java app insights logs

未关闭
#4,396 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
java, mysql

调研方向

未指定源文件或测试。首先,使用 Java SDK 3.7.1 重现 MyBatis-Plus 预处理语句场景,并跟踪数据库依赖项数据的捕获方式以及查询掩码的应用方式。完成标准是:App Insights 日志能够为此场景暴露所请求的完整 SQL,同时不破坏现有的依赖项遥测。

由索引模型根据 Issue 内容生成。

描述

Is your feature request related to a problem? Please describe.
Customer has been disable mask of SQL query by following this doc https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-standalone-config#java-database-connectivity-query-masking, however in app insights logs, there are still some "?" as below:

SELECT ser_no,dealer_no,invoice_no,invoice_date,supplier_code,delivery_note,delivery_date,vips_order_no,order_ref,jd_ship_no,incoming_filename,is_process,batch_no,supplier_id,og_order_no,arrival_date,app_id,owner_par_code,created_by,created_at,updated_by,updated_at,record_version FROM delivery_order_mas_parse \n \n WHERE (dealer_no IN (?,?,?,?) AND is_process = ? AND delivery_note <> ? AND created_at BETWEEN ? AND ?)

Describe the solution you would like
Customers are using mybatisPlus for SQL prepared statements. they would like to receive full SQL query in App insights logs.

Describe alternatives you have considered
No workaround

Additional context
in the log file, we could find "?" in SQL query:

{"ver":1,"name":"RemoteDependency","time":"2025-07-23T09:35:00.096Z","iKey":"*-c68b1ad74b64","tags":{"ai.internal.sdkVersion":"java:3.7.1","ai.operation.id":"a8f7907f388d52573b91a45d3af42021","ai.cloud.roleInstance":"tw-dmscloud-service-ddf6c44d8-vwm8q","ai.cloud.role":"tw-dmscloud-service"},"data":{"baseType":"RemoteDependencyData","baseData":{"ver":2,"name":"SELECT cyx_repair.delivery_order_mas_parse","duration":"00:00:00.001394","id":"dc72f9272b94137f","data":"SELECT ser_no,dealer_no,invoice_no,invoice_date,supplier_code,delivery_note,delivery_date,vips_order_no,order_ref,jd_ship_no,incoming_filename,is_process,batch_no,supplier_id,og_order_no,arrival_date,app_id,owner_par_code,created_by,created_at,updated_by,updated_at,record_version FROM delivery_order_mas_parse \n \n WHERE (dealer_no IN (?,?,?,?) AND is_process = ? AND delivery_note <> ? AND created_at BETWEEN ? AND ?)","type":"mysql","target":"dms-maxscale-svc.dev-middleware:4006 | cyx_repair","success":true}}}

Java SDK is using the latest version 3.7.1

主要语言
Java
星标
327
派生
222
平均合并
22 小时 34 分钟
30 天内合并 PR
14

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/ApplicationInsights-Java 的其他 Issue

查看 microsoft/ApplicationInsights-Java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。