# Querying PurePath Code Level Data

**URL:** <https://community.dynatrace.com/t/querying-purepath-code-level-data/31318>\
**Category:** Open Q&A\
**Tags:** distributed-traces-classic, services-classic, oneagent, profiling-and-optimization\
**Created:** [April 30, 2021, 10:42am UTC](https://community.dynatrace.com/t/querying-purepath-code-level-data/31318 "2021-04-30T10:42:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![serhat\_balik](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@serhat\_balik](https://community.dynatrace.com/u/serhat_balik)\
**Post date:** [April 30, 2021, 10:42am UTC](https://community.dynatrace.com/t/querying-purepath-code-level-data/31318/1 "2021-04-30T10:42:33Z")

</div>

After installing MSSQL extension we’ve discovered that, some requests coming from IIS are opening multiple connections, but not closing. We’ve confirmed this after seeing multiple “sleeping” processes that keeps piling up in the DB.

We’re trying to find out all the requests that opens more than 10 connections, such as shown in the screenshot.

I tried doing this from Diagnostic tools, but could not find anything helpful. Do we have any functionality to accomplish this? Maybe even via API?

 ![2021-04-30 13_37_02-Inbox - Serhat.Balik@asseco-see.com.tr - Outlook.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/a/1a0ff6f1dbf152cd3d3a2277dea33925468b76fb.png)  
 ![2021-04-30 13_37_02-Querying PurePath Code Level Data.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/a/9ab9911f88b05c2a03e8830fa073e68a06cfa6b3.png)

---

<div class="post-metadata">

**Author:** ![The\_AM](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@The\_AM](https://community.dynatrace.com/u/The_AM)\
**Post date:** [May 4, 2021, 12:26am UTC](https://community.dynatrace.com/t/querying-purepath-code-level-data/31318/2 "2021-05-04T00:26:10Z")

</div>

Hi Serhat,

You may want to review this section of Dynatrace Help on some use cases of **request attributes:**

[https://www.dynatrace.com/support/help/shortlink/request-attributes#how-to-make-use-of-request-attributes](https://www.dynatrace.com/support/help/shortlink/request-attributes#how-to-make-use-of-request-attributes)

I’d say you’d want to create a [request attribute](https://www.dynatrace.com/support/help/shortlink/request-attributes-filtering) that counts the number of occurrences of that method. Then, you could use that as the basis for a [custom error](https://www.dynatrace.com/support/help/shortlink/service-error-detection#detection-of-business-logic-related-errors-using-request-attributes). You could also create a [calculated service metric](https://www.dynatrace.com/support/help/shortlink/multidimensional-analysis#calculated-service-metric) and [access those results via the REST API.](https://www.dynatrace.com/support/help/shortlink/api-config-calculated-metrics)

---

<div class="post-metadata">

**Author:** ![serhat\_balik](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@serhat\_balik](https://community.dynatrace.com/u/serhat_balik)\
**Post date:** [May 4, 2021, 8:52am UTC](https://community.dynatrace.com/t/querying-purepath-code-level-data/31318/3 "2021-05-04T08:52:48Z")

</div>

Well, that’s actually a good idea. I tried going with it for both Custom Attributes and Custom Service, the problem is that, the method is not instrumentable due to safety reasons. Can we override it?

 ![2021-05-04 11_48_17-Custom Service detection - ALET - Dynatrace.png](https://global.discourse-cdn.com/dynatrace/original/2X/4/4ec1db62f1d68552ae14600db90fde4c9f88582b.png)

---

<div class="post-metadata">

**Author:** ![The\_AM](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@The\_AM](https://community.dynatrace.com/u/The_AM)\
**Post date:** [May 5, 2021, 12:14am UTC](https://community.dynatrace.com/t/querying-purepath-code-level-data/31318/4 "2021-05-05T00:14:16Z")

</div>

That’s probably because Dynatrace reserves that method for capturing database insights and statement details.

Is it possible to wrap the method in another in your code that could then be counted? I know it’s not ideal, but I couldn’t really see another way, except maybe creating a custom service.

---

<div class="post-metadata">

**Author:** ![serhat\_balik](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@serhat\_balik](https://community.dynatrace.com/u/serhat_balik)\
**Post date:** [May 5, 2021, 7:22am UTC](https://community.dynatrace.com/t/querying-purepath-code-level-data/31318/5 "2021-05-05T07:22:01Z")

</div>

We’ve also spoken to Dynatrace sales engineer at the parallel to clarify the situation. He mentioned that, in AppMon lots of customers tried using Open() as entry point and broke their systems, so this was some kind of counter measure.

He gave us some alternative solution instead of what we’re trying to do. Maybe we can find the problematic requests from the DB side.

> **[Find Database Connection Leaks in Your Application - SQLPerformance.com](https://sqlperformance.com/2017/07/sql-performance/find-database-connection-leaks)**
>
> Michael Swart (@MJSwart) shows how to investigate and fix database connection leaks, an application issue that can lead to connection timeouts.

I’ve also find out that IIS has an API. I can do some queries about app pools and worker processes, then push the relevant numbers as a metric. I’ve notified the developers, we’ll see how they prefer to proceed.

> **[The Application Pool Resource](https://learn.microsoft.com/en-us/iis-administration/api/application-pools)**
>
> Application pools provide an isolation mechanism for processes on the web server.
