# Elastic apm not show where clause of query

**URL:** <https://discuss.elastic.co/t/elastic-apm-not-show-where-clause-of-query/327936>\
**Category:** APM\
**Tags:** java\
**Created:** [March 17, 2023, 1:32pm UTC](https://discuss.elastic.co/t/elastic-apm-not-show-where-clause-of-query/327936 "2023-03-17T13:32:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Indeed2000](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@Indeed2000](https://discuss.elastic.co/u/Indeed2000)\
**Post date:** [March 17, 2023, 1:32pm UTC](https://discuss.elastic.co/t/elastic-apm-not-show-where-clause-of-query/327936/1 "2023-03-17T13:32:07Z")

</div>

I’m using elastic apm agent on jboss, it show jdbc queries but put “question mark” for where conditions.

What is the reason of this happen? How can i fix it?

Thanks

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [March 20, 2023, 8:23am UTC](https://discuss.elastic.co/t/elastic-apm-not-show-where-clause-of-query/327936/2 "2023-03-20T08:23:31Z")

</div>

The reason is that the Java agent (and all other APM agents) do not capture SQL parameters. We had some discussions around this, but so far we decided to not do this, because this would open up other issues.  
Related: [Capture bind variables for prepared statements · Issue #220 · elastic/apm · GitHub](https://github.com/elastic/apm/issues/220)

---

<div class="post-metadata">

**Author:** ![Indeed2000](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@Indeed2000](https://discuss.elastic.co/u/Indeed2000)\
**Post date:** [March 23, 2023, 7:15am UTC](https://discuss.elastic.co/t/elastic-apm-not-show-where-clause-of-query/327936/3 "2023-03-23T07:15:22Z")

</div>

@Eyal_Koren is there any way to enable it for test purpose?  
If not is there any tool that do this?

Any idea?  
Thanks

---

<div class="post-metadata">

**Author:** ![Jonas\_Kunz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonas_kunz/32/110740_2.png) [@Jonas\_Kunz](https://discuss.elastic.co/u/Jonas_Kunz)\
**Post date:** [March 23, 2023, 12:18pm UTC](https://discuss.elastic.co/t/elastic-apm-not-show-where-clause-of-query/327936/4 "2023-03-23T12:18:10Z")

</div>

There is no workaround to get this feature.  
You could however create a [custom plugin](https://www.elastic.co/guide/en/apm/agent/java/1.x/plugin-api.html) to capture the bind variables for prepared statements.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 20, 2023, 12:19pm UTC](https://discuss.elastic.co/t/elastic-apm-not-show-where-clause-of-query/327936/5 "2023-04-20T12:19:03Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
