<?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 How to join two timeseries in a single DQL to map/alias an GUID to Readable Name in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/How-to-join-two-timeseries-in-a-single-DQL-to-map-alias-an-GUID/m-p/283732#M2440</link>
    <description>&lt;P&gt;I have created a dashboard to monitor multiple MuleSoft API metrics ( Response Time, Endpoint Usage, Request Count). Each tile contains respective DQL query that includes the dimension `request_attribute.Client-Id` in GUID format.&lt;/P&gt;&lt;P&gt;For example, when a&amp;nbsp; API request occurs, Dynatrace automatically captures the API name, endpoint, and also records the Client ID in `request_attribute.Client-Id`. For dashboard filtering and data splitting, we require three key details: API name, endpoint, and client ID (The API request header does not have Client Name, so we capture ID in request attribute).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries {
value = sum(service.muleapi.response.count)
},
by: {dt.entity.service, endpoint.name, `request_attribute.Client-Id`},&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Separately, I have a custom metric (`custom.api.metric`) ingested via the Dynatrace API, which contains the mapping of `clientid` (GUID) to `clientname` (two columns).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries testmetric = sum(custom.api.metric), by: { clientid, clientname }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Within a single DQL query for a tile, I want to:&lt;/P&gt;&lt;P&gt;1. Fetch the main metric (e.g., API Response Time) as a timeseries.&lt;BR /&gt;2. Fetch the `custom.testmetric` as a timeseries.&lt;BR /&gt;3. Match `request_attribute.Client-Id` from the main metric with `clientid` from `custom.api.metric`.&lt;BR /&gt;4. Dynamically alias or replace the GUID with the corresponding `clientname`.&lt;/P&gt;&lt;P&gt;Is there a way to join these two timeseries results within a single query, so I can achieve this aliasing/mapping without hardcoding as a lookup data record[] table?&lt;/P&gt;</description>
    <pubDate>Wed, 13 Aug 2025 12:29:51 GMT</pubDate>
    <dc:creator>Raul_rrr</dc:creator>
    <dc:date>2025-08-13T12:29:51Z</dc:date>
    <item>
      <title>How to join two timeseries in a single DQL to map/alias an GUID to Readable Name</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-join-two-timeseries-in-a-single-DQL-to-map-alias-an-GUID/m-p/283732#M2440</link>
      <description>&lt;P&gt;I have created a dashboard to monitor multiple MuleSoft API metrics ( Response Time, Endpoint Usage, Request Count). Each tile contains respective DQL query that includes the dimension `request_attribute.Client-Id` in GUID format.&lt;/P&gt;&lt;P&gt;For example, when a&amp;nbsp; API request occurs, Dynatrace automatically captures the API name, endpoint, and also records the Client ID in `request_attribute.Client-Id`. For dashboard filtering and data splitting, we require three key details: API name, endpoint, and client ID (The API request header does not have Client Name, so we capture ID in request attribute).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries {
value = sum(service.muleapi.response.count)
},
by: {dt.entity.service, endpoint.name, `request_attribute.Client-Id`},&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Separately, I have a custom metric (`custom.api.metric`) ingested via the Dynatrace API, which contains the mapping of `clientid` (GUID) to `clientname` (two columns).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries testmetric = sum(custom.api.metric), by: { clientid, clientname }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Within a single DQL query for a tile, I want to:&lt;/P&gt;&lt;P&gt;1. Fetch the main metric (e.g., API Response Time) as a timeseries.&lt;BR /&gt;2. Fetch the `custom.testmetric` as a timeseries.&lt;BR /&gt;3. Match `request_attribute.Client-Id` from the main metric with `clientid` from `custom.api.metric`.&lt;BR /&gt;4. Dynamically alias or replace the GUID with the corresponding `clientname`.&lt;/P&gt;&lt;P&gt;Is there a way to join these two timeseries results within a single query, so I can achieve this aliasing/mapping without hardcoding as a lookup data record[] table?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2025 12:29:51 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-join-two-timeseries-in-a-single-DQL-to-map-alias-an-GUID/m-p/283732#M2440</guid>
      <dc:creator>Raul_rrr</dc:creator>
      <dc:date>2025-08-13T12:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two timeseries in a single DQL to map/alias an GUID to Readable Name</title>
      <link>https://community.dynatrace.com/t5/DQL/How-to-join-two-timeseries-in-a-single-DQL-to-map-alias-an-GUID/m-p/283743#M2443</link>
      <description>&lt;P&gt;This is how to combine results of these 2 queries (from 2nd I take only clientname):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;timeseries { value = sum(service.muleapi.response.count)},
by: {dt.entity.service, endpoint.name, `request_attribute.Client-Id`}
| lookup [
  timeseries testmetric = sum(custom.api.metric), by: { clientid, clientname }
], sourceField:`request_attribute.Client-Id`, lookupField:clientid, fields:{clientname}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just 2 additional comment from my side:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I hope that there is limited set of client IDs. Grail is quite capable, but everything has limits and crossing them may have some consequences (e.g. too much data points may result in inability of long term analysis). You can check details here:&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/analyze-explore-automate/metrics/limits" target="_blank"&gt;https://docs.dynatrace.com/docs/analyze-explore-automate/metrics/limits&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Query will provide aliases/mapping as long as in timeframe of the inner query mapping was provided. As metrics are not kept forever you probably will need to re-ingest mappings regularly. There is new functionality released recently to keep such mappings, which may be more optimal for this use-case:&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/discover-dynatrace/platform/grail/lookup-data" target="_blank"&gt;https://docs.dynatrace.com/docs/discover-dynatrace/platform/grail/lookup-data&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 13 Aug 2025 13:52:31 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-to-join-two-timeseries-in-a-single-DQL-to-map-alias-an-GUID/m-p/283743#M2443</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2025-08-13T13:52:31Z</dc:date>
    </item>
  </channel>
</rss>

