# Do we have to use entity framework to monitor SQL on the C# agent

**URL:** <https://discuss.elastic.co/t/do-we-have-to-use-entity-framework-to-monitor-sql-on-the-c-agent/204958>\
**Category:** APM\
**Created:** [October 23, 2019, 8:38pm UTC](https://discuss.elastic.co/t/do-we-have-to-use-entity-framework-to-monitor-sql-on-the-c-agent/204958 "2019-10-23T20:38:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LordMathis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lordmathis/32/55044_2.png) [@LordMathis](https://discuss.elastic.co/u/LordMathis)\
**Post date:** [October 23, 2019, 8:38pm UTC](https://discuss.elastic.co/t/do-we-have-to-use-entity-framework-to-monitor-sql-on-the-c-agent/204958/1 "2019-10-23T20:38:15Z")

</div>

Kibana version: 7.3

Elasticsearch version: 7.3

APM Server version: 7.3

APM Agent language and version: C#

The C# agent uses entity framework to monitor sql connections. All of our applications are currently using the SqlConnection object from .net. Is there parody between the C# agent and this object or do we need to use entity framework to monitor sql connections.

---

<div class="post-metadata">

**Author:** ![Sergey\_Kleyman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergey_kleyman/32/39333_2.png) [@Sergey\_Kleyman](https://discuss.elastic.co/u/Sergey_Kleyman)\
**Post date:** [October 24, 2019, 5:45am UTC](https://discuss.elastic.co/t/do-we-have-to-use-entity-framework-to-monitor-sql-on-the-c-agent/204958/2 "2019-10-24T05:45:36Z")

</div>

Hi @LordMathis,

At the moment Elastic APM .NET agent doesn't automatically create spans for DB operations using [ADO.NET](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/ado-net-overview) (which is what I assume you mean by "using the SqlConnection"). We do have an [issue](https://github.com/elastic/apm-agent-dotnet/issues/114) for [ADO.NET](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/ado-net-overview) support in our backlog but there's no planned milestone for it. We do welcome community PRs if you would like to have a stab at it.

BTW which .NET runtime do you use - .NET Framework or .NET Core? The reason I'm asking is because as you can see at [the issue I've linked above](https://github.com/elastic/apm-agent-dotnet/issues/114), an investigation by one of our community members concluded that it might be easier to add support for [ADO.NET](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/ado-net-overview) on .NET Core than on .NET Framework.

Another solution you can try in meantime is to use [agent's public API](https://www.elastic.co/guide/en/apm/agent/dotnet/current/public-api.html) to create spans for your application's DB operations.

---

<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:** [November 14, 2019, 1:45am UTC](https://discuss.elastic.co/t/do-we-have-to-use-entity-framework-to-monitor-sql-on-the-c-agent/204958/3 "2019-11-14T01:45:41Z")

</div>

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