# Multiple unrelated databases using same service name resulting in inaccurate service map

**URL:** <https://discuss.elastic.co/t/multiple-unrelated-databases-using-same-service-name-resulting-in-inaccurate-service-map/348240>\
**Category:** APM\
**Tags:** java\
**Created:** [November 29, 2023, 2:34pm UTC](https://discuss.elastic.co/t/multiple-unrelated-databases-using-same-service-name-resulting-in-inaccurate-service-map/348240 "2023-11-29T14:34:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigandrews](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/craigandrews/32/126602_2.png) [@craigandrews](https://discuss.elastic.co/u/craigandrews)\
**Post date:** [November 29, 2023, 2:34pm UTC](https://discuss.elastic.co/t/multiple-unrelated-databases-using-same-service-name-resulting-in-inaccurate-service-map/348240/1 "2023-11-29T14:34:24Z")

</div>

I have a bunch of completely different, unrelated Java/Spring applications running on a cloud provider. Each application has its own service name so I can differentiate them in Elastic. Each application uses its own database running on its own MySQL database server. Each application uses the same, default naming for its MySQL database. So even though each application uses a different MySQL database, they all show up in Elastic APM's service map as if they are the same database - but they most certainly are not the same server. How do I get Elastic to show them as the different services they really are?

For example, I have applications A, B, and C. There are database servers mysql-a, mysql-b, and mysql-c. Applications A, B, and C use JDBC connection strings `jdbc:mysql://mysql-a/service_instance_db`, `jdbc:mysql://mysql-a/service_instance_db`, and `jdbc:mysql://mysql-a/service_instance_db` respectively. That results in one service shown in the service map named `mysql/service_instance_db` with A, B, C all connecting to it which is wrong. What I expected is for there to be 3 services shown in the service map, with each application connecting to only its database service (as that's what is really happening).

How do I fix this conflating issue?

Note that I cannot change the MySQL database schema/catalog names - changing all the applications to refer to new names and modifying the databases is too much effort and risk.

---

<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:** [December 27, 2023, 2:34pm UTC](https://discuss.elastic.co/t/multiple-unrelated-databases-using-same-service-name-resulting-in-inaccurate-service-map/348240/2 "2023-12-27T14:34:39Z")

</div>

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