# Database connection

**URL:** <https://discuss.elastic.co/t/database-connection/329309>\
**Category:** APM\
**Tags:** dotnet, infrastructure-observability\
**Created:** [April 4, 2023, 10:53am UTC](https://discuss.elastic.co/t/database-connection/329309 "2023-04-04T10:53:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kirtash](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@Kirtash](https://discuss.elastic.co/u/Kirtash)\
**Post date:** [April 4, 2023, 10:53am UTC](https://discuss.elastic.co/t/database-connection/329309/1 "2023-04-04T10:53:54Z")

</div>

Good morning,

I have a database with differents instances but in the service map it shows according to the server, that is the same.

Is it possible define something to the connections according to server+instance? I think that could be useful.

Thanks

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [April 4, 2023, 11:30am UTC](https://discuss.elastic.co/t/database-connection/329309/2 "2023-04-04T11:30:33Z")

</div>

Hi !

Which APM agent and database are you using ?

The feature might not be 100% identical depending on the platform, for example the Java APM agent does split the relational databases connection per database instance, however for NoSQL databases that's often more tricky and depends on the database.

---

<div class="post-metadata">

**Author:** ![Kirtash](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@Kirtash](https://discuss.elastic.co/u/Kirtash)\
**Post date:** [April 4, 2023, 12:09pm UTC](https://discuss.elastic.co/t/database-connection/329309/3 "2023-04-04T12:09:45Z")

</div>

We are using the DotNet agent and the database is a sqlServer. I attach a image 🙂  
 ![sql](https://us1.discourse-cdn.com/elastic/original/3X/c/6/c6fe63ac0be70dc4e9e4a6dca63c24d0a6965052.png)

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [April 4, 2023, 2:37pm UTC](https://discuss.elastic.co/t/database-connection/329309/4 "2023-04-04T14:37:36Z")

</div>

After checking the changelogs, this should have been implemented in [Improve db granularity by gregkalapos · Pull Request #1765 · elastic/apm-agent-dotnet · GitHub](https://github.com/elastic/apm-agent-dotnet/pull/1765), which was merged a while ago.

Are you using the latest dotnet apm agent ? And if not could you try to upgrade to see if that makes a difference ?

---

<div class="post-metadata">

**Author:** ![Kirtash](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@Kirtash](https://discuss.elastic.co/u/Kirtash)\
**Post date:** [April 5, 2023, 2:17pm UTC](https://discuss.elastic.co/t/database-connection/329309/5 "2023-04-05T14:17:18Z")

</div>

Thanks @Sylvain_Juge !!

I have updated the packages and now appears the instance in the service map

Best regards!

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [April 5, 2023, 2:33pm UTC](https://discuss.elastic.co/t/database-connection/329309/6 "2023-04-05T14:33:23Z")

</div>

Thanks for your update @Kirtash , I am really happy that solved your issue.

Given the large amount of services that use the same database here, would you mind sharing a screenshot of how that looks like now ? I am wondering if that's still usable with so many arrows.

---

<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 26, 2023, 11:04am UTC](https://discuss.elastic.co/t/database-connection/329309/8 "2023-04-26T11:04:05Z")

</div>

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