# How to hide or mask SQL statements in Distributed Traces

**URL:** <https://community.dynatrace.com/t/how-to-hide-or-mask-sql-statements-in-distributed-traces/53012>\
**Category:** Open Q&A\
**Tags:** databases, distributed-tracing\
**Created:** [August 19, 2025, 7:33am UTC](https://community.dynatrace.com/t/how-to-hide-or-mask-sql-statements-in-distributed-traces/53012 "2025-08-19T07:33:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saqib\_Fayaz](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@Saqib\_Fayaz](https://community.dynatrace.com/u/Saqib_Fayaz)\
**Post date:** [August 19, 2025, 7:33am UTC](https://community.dynatrace.com/t/how-to-hide-or-mask-sql-statements-in-distributed-traces/53012/1 "2025-08-19T07:33:54Z")

</div>

When I open the **Distributed Traces** view, I can see the full SQL statements, for example:

SELECT (columns) FROM (table) WHERE (conditions)

I would like to **mask or hide the entire SQL statement** so that no one can see the actual query text.

- Is there a way to completely **disable SQL statement capture** so Dynatrace doesn’t ingest them at all?
- Alternatively, if SQL statements are ingested, can I **mask or obfuscate them** so they are not visible in the UI?

What is the recommended approach to achieve this?

 ![ss.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/2/e2bf2e919b343baf64e040028bdc6f85208448f9.png)

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [August 19, 2025, 7:10pm UTC](https://community.dynatrace.com/t/how-to-hide-or-mask-sql-statements-in-distributed-traces/53012/2 "2025-08-19T19:10:07Z")

</div>

Hi,

You can check [mask data with Openpipeline](https://docs.dynatrace.com/docs/shortlink/openpipeline-processing-examples#mask-data).

Best regards

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [August 19, 2025, 7:52pm UTC](https://community.dynatrace.com/t/how-to-hide-or-mask-sql-statements-in-distributed-traces/53012/3 "2025-08-19T19:52:12Z")

</div>

There are different options:

- Disable capture of database requests using OneAgent features responsible for capturing database tracing. This depends on the technology used in your monitored process. For example “Java JDBC”. This will disable database spans completely, including Distributed traces classic or Distributed tracing - if traces are from OneAgent. You also won’t see any database services.
- Use OpenPipleline to remove the database spans. This is applicable only for Distributed tracing app. You will still see them in Distributed Traces Classic

Disabling OneAgent feature will work for Managed deployments and SaaS. While OpenPipeline only for SaaS (and new Distributed tracing app).

Anyway - Dynatrace does not capture any sensitive data unless you turn on SQL bind variables capture and those are displayed only for users view view sensitive data priviledge. Generally I would not recommend to remove the database spans or disable its capture.

---

<div class="post-metadata">

**Author:** ![Saqib\_Fayaz](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@Saqib\_Fayaz](https://community.dynatrace.com/u/Saqib_Fayaz)\
**Post date:** [August 20, 2025, 12:41pm UTC](https://community.dynatrace.com/t/how-to-hide-or-mask-sql-statements-in-distributed-traces/53012/4 "2025-08-20T12:41:37Z")

</div>

actually the client i am working with is a bank. so their security team doesn’t want us or anyone who has access to the dynatrace tenant , to see the schema of their database tables, so they want database statements to come inside the grail, but they want schema and values inside the distributed traces to be masked.
