Live: support legacy stream paths (#33101)

This commit is contained in:
Ryan McKinley 2021-04-19 00:47:14 -07:00 committed by GitHub
parent 76034ad1cb
commit 0c64d88d64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,15 @@ export class GrafanaDatasource extends DataSourceApi<GrafanaQuery> {
continue;
}
if (target.queryType === GrafanaQueryType.LiveMeasurements) {
const { channel, filter } = target;
let { channel, filter } = target;
// Help migrate pre-release channel paths saved in dashboards
// NOTE: this should be removed before V8 is released
if (channel && channel.startsWith('telegraf/')) {
channel = 'stream/' + channel;
target.channel = channel; // mutate the current query object so it is saved with `stream/` prefix
}
const addr = parseLiveChannelAddress(channel);
if (!isValidLiveChannelAddress(addr)) {
continue;