Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#4,396 0 comments 0 reactions 0 assignees View on GitHub

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

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/ApplicationInsights-Java

All issues in microsoft/ApplicationInsights-Java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.