<?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: use metric dimension as a value in a timeseries query in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/use-metric-dimension-as-a-value-in-a-timeseries-query/m-p/304452#M3481</link>
    <description>&lt;P&gt;You can derive this from the first time each PostgreSQL version (ver_num) is observed for each instance (ins).&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;timeseries {&lt;BR /&gt;A = avg(pg_meta_info),&lt;BR /&gt;timestamp = start()&lt;BR /&gt;},&lt;BR /&gt;by: { ins, ver_num },&lt;BR /&gt;interval: 1h&lt;BR /&gt;| fieldsAdd first_seen =&lt;BR /&gt;arrayFirst(iCollectArray(if(isNotNull(A[]), timestamp[])))&lt;BR /&gt;| fields ins, ver_num, first_seen&lt;BR /&gt;| sort ins asc, first_seen asc&lt;/P&gt;&lt;P&gt;Since ver_num is a dimension, each PostgreSQL version creates a separate time series. The query finds the first non-null datapoint for each version and returns its timestamp.&lt;/P&gt;&lt;P&gt;first_seen should therefore indicate when Dynatrace first observed that PostgreSQL version.&lt;/P&gt;&lt;P&gt;Just keep in mind that this is the first observation within the selected timeframe, so the timeframe needs to start before the upgrade. The accuracy will also depend on the selected interval/scrape frequency.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Sep 2026 06:09:50 GMT</pubDate>
    <dc:creator>Mohamed_Hamdy</dc:creator>
    <dc:date>2026-09-17T06:09:50Z</dc:date>
    <item>
      <title>use metric dimension as a value in a timeseries query</title>
      <link>https://community.dynatrace.com/t5/DQL/use-metric-dimension-as-a-value-in-a-timeseries-query/m-p/304450#M3480</link>
      <description>&lt;P&gt;I have some metrics coming into Dynatrace from a Prometheus scrape.&lt;BR /&gt;The metric shows up as pg_meta_info and has a static value of 1 but many values setup as dimensions. One of these dimesnsions is version_num which contains an integer representation of the PGSQL engine version.&lt;BR /&gt;&lt;BR /&gt;Is there a way to use the dimension value, which is in the format&amp;nbsp;140023,&amp;nbsp;160014,&amp;nbsp;160015, to show the dates that the postgresql database was upgraded?&lt;BR /&gt;&lt;BR /&gt;I can see the changes of version using the query&lt;BR /&gt;timeseries { avg(pg_meta_info), value.A = avg(pg_meta_info, scalar: true) }, by: { ins, ver_num }&lt;BR /&gt;&lt;SPAN&gt;but that does not show the actual dates the database version changes as the metric value is always 1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2026 23:47:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/use-metric-dimension-as-a-value-in-a-timeseries-query/m-p/304450#M3480</guid>
      <dc:creator>dougwillis</dc:creator>
      <dc:date>2026-09-16T23:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: use metric dimension as a value in a timeseries query</title>
      <link>https://community.dynatrace.com/t5/DQL/use-metric-dimension-as-a-value-in-a-timeseries-query/m-p/304452#M3481</link>
      <description>&lt;P&gt;You can derive this from the first time each PostgreSQL version (ver_num) is observed for each instance (ins).&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;timeseries {&lt;BR /&gt;A = avg(pg_meta_info),&lt;BR /&gt;timestamp = start()&lt;BR /&gt;},&lt;BR /&gt;by: { ins, ver_num },&lt;BR /&gt;interval: 1h&lt;BR /&gt;| fieldsAdd first_seen =&lt;BR /&gt;arrayFirst(iCollectArray(if(isNotNull(A[]), timestamp[])))&lt;BR /&gt;| fields ins, ver_num, first_seen&lt;BR /&gt;| sort ins asc, first_seen asc&lt;/P&gt;&lt;P&gt;Since ver_num is a dimension, each PostgreSQL version creates a separate time series. The query finds the first non-null datapoint for each version and returns its timestamp.&lt;/P&gt;&lt;P&gt;first_seen should therefore indicate when Dynatrace first observed that PostgreSQL version.&lt;/P&gt;&lt;P&gt;Just keep in mind that this is the first observation within the selected timeframe, so the timeframe needs to start before the upgrade. The accuracy will also depend on the selected interval/scrape frequency.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2026 06:09:50 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/use-metric-dimension-as-a-value-in-a-timeseries-query/m-p/304452#M3481</guid>
      <dc:creator>Mohamed_Hamdy</dc:creator>
      <dc:date>2026-09-17T06:09:50Z</dc:date>
    </item>
  </channel>
</rss>

