CSS App insights - Support prepared statement to receive full SQL query in Java app insights logs
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java, mysql
- Domain
- databases, observability
Research direction
No source file or test is named. Start by reproducing the MyBatis-Plus prepared-statement case with Java SDK 3.7.1 and trace how database dependency data is captured and query masking is applied. Done means App Insights logs expose the requested full SQL for this scenario without breaking existing dependency telemetry.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Java
- Stars
- 327
- Forks
- 222
- Avg merge
- 22h 34m
- Merged PRs (30d)
- 14
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/ApplicationInsights-Java
-
microsoft/ApplicationInsights-Java#4851 · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
microsoft/ApplicationInsights-Java#4817 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
microsoft/ApplicationInsights-Java#4770 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
microsoft/ApplicationInsights-Java#4769 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/ApplicationInsights-Java#4729 · 121 comments ·
All issues in microsoft/ApplicationInsights-Java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
elastic/gradle-plugins#157 ·
-
enhancement Tools
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
apache/rocketmq-dashboard#5008 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
DETECT_PARAMETER_NAMES=false silently disables @ConstructorProperties-based Creator detection too Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
FasterXML/jackson-databind#6229 ·