# Generic Database Query in EF2: when?

**URL:** <https://community.dynatrace.com/t/generic-database-query-in-ef2-when/45841>\
**Category:** Extensions\
**Tags:** databases, extensions\
**Created:** [May 30, 2024, 8:32pm UTC](https://community.dynatrace.com/t/generic-database-query-in-ef2-when/45841 "2024-05-30T20:32:11Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [May 30, 2024, 8:32pm UTC](https://community.dynatrace.com/t/generic-database-query-in-ef2-when/45841/1 "2024-05-30T20:32:11Z")

</div>

The “Generic DB Query Plugin” is one of the most used extensions by our customers. When is the ETA for the migration to EF2?

---

<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:** [May 30, 2024, 8:43pm UTC](https://community.dynatrace.com/t/generic-database-query-in-ef2-when/45841/2 "2024-05-30T20:43:08Z")

</div>

Hi,  
Most use cases can already be handled in EF2 through the declarative SQL data sources.

Two missing features are cron scheduling and custom connection strings. Both of which is being worked on.

Our services department is also busy with an app to provide a UI experience for the different data sources for customers who don’t want to write YAML. SQL support is the first one planned.

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [May 31, 2024, 9:08am UTC](https://community.dynatrace.com/t/generic-database-query-in-ef2-when/45841/3 "2024-05-31T09:08:23Z")

</div>

[@Mike\_L](https://community.dynatrace.com/user/11520),

While an app is OK, please don’t forget that this extension is widely used in Managed environments.

It’s also very important that the new extension use the same metrics, so clients don’t loose the timeseries that they already have.

---

<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:** [May 31, 2024, 12:21pm UTC](https://community.dynatrace.com/t/generic-database-query-in-ef2-when/45841/4 "2024-05-31T12:21:23Z")

</div>

There is no new extension planned. You can call the metrics whatever you want in the yaml, including custom.db.query just like the existing one does

The app is just to help people with creating the YAML. It will not unlock new possibilities other than that.

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [May 31, 2024, 12:43pm UTC](https://community.dynatrace.com/t/generic-database-query-in-ef2-when/45841/5 "2024-05-31T12:43:32Z")

</div>

[@Mike\_L](https://community.dynatrace.com/user/11520),

If I understand correctly, Dynatrace will not be migrating the Generic DB Query to EF2???

---

<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:** [May 31, 2024, 12:48pm UTC](https://community.dynatrace.com/t/generic-database-query-in-ef2-when/45841/6 "2024-05-31T12:48:42Z")

</div>

Correct. The EF2 method is to use the SQL data source to query databases. As these extensions then are signed together with the query it is a lot more secure.

As our services team saw the need to make it even easier than writing a YAML, we are creating the app to have a UI for creating, modifying and signing YAMLs.

Managed customers are directed towards the vscode addon to simplify the creation of the YAML.

---

<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:** [May 31, 2024, 1:32pm UTC](https://community.dynatrace.com/t/generic-database-query-in-ef2-when/45841/7 "2024-05-31T13:32:06Z")

</div>

Writing your own SQL queries using extensions is easier than it sounds. I also agree with Mike that just&nbsp;cron scheduling (e.g. run this query exactly on every hour aligned) and your own custom JDBC string are missing. It is possible to define the interval as of today, it’s just not configurable in the extension config/ui.

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [May 31, 2024, 1:37pm UTC](https://community.dynatrace.com/t/generic-database-query-in-ef2-when/45841/8 "2024-05-31T13:37:32Z")

</div>

[@Mike\_L](https://community.dynatrace.com/user/11520),

I’m without words, again!

First of all, Dynatrace stated this in November:

> **[Unmatched scalability and security of Dynatrace extensions now available for...](https://www.dynatrace.com/news/blog/unmatched-scalability-and-security-of-dynatrace-extensions-now-available-for-all-supported-technologies-7-reasons-to-migrate-your-jmx-and-python-plugins/)**
>
> Dynatrace provides tooling and documentation to help you migrate to the Extension Framework 2.0, but you need to take action!

 ![AntonioSousa_0-1717161786702.png](https://global.discourse-cdn.com/dynatrace/original/2X/e/e6d4a5312360dc05ddd2db78a7fc0472dc0fe4d7.png)

So, now we know that this is not true!

More, I’m pretty sure multiple clients we have and that use it are going to be quite unhappy! Having to write the yaml, is 1 or 2 orders of magnitude difficultier than it is today. And changing one query, we have to do it all over again??? Someone hasn’t really thought how clients use Dynatrace, or at least, should be using it…

---

<div class="post-metadata">

**Author:** ![jose\_araya](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jose\_araya](https://community.dynatrace.com/u/jose_araya)\
**Post date:** [May 31, 2024, 8:21pm UTC](https://community.dynatrace.com/t/generic-database-query-in-ef2-when/45841/9 "2024-05-31T20:21:14Z")

</div>

Hello Antonio, I completely agree with your opinion here.

Most clients would find it extremely cumbersome to have to define everything inside the YAML.

We have this concern as well…

---

<div class="post-metadata">

**Author:** ![YeudyGomez](https://avatars.discourse-cdn.com/v4/letter/y/9d8465/32.png) [@YeudyGomez](https://community.dynatrace.com/u/YeudyGomez)\
**Post date:** [May 31, 2024, 8:21pm UTC](https://community.dynatrace.com/t/generic-database-query-in-ef2-when/45841/10 "2024-05-31T20:21:28Z")

</div>

Great comment&nbsp;[@AntonioSousa](https://community.dynatrace.com/user/17213)&nbsp;:ok\_hand:

---

<div class="post-metadata">

**Author:** ![bryan\_araya](https://avatars.discourse-cdn.com/v4/letter/b/9e8a1a/32.png) [@bryan\_araya](https://community.dynatrace.com/u/bryan_araya)\
**Post date:** [May 31, 2024, 8:24pm UTC](https://community.dynatrace.com/t/generic-database-query-in-ef2-when/45841/11 "2024-05-31T20:24:32Z")

</div>

Hello Antonio

All you just said is exactly the concerns we have with this new SLQ framework.

---

<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 2, 2024, 8:22pm UTC](https://community.dynatrace.com/t/generic-database-query-in-ef2-when/45841/12 "2024-06-02T20:22:46Z")

</div>

There was an extensive answer by Darek from product management on this topic a year ago here:

[https://community.dynatrace.com/t5/Extensions/Custom-Database-Queries-going-to-EF-2-0/m-p/216561](https://community.dynatrace.com/post/216561)

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [June 2, 2024, 8:37pm UTC](https://community.dynatrace.com/t/generic-database-query-in-ef2-when/45841/13 "2024-06-02T20:37:56Z")

</div>

[@Mike\_L](https://community.dynatrace.com/user/11520),

I remember this thread. At that time we were unaware that EF1 would be terminated. So, I was good with it. Now, it seems more and more clear to me that we have to have a plan B for EF1 termination!

I second what [@ct\_27](https://community.dynatrace.com/user/38037)&nbsp; said at the time.

And regarding what Darek said, none of it will convince the several clients I have that use the extension…

---

<div class="post-metadata">

**Author:** ![derija](https://avatars.discourse-cdn.com/v4/letter/d/a87d85/32.png) [@derija](https://community.dynatrace.com/u/derija)\
**Post date:** [October 16, 2024, 11:51pm UTC](https://community.dynatrace.com/t/generic-database-query-in-ef2-when/45841/14 "2024-10-16T23:51:42Z")

</div>

I also am struggling with having to migrate from 1.0 to a 2.0 solution. The previous plugin had a sql query length limit that we overcame with stored procedure call. Now I have to get the sql out make an application for each custom query and figure out where to store the retrieved values in DT. BTW how does one reference where to put the values from DB. Dimensions??

example is my apps src extension.yml

- group: foo-appointments  
query: \>-  
select count(\*) As Number\_Of\_Appointments

from AppSch\_Appointment

where CONVERT (Date, created\_date) = CONVERT (Date, GETDATE()) and  
DATEPART (HOUR, created\_date) = DATEPART(HOUR, (DATEADD(HOUR,-1,  
GETDATE())))

group by cast(created\_date as date) , datename(dw, created\_date)  
metrics:  
- key: foo-appointments.number-of-appointments  
value: col:Number\_Of\_Appointments  
dimensions: []. \<--here what does that look like as far as string..
