<?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: How to query for spans that has an exception event? in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/How-to-query-for-spans-that-has-an-exception-event/m-p/255808#M1217</link>
    <description>&lt;P&gt;Ah I found the answer myself. Do something like below.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch spans
| filter 
  like( lower(db.query.text), "%update%") and
  iAny(span.events[][span_event.name] == "exception") and
  iAny(like(span.events[][exception.type], "%BatchUpdateException")) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2024 07:48:37 GMT</pubDate>
    <dc:creator>bren</dc:creator>
    <dc:date>2024-09-16T07:48:37Z</dc:date>
    <item>
      <title>How to query for spans that has an exception event?</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-query-for-spans-that-has-an-exception-event/m-p/255799#M1216</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;When I do a simple DQL query on the spans, I can see some spans have exceptions like below. The exceptions are wrapped as records in an array under "span.events" field.&lt;/P&gt;&lt;P&gt;How do I write a DQL query to pick out spans with certain exceptions, for example "java.sql.BatchUpdateException"?&lt;BR /&gt;It looks like I should use "iAny". However the example from&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/operators#iAny" target="_blank"&gt;https://docs.dynatrace.com/docs/platform/grail/dynatrace-query-language/operators#iAny&lt;/A&gt;&amp;nbsp;is only for simple type, not records.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    {
      "trace.id": "674367267460f48738534bff81e3718f",
      "span.id": "f0a1bfa933cad913",
      "start_time": "2024-09-16T09:13:09.991600000+10:00",
      "end_time": "2024-09-16T09:13:59.999816000+10:00",
      "span.parent_id": "f68ff88792574c09",
      "duration": "50008216000",
      ... ...
      "span.events": [
        {
          "span_event.name": "exception",
          "exception.message": "Lock wait timeout exceeded; try restarting transaction",
          "exception.type": "java.sql.BatchUpdateException",
          "exception.id": "9d6064b5304e83f1",
          "exception.escaped": true,
          "exception.is_caused_by_root": true,
          "exception.file.full": "SQLError.java",
          "exception.line_number": "223",
          "exception.stack_trace": "... ..."
          "exception.caused_by_id": "50fe50882eeef674"
        },
        {
          "span_event.name": "exception",
          "exception.message": "Lock wait timeout exceeded; try restarting transaction",
          "exception.type": "com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException",
          "exception.id": "50fe50882eeef674",
          "exception.escaped": false,
          "exception.is_caused_by_root": false,
          "exception.file.full": "SQLError.java",
          "exception.line_number": "124",
          "exception.stack_trace": "... ..."
        }
      ],
      "dt.retain.size": "22598"
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 06:59:57 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-query-for-spans-that-has-an-exception-event/m-p/255799#M1216</guid>
      <dc:creator>bren</dc:creator>
      <dc:date>2024-09-16T06:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to query for spans that has an exception event?</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-query-for-spans-that-has-an-exception-event/m-p/255808#M1217</link>
      <description>&lt;P&gt;Ah I found the answer myself. Do something like below.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;fetch spans
| filter 
  like( lower(db.query.text), "%update%") and
  iAny(span.events[][span_event.name] == "exception") and
  iAny(like(span.events[][exception.type], "%BatchUpdateException")) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 07:48:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-query-for-spans-that-has-an-exception-event/m-p/255808#M1217</guid>
      <dc:creator>bren</dc:creator>
      <dc:date>2024-09-16T07:48:37Z</dc:date>
    </item>
  </channel>
</rss>

