# Custom Database Queries going to EF 2.0?

**URL:** <https://community.dynatrace.com/t/custom-database-queries-going-to-ef-2-0/40420>\
**Category:** Extensions\
**Tags:** databases, extensions\
**Created:** [June 27, 2023, 9:13pm UTC](https://community.dynatrace.com/t/custom-database-queries-going-to-ef-2-0/40420 "2023-06-27T21:13:15Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![sivart\_89](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sivart\_89](https://community.dynatrace.com/u/sivart_89)\
**Post date:** [June 27, 2023, 9:13pm UTC](https://community.dynatrace.com/t/custom-database-queries-going-to-ef-2-0/40420/1 "2023-06-27T21:13:15Z")

</div>

Does anyone know if this 1.0 extension will be migrated to 2.0? Link to extension below. We’ve noticed that issues related to a table not existing, does not create a problem in Dynatrace but is logged on the AG side. We were going to setup some log monitoring and alerts to notify us of when the query is bad but if this extension will be migrated to EF 2.0 then maybe that can be included in it? I’ve seen that the existing 1.0 extensions will not be updated.

[Custom Database Queries | Dynatrace Hub](https://www.dynatrace.com/hub/detail/custom-database-queries/)

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [June 27, 2023, 11:42pm UTC](https://community.dynatrace.com/t/custom-database-queries-going-to-ef-2-0/40420/2 "2023-06-27T23:42:15Z")

</div>

There is no plan to migrate this extension to extension framework 2.0. Instead the plan is that customers use the declarative database datasource to write yaml files for doing the monitoring.

---

<div class="post-metadata">

**Author:** ![sivart\_89](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sivart\_89](https://community.dynatrace.com/u/sivart_89)\
**Post date:** [June 29, 2023, 11:27am UTC](https://community.dynatrace.com/t/custom-database-queries-going-to-ef-2-0/40420/3 "2023-06-29T11:27:02Z")

</div>

Thank you Mike for the information here.

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [June 29, 2023, 3:56pm UTC](https://community.dynatrace.com/t/custom-database-queries-going-to-ef-2-0/40420/4 "2023-06-29T15:56:04Z")

</div>

Hello [@Mike\_L](https://community.dynatrace.com/user/11520)&nbsp; could you please attach a link to doc about this? I would like to read about it. Thks.

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [June 29, 2023, 4:02pm UTC](https://community.dynatrace.com/t/custom-database-queries-going-to-ef-2-0/40420/5 "2023-06-29T16:02:12Z")

</div>

Sure, here you go. There are actually even more databases supported than listed there, such as DB2 and PostgreSQL:&nbsp;[SQL data source — Dynatrace Docs](https://www.dynatrace.com/support/help/extend-dynatrace/extensions20/data-sources/sql)

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [June 29, 2023, 4:16pm UTC](https://community.dynatrace.com/t/custom-database-queries-going-to-ef-2-0/40420/6 "2023-06-29T16:16:34Z")

</div>

[@DanielS](https://community.dynatrace.com/user/35788)&nbsp;Basically, it is about writing your own extension. The docs are here:

> **[About Extensions](https://docs.dynatrace.com/docs/ingest-from/extensions/concepts)**
>
> Learn how Dynatrace Extensions work, from the Extension Execution Controller and ActiveGate groups to performance profiles, packages, and data sources.

I highly recommend using the Visual Studio Code plugin - Dynatrace&nbsp;VSCode Extension add-on for creating and building extensions:

> **[Dynatrace Extensions - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=DynatracePlatformExtensions.dynatrace-extensions)**
>
> Extension for Visual Studio Code - Support for Dynatrace Extension 2.0 development

There is a very good tutorial for the plugin at&nbsp;[GitHub - dynatrace-extensions/dynatrace-extensions-vscode: A VisualStudio Code extension to support all aspects of developing Dynatrace Extensions 2.0 · GitHub](https://github.com/dynatrace-extensions/dynatrace-extensions-vscode)&nbsp;which will guide you through the process of writing your own extensions and how to use the plugin.

If you are interested in custom SQL queries in particular, I recommend downloading some of the existing extensions such as Postgres or Oracle (a more complex one) and having a look at the yaml file how data is obtained.

---

<div class="post-metadata">

**Author:** ![DanielS](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@DanielS](https://community.dynatrace.com/u/DanielS)\
**Post date:** [June 29, 2023, 4:57pm UTC](https://community.dynatrace.com/t/custom-database-queries-going-to-ef-2-0/40420/7 "2023-06-29T16:57:36Z")

</div>

Thanks [@Mike\_L](https://community.dynatrace.com/user/11520)&nbsp;[@Julius\_Loman](https://community.dynatrace.com/user/3364) I guess that I need to start with extensions. Thanks again.

---

<div class="post-metadata">

**Author:** ![ct\_27](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ct_27/32/10499_2.png) [@ct\_27](https://community.dynatrace.com/u/ct_27)\
**Post date:** [June 30, 2023, 5:34am UTC](https://community.dynatrace.com/t/custom-database-queries-going-to-ef-2-0/40420/8 "2023-06-30T05:34:11Z")

</div>

Thank you for the information but is this really Dynatrace’s general direction?&nbsp; That we have to have developers on staff to keep building these extensions?&nbsp; We bought Dynatrace to simplify our monitoring solutions through a configuration UI, which it had and it was doing.&nbsp; We wanted to leave the world of developing or writing code to monitor entities.

For a long time we were asking for a solution like what Custom Database Queries provides. It started off slow but over the 1 year it improved to be something valuable.&nbsp; My DBAs finally had a UI where they could configure a query for monitoring, gather metrics, and build alerts all on their own; they were thrilled as was I because they could self-serve and got direct benefit out of Dynatrace. They’re actually just about to load over 50 checks into it as part of PoC 2.0 because PoC 1.0 was a success with this extension. Sure it still had room for improvement. Now it sounds like a little over a year later it’s heading to end-of-life with Extension 1.0.

The new Dynatrace approach requires clients to have a developer resource on staff to use the tool vs using out-of-box Dynatrace modules that require just some UI configuration.&nbsp; &nbsp;This is not a model smaller clients can sustain.&nbsp; We have very small staff to support monitoring.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [June 30, 2023, 8:51am UTC](https://community.dynatrace.com/t/custom-database-queries-going-to-ef-2-0/40420/9 "2023-06-30T08:51:47Z")

</div>

I fully understand your concerns. The move reminds me of another monitoring tool I used to work with a decade ago where it was a huge effort (4h minimum) to get value from a script/database/jmx and each change required a similar effort.

With the Extensions 2.0 it’s not that complicated and when you actually set up the environment and get familiar with the concepts and limitations, you can do that very easily. Unfortunately, the learning curve is still somehow steep, but the VScode extensions lowered that pretty significantly to bare minimum.

It’s really not developing in the sense of writing your code, but more or less writing a YAML file exactly as Mike mentions. You really don’t need a developer to write it.

I think there should be a quick tutorial on how to write a simple DB extension to do a query to DB from scratch and how to deploy and maintain it.

---

<div class="post-metadata">

**Author:** ![dglugla](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dglugla/32/14492_2.png) [@dglugla](https://community.dynatrace.com/u/dglugla)\
**Post date:** [July 3, 2023, 10:23am UTC](https://community.dynatrace.com/t/custom-database-queries-going-to-ef-2-0/40420/10 "2023-07-03T10:23:08Z")

</div>

We get your point&nbsp;[@ct\_27](https://community.dynatrace.com/user/38037)&nbsp;and we are aware of the limitations that the new Extension Framework brings.

But at the same time it brings a lot of additional value, either not possible before, or not that convenient to use. We improved activation of the extensions, making it possible to chose an AG group, host groups or management zones. We introduced a custom entity model to shape the topology just as you need. The custom queries are no longer as restricted and can gather multiple metrics at once, where you can specify their processing rules. Finally the security aspects got improved as well, which was mandatory to meet enterprise standards of our customers. For that, we needed to separate the personas and their use cases: extension developer and admin. That’s also why we do not plan to allow for queries customization during the extension’s activation process.

Unfortunately that complicated the basic use cases, like the simple business data extraction. With the VSCode add-on we’re making our best to simplify the extension creation process, and we’re open for suggestions to make it even more convenient. That allows us to offer a unified approach to extending Dynatrace capabilities in terms of data collection and processing.

Please review your custom DB queries and you’ll probably find some areas to improve, where the new Extension Framework capabilities can be leveraged. E.g.optimizing queries’ performance by combining some of them into one. Or think of a data structure that you collect - maybe you’ll find a candidate to use custom topology. Or the ability to track the changes in extension’s configuration… I believe there are plenty of examples where the new framework comes in handy; just give it a chance. And whenever you find an area to improve - please let us know and we’ll work together to make it possible.

---

<div class="post-metadata">

**Author:** ![TahirJanwari](https://avatars.discourse-cdn.com/v4/letter/t/a87d85/32.png) [@TahirJanwari](https://community.dynatrace.com/u/TahirJanwari)\
**Post date:** [June 27, 2024, 11:52am UTC](https://community.dynatrace.com/t/custom-database-queries-going-to-ef-2-0/40420/11 "2024-06-27T11:52:33Z")

</div>

Hello Julius, How/from where can i download this yaml file??

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [June 27, 2024, 12:08pm UTC](https://community.dynatrace.com/t/custom-database-queries-going-to-ef-2-0/40420/12 "2024-06-27T12:08:13Z")

</div>

If you go to the hub, you can grab any extension from the “release notes” tab. For example:&nbsp;[https://www.dynatrace.com/hub/detail/postgresdb-remote-monitoring/?query=postgresql&filter=all#release-notes](https://www.dynatrace.com/hub/detail/postgresdb-remote-monitoring/?query=postgresql&filter=all#release-notes)
