<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Monitoring state API for process groups (/api/v2/monitoringstate) in Dynatrace API</title>
    <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/295264#M3934</link>
    <description>&lt;P&gt;thank you so much for this.&lt;BR /&gt;&lt;BR /&gt;Is possible filter for state, i needed only the state "restart_required_outdated_agent_injected"&lt;BR /&gt;&lt;BR /&gt;thanks for reply&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Feb 2026 10:32:57 GMT</pubDate>
    <dc:creator>gasperetta</dc:creator>
    <dc:date>2026-02-25T10:32:57Z</dc:date>
    <item>
      <title>Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/209932#M2455</link>
      <description>&lt;P&gt;Dynatrace &lt;A href="https://www.dynatrace.com/support/help/shortlink/changelog-api-sprint-261#ga-availability" target="_self"&gt;1.261 introduced new API /api/v2/monitoringstate&lt;/A&gt;&amp;nbsp; for querying status of monitoring for process group instances. At first sight this looks as a replacement for legacy process group API v1.&lt;BR /&gt;&lt;BR /&gt;It seems this API is not yet in the &lt;A href="https://www.dynatrace.com/support/help/shortlink/api-entities-v2" target="_self"&gt;documentation&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/21613"&gt;@jaroslaw_orlows&lt;/a&gt;&amp;nbsp;can you give a look?&lt;/P&gt;
&lt;P&gt;I'd like to ask folks using the API already how can you use it on a larger scale?&lt;/P&gt;
&lt;P&gt;I ran into two issues severly limiting usage of this API:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;API does not support pagination and the response is limited to 500 entities. How do you use it? Querying entities indivudually is not really an effective way of API usage.&lt;/LI&gt;
&lt;LI&gt;API does not seem to support filtering for monitoring state itself - typically I need to query processes where there an issue (like severity equals warning). There is just the healthState(UNHEALTHY) - which does not reflect the monitoring state.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 12 Jun 2023 08:56:26 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/209932#M2455</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2023-06-12T08:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/214481#M2541</link>
      <description>&lt;P&gt;im right there with you on this&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/3364"&gt;@Julius_Loman&lt;/a&gt;. Have you made any headway with this?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 16:42:57 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/214481#M2541</guid>
      <dc:creator>ChadTurner</dc:creator>
      <dc:date>2023-06-08T16:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/214495#M2542</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/14877"&gt;@ChadTurner&lt;/a&gt;&amp;nbsp;no, there is no progress I'm aware of. In the current state is not useful for us, we are still using the legacy v1 smartscape API for process groups (mostly detecting processes requiring restarts).&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 17:17:38 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/214495#M2542</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2023-06-08T17:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/214499#M2543</link>
      <description>&lt;P&gt;Yeah I tend to fall back on the Legacy methods even when they are "Deprecated" lol&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 17:27:18 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/214499#M2543</guid>
      <dc:creator>ChadTurner</dc:creator>
      <dc:date>2023-06-08T17:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/223192#M2656</link>
      <description>&lt;P&gt;Looks like some of my wishes sometimes make it to the product&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;BR /&gt;In 1.275 there is finally pagination supported as described in &lt;A href="https://www.dynatrace.com/support/help/shortlink/changelog-api-sprint-275" target="_self"&gt;release notes&lt;/A&gt;. Still waiting for filtering on the monitoring states&amp;nbsp;&lt;img class="lia-deferred-image lia-image-emoji" src="https://community.dynatrace.com/html/@6EDF483EF947B43E16DF999BED8ABCC0/images/emoticons/dynaspin.gif" alt=":dynaspin:" title=":dynaspin:" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 09:18:49 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/223192#M2656</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2023-09-18T09:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/243324#M3067</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'd like to get a list of all process groups with status "restart_required". I supposed it should be entitySelector like this for monitoringState API:&amp;nbsp;type("PROCESS_GROUP_INSTANCE"),healthState("HEALTHY"),state("restart_required") but there is response:&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"error": {&lt;BR /&gt;"code": 400,&lt;BR /&gt;"message": "Constraints violated.",&lt;BR /&gt;"constraintViolations": [&lt;BR /&gt;{&lt;BR /&gt;"path": "entitySelector",&lt;BR /&gt;"message": "Scope: state. Cannot deserialize value: \"restart_required\"",&lt;BR /&gt;"parameterLocation": "QUERY",&lt;BR /&gt;"location": null&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;We need such option for filtering to replace depracated API:&amp;nbsp;&lt;SPAN&gt;.../api/v1/entity/infrastructure/processes?restartRequired=true&amp;amp;includeDetails=true. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Michal&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 13:58:26 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/243324#M3067</guid>
      <dc:creator>MichalC</dc:creator>
      <dc:date>2024-04-19T13:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/243358#M3068</link>
      <description>&lt;P&gt;That's what I mentioned above. That API does not allow filtering on the severity or state value. You can only query by entitySelector and then iterate the output, which is far from being effective.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 21:03:35 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/243358#M3068</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2024-04-19T21:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/246852#M3170</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/4189"&gt;@florian_AIgner&lt;/a&gt; or other Dynatraces responsible for this API.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;There are still issues with using this API, please improve it:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;entitySelector does not allow &lt;STRONG&gt;filtering on last seen time&lt;/STRONG&gt;, despite the PGI does have this property. It's not flexible&amp;nbsp; to loop through all process group (even non-deep monitored ones) which are inactive for years. There are no other options to specify the timerange.&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;entitySelector does not allow&lt;STRONG&gt; filtering on severity or injection state&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Response&lt;/STRONG&gt; should be optionally &lt;STRONG&gt;enriched with other related entities and properties&lt;/STRONG&gt; - such as Process group display name, Host ID, Host name, and Management zones name, ...&lt;/LI&gt;&lt;LI&gt;Please &lt;STRONG&gt;add this to the documentation&lt;/STRONG&gt;. This endpoint is not listed in&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/shortlink/api-entities-v2" target="_blank"&gt;https://docs.dynatrace.com/docs/shortlink/api-entities-v2&lt;/A&gt;&amp;nbsp;or anywhere else in the documentation&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 29 May 2024 13:01:52 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/246852#M3170</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2024-05-29T13:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/247444#M3175</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Dynatrace Product Managers please improve this API, we need improvements too.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 12:51:00 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/247444#M3175</guid>
      <dc:creator>MichalC</dc:creator>
      <dc:date>2024-06-05T12:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/251359#M3272</link>
      <description>&lt;P&gt;Agree with Julius, some filtering and response enrichment would be very helpful here.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 14:29:19 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/251359#M3272</guid>
      <dc:creator>kurejko</dc:creator>
      <dc:date>2024-07-23T14:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/252927#M3313</link>
      <description>&lt;P&gt;Please, the situation is so absurd, I don't think it is normal that we must have to do invididual calls over thousands of processes just to obtain a list of what we need to restart...&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 14:17:26 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/252927#M3313</guid>
      <dc:creator>ItamarMM</dc:creator>
      <dc:date>2024-08-08T14:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/257713#M3408</link>
      <description>&lt;P&gt;Using this API we need to iterate through tousands of process instances at present to get a list PODs to restart. It's far from green coding and it's to slow to use it during our deployments. Dynatrace please improve it quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 11:37:16 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/257713#M3408</guid>
      <dc:creator>MichalC</dc:creator>
      <dc:date>2024-10-01T11:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/265125#M3508</link>
      <description>&lt;P&gt;Also interested in using this API effectively...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 15:30:13 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/265125#M3508</guid>
      <dc:creator>HeadScratcher</dc:creator>
      <dc:date>2024-12-12T15:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/279816#M3791</link>
      <description>&lt;P&gt;I'm running into this issue currently across a number of k8s clusters. Is there a way to identify the entities with DQL currently? I'm thinking I could create a workflow to restart the applications.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 13:11:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/279816#M3791</guid>
      <dc:creator>lukegoyer</dc:creator>
      <dc:date>2025-06-19T13:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/279821#M3792</link>
      <description>&lt;P&gt;I run the API via a Notebook-(Dynatrace SaaS) that will pull the PGI STATE for all process or I can change to just the desired PGI's.&amp;nbsp; &amp;nbsp;Import the Notebook, Accept and Run.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;* This function will run in the DYNATRACE JavaScript runtime via a Notebook.&lt;BR /&gt;* For information visit &lt;A href="https://dt-url.net/functions-help" target="_blank" rel="noopener"&gt;https://dt-url.net/functions-help&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jerry_lobenstei_0-1750351006232.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/28574i3EAFB2B2B812DEAD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jerry_lobenstei_0-1750351006232.png" alt="jerry_lobenstei_0-1750351006232.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jun 2025 16:44:14 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/279821#M3792</guid>
      <dc:creator>jerry_lobenstei</dc:creator>
      <dc:date>2025-06-19T16:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/287990#M3860</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN class=""&gt;&lt;A class="" href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/133" target="_self"&gt;&lt;SPAN class=""&gt;jerry_lobenstei&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;Thanks for your notebook and it is very useful.&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;However, I run into a problem of only returning 1000 records regardless of how I increase the&amp;nbsp;maxResultsRecords or other parameters.&lt;BR /&gt;&lt;BR /&gt;Anyone has idea of increasing the records?&lt;BR /&gt;&lt;BR /&gt;Many thanks!&lt;/DIV&gt;&lt;DIV class=""&gt;Wiwin&lt;/DIV&gt;</description>
      <pubDate>Thu, 16 Oct 2025 05:54:50 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/287990#M3860</guid>
      <dc:creator>wiwinleung</dc:creator>
      <dc:date>2025-10-16T05:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/288040#M3861</link>
      <description>&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;STRONG&gt;Default Limit:&lt;/STRONG&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;If no&amp;nbsp;limit&amp;nbsp;command is explicitly specified in a DQL query, Dynatrace applies a default limit of 1,000 records.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;This default limit is automatically appended as the last line of the query.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;STRONG&gt;Explicitly Setting the Limit:&lt;/STRONG&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;You can explicitly define the maximum number of records to be returned by adding&amp;nbsp;| limit &amp;lt;number&amp;gt;&amp;nbsp;to your DQL query.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;For example:&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;fetch logs&lt;BR /&gt;| filter loglevel == "ERROR"&lt;BR /&gt;| limit 5000&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;H3 id="utilize-options-to-limit-the-scanned-amount-of-data"&gt;Utilize options to limit the scanned amount of data&lt;/H3&gt;&lt;P class=""&gt;Particularly when dealing with logs, a large amount of data is ingested in short periods. Even with a narrow query time range, a query can fetch a considerable amount of data.&lt;/P&gt;&lt;P class=""&gt;To stop reading data after a specified amount, use the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;scanLimitGBytes&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" title="A list of DQL commands." href="https://docs.dynatrace.com/docs/discover-dynatrace/platform/grail/dynatrace-query-language/commands" target="_blank" rel="noopener"&gt;fetch command&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;optional parameter.&amp;nbsp; To scan a larger amount of data, also allowing timeframes to be set.&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;fetch&lt;/SPAN&gt;&lt;SPAN class=""&gt; logs, &lt;/SPAN&gt;&lt;SPAN class=""&gt;scanLimitGBytes:&lt;/SPAN&gt;&lt;SPAN class=""&gt;100&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;fetch logs, from:-2h, scanLimitGBytes:100&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 17 Oct 2025 14:35:12 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/288040#M3861</guid>
      <dc:creator>jerry_lobenstei</dc:creator>
      <dc:date>2025-10-17T14:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/291953#M3913</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A class="" href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/133" target="_self"&gt;&lt;SPAN class=""&gt;jerry_lobenstei&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing your approach.&lt;/P&gt;&lt;P&gt;We have a similar use case where we want to set up alerts for all services that were previously active but are now in an inactive state due to some issue and require a pod restart.&lt;/P&gt;&lt;P&gt;I tried implementing this approach and modified the query by adding namespace and management zone filters. I also updated this field:&lt;BR /&gt;const twentyMinutesAgo = new Date(now.getTime() - 72 * 60 * 60 * 1000);&lt;/P&gt;&lt;P&gt;However, I am only seeing 14 records, whereas there should be more in the last 72 hours. Additionally, if I do not use the namespace filter, the data returned is only for a single namespace instead of all namespaces.&lt;/P&gt;&lt;P&gt;Could you please help me figure out what might be causing this issue?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;/*
* This function will run in the DYNATRACE JavaScript runtime.
* For information visit https://dt-url.net/functions-help
*/
import { monitoredEntitiesMonitoringStateClient } from "@dynatrace-sdk/client-classic-environment-v2";
import { queryExecutionClient } from "@dynatrace-sdk/client-query";


//  ****   Dynatrace API   ****
async function fetchAllMonitoringStates(pgID) {
  const pgID_string = `${pgID.map(id =&amp;gt; `"${id}"`).join(",")}`;
  let nextPageKey = null;
  const monitoringStates = [];
  do {
    const params = nextPageKey
      ? { nextPageKey }
      : { entitySelector: `entityId(${pgID_string})`};
    const result = await monitoredEntitiesMonitoringStateClient.getStates(params);
    monitoringStates.push(...result.monitoringStates);
    nextPageKey = result.nextPageKey;
  } while (nextPageKey);
  return monitoringStates
}
export default async function () {
  const now = new Date();
  const twentyMinutesAgo = new Date(now.getTime() - 72 * 60 * 1000);
  const formatDate = (date) =&amp;gt; date.toISOString();
  const $dt_timeframe_from = formatDate(twentyMinutesAgo);
  const $dt_timeframe_to = formatDate(now);

  
//   ****   DQL Query  ****
  const dqlQuery = `
    fetch dt.entity.process_group_instance
    | fieldsAdd host.id=belongs_to[dt.entity.host], pg_id=instance_of[dt.entity.process_group], cgi_id=(belongs_to[dt.entity.container_group_instance])
    | lookup [fetch dt.entity.host], sourceField:host.id, lookupField:id, fields:{host.name=entity.name, host.hostGroupName=hostGroupName}
    | lookup [fetch dt.entity.process_group], sourceField:pg_id, lookupField:id, fields:{process.name=entity.name}
    | lookup [fetch dt.entity.container_group_instance
          | fieldsAdd pod_id=belongs_to[dt.entity.cloud_application_instance], namespace_id=belongs_to[dt.entity.cloud_application_namespace], node_id=belongs_to[dt.entity.host]
          | lookup [fetch dt.entity.cloud_application_instance], sourceField:pod_id, lookupField:id, fields:{pod_name=entity.name}
          | lookup [fetch dt.entity.cloud_application_namespace], sourceField:namespace_id, lookupField:id, fields:{namespace=entity.name}
          | lookup [fetch dt.entity.host], sourceField:node_id, lookupField:id, fields:{node_name=entity.name}], sourceField:cgi_id, lookupField:id, fields:{pod_name, namespace, node_name}
    | fields managementZones, host.id, host.name, host.hostGroupName, process.name, pod_name, namespace, node_name, id
    | sort process.name desc
    | filter namespace == "test-v2"
    | filter host.hostGroupName == "TEST.PROD"
    // | limit 5000
  `;

  
// **** Execution Performance Limits ****
//  const queryExecution = await queryExecutionClient.queryExecute({ body: { query: dqlQuery } });
  const queryExecution = await queryExecutionClient.queryExecute({ body: {
    query: dqlQuery, 
    fetchTimeoutSeconds:5000,
    defalutScanLimitsGbytes: 50,
    maxResultsBytes: 1000000,
    maxResultsRecords: 3000000
} });
  let dqlResults = [];
  while (true) {
    const queryPollResult = await queryExecutionClient.queryPoll({ requestToken: queryExecution.requestToken });
    if (queryPollResult.state !== "RUNNING") {
      dqlResults = queryPollResult.result.records;
      break;
    }
  }
  let pgID = dqlResults.map(item =&amp;gt; item.id);
  const processAllChunks = async () =&amp;gt; {
    const allMonitoringStates = [];
    for (let i = 0; i &amp;lt; pgID.length; i += 50) {
      const chunk = pgID.slice(i, i + 50);
      const chunkStates = await fetchAllMonitoringStates(chunk);
      allMonitoringStates.push(...chunkStates);
    }
    return allMonitoringStates;
  };
  const monitoringStates = await processAllChunks();
  const mergedResults = dqlResults.map(dqlItem =&amp;gt; {
    const match = monitoringStates.find(apiItem =&amp;gt; apiItem.entityId === dqlItem.id);
    return match ? { ...dqlItem, severity: match.severity, state: match.state } : dqlItem;
  });
 const filteredResults = mergedResults.filter(item =&amp;gt; 
  item.state &amp;amp;&amp;amp; item.state.toLowerCase().includes("restart")
);  return filteredResults;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Dec 2025 16:49:53 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/291953#M3913</guid>
      <dc:creator>Kekashri</dc:creator>
      <dc:date>2025-12-19T16:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Monitoring state API for process groups (/api/v2/monitoringstate)</title>
      <link>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/295264#M3934</link>
      <description>&lt;P&gt;thank you so much for this.&lt;BR /&gt;&lt;BR /&gt;Is possible filter for state, i needed only the state "restart_required_outdated_agent_injected"&lt;BR /&gt;&lt;BR /&gt;thanks for reply&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2026 10:32:57 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Dynatrace-API/Monitoring-state-API-for-process-groups-api-v2-monitoringstate/m-p/295264#M3934</guid>
      <dc:creator>gasperetta</dc:creator>
      <dc:date>2026-02-25T10:32:57Z</dc:date>
    </item>
  </channel>
</rss>

