<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: liang finley</title>
    <description>The latest articles on DEV Community by liang finley (@liang_finley_1abaa5683729).</description>
    <link>https://dev.to/liang_finley_1abaa5683729</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3932772%2F40b687f9-67fc-4623-b359-9738d25f3c3f.png</url>
      <title>DEV Community: liang finley</title>
      <link>https://dev.to/liang_finley_1abaa5683729</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/liang_finley_1abaa5683729"/>
    <language>en</language>
    <item>
      <title>How to make Time-Shifed Compare Metrics in Grafana Across Datasources</title>
      <dc:creator>liang finley</dc:creator>
      <pubDate>Fri, 15 May 2026 08:59:45 +0000</pubDate>
      <link>https://dev.to/liang_finley_1abaa5683729/how-to-make-time-shifed-compare-metrics-in-grafana-across-datasources-3d8n</link>
      <guid>https://dev.to/liang_finley_1abaa5683729/how-to-make-time-shifed-compare-metrics-in-grafana-across-datasources-3d8n</guid>
      <description>&lt;h1&gt;
  
  
  How to Compare Today vs Yesterday Metrics in Grafana Across Datasources
&lt;/h1&gt;

&lt;p&gt;When building Grafana dashboards, one common question comes up again and again:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How does this metric compare with yesterday, last week, or before the last release?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I built &lt;strong&gt;CompareQueries&lt;/strong&gt;, a Grafana datasource plugin for comparing time-shifted queries across datasources in one panel.&lt;/p&gt;

&lt;p&gt;It is useful for workflows like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;today vs yesterday/last week/custom dates dashboard comparison metrics&lt;/li&gt;
&lt;li&gt;time-shifted time-series dashboards before vs after&lt;/li&gt;
&lt;li&gt;day-over-day or week-over-week business metrics&lt;/li&gt;
&lt;li&gt;shifted comparison queries in Grafana Alerting&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What It Does
&lt;/h2&gt;

&lt;p&gt;CompareQueries lets you run the same query with different time shifts and display the results together in one Grafana panel.&lt;/p&gt;

&lt;p&gt;It works with Prometheus, Loki, Elasticsearch, SQL, and other Grafana datasources through their native query editors.&lt;/p&gt;

&lt;p&gt;For new dashboards, the recommended flow is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a panel with &lt;code&gt;-- Mixed --&lt;/code&gt; as the panel datasource.&lt;/li&gt;
&lt;li&gt;Add a query row with &lt;code&gt;CompareQueries&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Pick the target datasource inside CompareQueries.&lt;/li&gt;
&lt;li&gt;Build the query with the datasource’s native query editor.&lt;/li&gt;
&lt;li&gt;Add time shifts such as &lt;code&gt;1d&lt;/code&gt;, &lt;code&gt;1w&lt;/code&gt;, or &lt;code&gt;30m&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Grafana 13+ and Alerting Support
&lt;/h2&gt;

&lt;p&gt;CompareQueries supports Grafana 11, 12, and 13+.&lt;/p&gt;

&lt;p&gt;For Grafana 13+ and new dashboards, it uses the Target Datasource flow because legacy RefId-style query references are no longer supported in Grafana 13+.&lt;/p&gt;

&lt;p&gt;It also supports Grafana Alerting through backend query execution, so shifted comparison queries can be used in alert rules as well as dashboards.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5pn56n3cols8tq8nzcr8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5pn56n3cols8tq8nzcr8.png" alt=" " width="800" height="716"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/leoswing/comparequeries-datasource-rc" rel="noopener noreferrer"&gt;https://github.com/leoswing/comparequeries-datasource-rc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feedback, dashboard examples, feature requests, and bug reports are welcome.&lt;/p&gt;

&lt;p&gt;If CompareQueries helps with your Grafana dashboards or alerting workflows, please consider giving the GitHub repo a star so more users can discover it.&lt;/p&gt;

</description>
      <category>grafana</category>
      <category>timeshift</category>
      <category>datasource</category>
      <category>observability</category>
    </item>
  </channel>
</rss>
