# How to find customer schema in APM?

**URL:** <https://discuss.elastic.co/t/how-to-find-customer-schema-in-apm/211952>\
**Category:** APM\
**Tags:** java\
**Created:** [December 16, 2019, 7:48am UTC](https://discuss.elastic.co/t/how-to-find-customer-schema-in-apm/211952 "2019-12-16T07:48:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shubhangi](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@Shubhangi](https://discuss.elastic.co/u/Shubhangi)\
**Post date:** [December 16, 2019, 7:48am UTC](https://discuss.elastic.co/t/how-to-find-customer-schema-in-apm/211952/1 "2019-12-16T07:48:47Z")

</div>

**Kibana version** : 6.8

**Elasticsearch version** : 6.8

**APM Server version** : 6.8

**APM Agent language and version** : Java 8

**Browser version** : Firefox 66.0.3 (64-bit)

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: binary files from [elastic.co](http://elastic.co)

**Fresh install or upgraded from other version?** fresh

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:  
How to find customer schema in APM? In the database statement we can only see the table in the query. Is there any way to find schema name for a query? It'd help a lot in the analysis!

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [December 16, 2019, 12:37pm UTC](https://discuss.elastic.co/t/how-to-find-customer-schema-in-apm/211952/2 "2019-12-16T12:37:42Z")

</div>

How can the schema be retrieved? Via [https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html#getSchema--](https://docs.oracle.com/javase/8/docs/api/java/sql/Connection.html#getSchema--)?

---

<div class="post-metadata">

**Author:** ![Shubhangi](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@Shubhangi](https://discuss.elastic.co/u/Shubhangi)\
**Post date:** [December 17, 2019, 6:23am UTC](https://discuss.elastic.co/t/how-to-find-customer-schema-in-apm/211952/3 "2019-12-17T06:23:22Z")

</div>

How do I integrate it with ELK APM? Do I have to run a script, add a field or ingest a pipeline?  
Thanks.

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [December 17, 2019, 8:32am UTC](https://discuss.elastic.co/t/how-to-find-customer-schema-in-apm/211952/4 "2019-12-17T08:32:30Z")

</div>

If the schema is within your DB query, you can use an ingest processor to extract it. If it's not available there, we'd need to add some logic to the agent to capture it.

---

<div class="post-metadata">

**Author:** ![Shubhangi](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@Shubhangi](https://discuss.elastic.co/u/Shubhangi)\
**Post date:** [December 18, 2019, 6:26am UTC](https://discuss.elastic.co/t/how-to-find-customer-schema-in-apm/211952/5 "2019-12-18T06:26:40Z")

</div>

It is not in the query.

> [@felixbarny](#):
>
> we'd need to add some logic to the agent to capture it.

Can you please specify and elaborate on what kind of logic I can use and how?

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [December 18, 2019, 8:46am UTC](https://discuss.elastic.co/t/how-to-find-customer-schema-in-apm/211952/6 "2019-12-18T08:46:11Z")

</div>

This requires changes in the within the agent, it's nothing you can do within your application.

Can you verify that `Connection#getSchema` returns the expected schema?

If so, we could make a change here to also capture the schema:

> <https://github.com/elastic/apm-agent-java/blob/a2d6063d0a2cd7f90caf1d28682ca6bdfc3d9609/apm-agent-plugins/apm-jdbc-plugin/src/main/java/co/elastic/apm/agent/jdbc/helper/JdbcHelperImpl.java#L121-L131>

However, it also requires changes in the Intake API so that the APM Server recognizes and correctly indexes that field.

---

<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:** [January 8, 2020, 4:46am UTC](https://discuss.elastic.co/t/how-to-find-customer-schema-in-apm/211952/7 "2020-01-08T04:46:13Z")

</div>

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