github grafana/scenes v0.27.0

latest releases: v7.3.8, v7.3.7, v7.3.6...
2 years ago

Release Notes

Allow time range comparison (#244)

You can now automatically perform queries against a secondary time range to visualize time-over-time comparisons. Use SceneTimeRangeCompare as in the example below:

const queryRunner = new SceneQueryRunner({
  datasource: {
    type: 'prometheus',
    uid: 'gdev-prometheus',
  },
  queries: [
    {
      refId: 'A',
      expr: 'rate(prometheus_http_requests_total{handler=~"/metrics"}[5m])',
    },
  ],
});

const scene = new EmbeddedScene({
  $data: queryRunner,
  $timeRange: new SceneTimeRange({ from: 'now-5m', to: 'now' }),
  controls: [
    new SceneTimePicker({}), 
    new SceneTimeRangeCompare({}) // Use this object to enable time frame comparison UI
  ],
  body: new SceneFlexLayout({
    direction: 'row',
    children: [
      new SceneFlexItem({
        width: '100%',
        height: '100%',
        body: PanelBuilders.timeseries().setTitle('Panel using global time range').build(),
      }),
    ],
  }),
 });

🚀 Enhancement

Authors: 2

Don't miss a new scenes release

NewReleases is sending notifications on new releases.