# Mongodb traces for netcoreapp3.1 mvc

**URL:** <https://discuss.elastic.co/t/mongodb-traces-for-netcoreapp3-1-mvc/304214>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [May 9, 2022, 7:10am UTC](https://discuss.elastic.co/t/mongodb-traces-for-netcoreapp3-1-mvc/304214 "2022-05-09T07:10:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Namita\_Jaokar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/namita_jaokar/32/104106_2.png) [@Namita\_Jaokar](https://discuss.elastic.co/u/Namita_Jaokar)\
**Post date:** [May 9, 2022, 7:10am UTC](https://discuss.elastic.co/t/mongodb-traces-for-netcoreapp3-1-mvc/304214/1 "2022-05-09T07:10:49Z")

</div>

Hi,

I am trying to configure my netcoreapp3.1 version mvc application which uses mongodb as the database with elastic APM instrumentation with zero code changes .  
I am able to view the transactions but there are no stack traces available for the same. Not able to view the mongodb queries.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/c/dc677981cebbcb3cd3feb5d9ed31ecc5b5c0cac9.png)

I am using package reference AspNetCore.Identity.MongoDbCore as package reference in the application for mongodb.

Are there any specific configurations to capture mongodb queries.

Thanks in advance,  
Namita

---

<div class="post-metadata">

**Author:** ![GregKalapos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gregkalapos/32/37205_2.png) [@GregKalapos](https://discuss.elastic.co/u/GregKalapos)\
**Post date:** [May 11, 2022, 8:19pm UTC](https://discuss.elastic.co/t/mongodb-traces-for-netcoreapp3-1-mvc/304214/2 "2022-05-11T20:19:36Z")

</div>

Hi @Namita_Jaokar

the MongoDB instrumentation needs an additional manual step before it starts capturing calls. [Here is the documentation](https://www.elastic.co/guide/en/apm/agent/dotnet/current/setup-mongo-db.html#setup-mongo-db) which walks you through the steps needed.

---

<div class="post-metadata">

**Author:** ![Namita\_Jaokar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/namita_jaokar/32/104106_2.png) [@Namita\_Jaokar](https://discuss.elastic.co/u/Namita_Jaokar)\
**Post date:** [May 12, 2022, 9:37am UTC](https://discuss.elastic.co/t/mongodb-traces-for-netcoreapp3-1-mvc/304214/3 "2022-05-12T09:37:22Z")

</div>

Hi @GregKalapos ,

The documentation provided requires me to add the configuration for instrumenting mongodb in the code of the application.

Is there any way I can instrument mongodb without changes in the application as I am configuring my application using the zero code changes method of instrumentation with Elastic APM.

Please advise.

Thanks in advance,  
Namita

---

<div class="post-metadata">

**Author:** ![GregKalapos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gregkalapos/32/37205_2.png) [@GregKalapos](https://discuss.elastic.co/u/GregKalapos)\
**Post date:** [May 12, 2022, 9:50am UTC](https://discuss.elastic.co/t/mongodb-traces-for-netcoreapp3-1-mvc/304214/4 "2022-05-12T09:50:37Z")

</div>

Unfortunately that's not supported at this point.

---

<div class="post-metadata">

**Author:** ![Namita\_Jaokar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/namita_jaokar/32/104106_2.png) [@Namita\_Jaokar](https://discuss.elastic.co/u/Namita_Jaokar)\
**Post date:** [May 12, 2022, 9:59am UTC](https://discuss.elastic.co/t/mongodb-traces-for-netcoreapp3-1-mvc/304214/5 "2022-05-12T09:59:44Z")

</div>

Thank you for the update @GregKalapos

Best Regards,  
Namita

---

<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:** [June 2, 2022, 6:00am UTC](https://discuss.elastic.co/t/mongodb-traces-for-netcoreapp3-1-mvc/304214/6 "2022-06-02T06:00:24Z")

</div>

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