Compare commits

...

3 Commits

Author SHA1 Message Date
joshhunt 978c989f3e Dashboards: Lazy-load scripted dashboards dependencies 2026-01-06 11:34:29 +00:00
Peter Nguyen 217427e072 Loki Language Provider: Add missing interpolation to fetchLabelsByLabelsEndpoint (#114608)
* Plugins: Implement bug fix for loki label selectors w/ variable interpolation

* Chore: Add test to ensure result is interpolated

---------

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2026-01-06 10:29:51 +00:00
grafana-pr-automation[bot] 585d24dafa I18n: Download translations from Crowdin (#115860)
New Crowdin translations by GitHub Action

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-06 10:01:38 +00:00
21 changed files with 284 additions and 9 deletions
@@ -1,13 +1,10 @@
import $ from 'jquery';
import _, { isFunction } from 'lodash'; // eslint-disable-line lodash/import-scope
import moment from 'moment'; // eslint-disable-line no-restricted-imports
import { isFunction } from 'lodash'; // eslint-disable-line lodash/import-scope
import { AppEvents, dateMath, UrlQueryMap, UrlQueryValue } from '@grafana/data';
import { getBackendSrv, isFetchError, locationService } from '@grafana/runtime';
import { Spec as DashboardV2Spec } from '@grafana/schema/dist/esm/schema/dashboard/v2';
import { backendSrv } from 'app/core/services/backend_srv';
import impressionSrv from 'app/core/services/impression_srv';
import kbn from 'app/core/utils/kbn';
import { getDashboardScenePageStateManager } from 'app/features/dashboard-scene/pages/DashboardScenePageStateManager';
import { getDatasourceSrv } from 'app/features/plugins/datasource_srv';
import { DashboardDTO } from 'app/types/dashboard';
@@ -68,7 +65,15 @@ abstract class DashboardLoaderSrvBase<T> implements DashboardLoaderSrvLike<T> {
);
}
private executeScript(result: any) {
private async executeScript(result: any) {
// Async-load dependencies used only in scripted dashboards to avoid them being in the main bundle, if not needed
const [jQuery, moment, lodash, kbn] = await Promise.all([
import('jquery'),
import('moment'),
import('lodash'),
import('app/core/utils/kbn'),
]);
const services = {
dashboardSrv: getDashboardSrv(),
datasourceSrv: getDatasourceSrv(),
@@ -90,12 +95,12 @@ abstract class DashboardLoaderSrvBase<T> implements DashboardLoaderSrvLike<T> {
locationService.getSearchObject(),
kbn,
dateMath,
_,
lodash,
moment,
window,
document,
$,
$,
jQuery,
jQuery,
services
);
@@ -560,6 +560,23 @@ describe('Language completion provider', () => {
start: 1560153109000,
});
});
it('should interpolate variables in stream selector', async () => {
const datasource = setup({});
jest.spyOn(datasource, 'getTimeRangeParams').mockReturnValue({ start: 0, end: 1 });
jest
.spyOn(datasource, 'interpolateString')
.mockImplementation((string: string) => string.replace(/\$test_var/g, 'age'));
const languageProvider = new LanguageProvider(datasource);
languageProvider.request = jest.fn().mockResolvedValue([]);
await languageProvider.fetchLabels({ streamSelector: '{age="new", $test_var="new"}' });
expect(languageProvider.request).toHaveBeenCalledWith('labels', {
end: 1,
query: '{age="new", age="new"}',
start: 0,
});
});
});
it('should filter internal labels', async () => {
@@ -175,7 +175,8 @@ export default class LokiLanguageProvider extends LanguageProvider {
const { start, end } = this.datasource.getTimeRangeParams(range);
const params: Record<string, string | number> = { start, end };
if (options?.streamSelector && options?.streamSelector !== EMPTY_SELECTOR) {
params['query'] = options.streamSelector;
const interpolatedStreamSelector = this.datasource.interpolateString(options.streamSelector);
params['query'] = interpolatedStreamSelector;
}
const res = await this.request(url, params);
if (Array.isArray(res)) {
+14
View File
@@ -3157,9 +3157,12 @@
"table": "Tabulka"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "Definujte podmínku, která musí být splněna před spuštěním pravidla výstrahy",
"description-configure-firing-alert-instances-routed-contact": "Nakonfigurujte způsob přesměrování instancí spouštění výstrah do kontaktních bodů",
"description-configure-receives-notifications": "Nakonfigurujte, kdo obdrží oznámení a jak jsou odesílána",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "Pravidla výstrah",
"title-contact-points": "Kontaktní body",
"title-notification-policies": "Zásady oznamování"
@@ -14508,6 +14511,17 @@
"series-to-rows": "Řady na řádky"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "Seřadit pole v rámci."
+14
View File
@@ -3135,9 +3135,12 @@
"table": "Tabelle"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "Legen Sie die Bedingung fest, die erfüllt sein muss, bevor eine Warnregel ausgelöst wird",
"description-configure-firing-alert-instances-routed-contact": "Konfigurieren Sie, wie ausgelöste Warnungsinstanzen an Kontaktpunkte weitergeleitet werden",
"description-configure-receives-notifications": "Konfigurieren Sie, wer Benachrichtigungen erhält und wie sie gesendet werden",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "Warnregeln",
"title-contact-points": "Kontaktpunkte",
"title-notification-policies": "Benachrichtigungsrichtlinien"
@@ -14396,6 +14399,17 @@
"series-to-rows": "Reihen zu Zeilen"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "Sortieren Sie Felder in einem Frame."
+14
View File
@@ -3135,9 +3135,12 @@
"table": "Tabla"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "Define la condición que debe cumplirse antes de que se active una regla de alerta",
"description-configure-firing-alert-instances-routed-contact": "Configurar cómo se enrutan las instancias de alerta de activación a los puntos de contacto",
"description-configure-receives-notifications": "Configurar quién recibe las notificaciones y cómo se envían",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "Reglas de alerta",
"title-contact-points": "Puntos de contacto",
"title-notification-policies": "Políticas de notificación"
@@ -14396,6 +14399,17 @@
"series-to-rows": "Series a filas"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "Ordenar campos en un marco."
+14
View File
@@ -3135,9 +3135,12 @@
"table": "Tableau"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "Définir la condition qui doit être remplie avant quune règle dalerte ne se déclenche",
"description-configure-firing-alert-instances-routed-contact": "Configurer la façon dont les instances dalerte de déclenchement sont acheminées vers les points de contact",
"description-configure-receives-notifications": "Configurer les destinataires des notifications et la manière dont elles sont envoyées",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "Règles d'alerte",
"title-contact-points": "Points de contact",
"title-notification-policies": "Règles de notification"
@@ -14396,6 +14399,17 @@
"series-to-rows": "Convertir la série en lignes"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "Triez les champs dans une trame."
+14
View File
@@ -3135,9 +3135,12 @@
"table": "Táblázat"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "Határozza meg azt a feltételt, amelynek teljesülnie kell, mielőtt egy riasztási szabály aktiválódik",
"description-configure-firing-alert-instances-routed-contact": "Konfigurálja, hogyan történjen az aktív riasztáspéldányok továbbítása a kapcsolattartási pontokhoz",
"description-configure-receives-notifications": "Állítsa be, hogy ki kapjon értesítéseket, és hogyan legyenek elküldve",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "Riasztási szabályok",
"title-contact-points": "Kapcsolattartási pontok",
"title-notification-policies": "Értesítési irányelvek"
@@ -14396,6 +14399,17 @@
"series-to-rows": "Sorozatok sorokká alakítása"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "Mezők rendezése egy keretben."
+14
View File
@@ -3124,9 +3124,12 @@
"table": "Tabel"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "Tentukan syarat yang harus dipenuhi sebelum aturan peringatan menyala",
"description-configure-firing-alert-instances-routed-contact": "Konfigurasikan cara instans peringatan yang menyala dirutekan ke titik kontak",
"description-configure-receives-notifications": "Konfigurasikan penerima pemberitahuan dan cara pemberitahuan dikirim",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "Aturan peringatan",
"title-contact-points": "Titik kontak",
"title-notification-policies": "Kebijakan pemberitahuan"
@@ -14340,6 +14343,17 @@
"series-to-rows": "Deret ke baris"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "Urutkan bidang dalam bingkai."
+14
View File
@@ -3135,9 +3135,12 @@
"table": "Tabella"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "Definisci la condizione che deve essere soddisfatta prima che venga attivata una regola di avviso",
"description-configure-firing-alert-instances-routed-contact": "Configura il modo in cui le istanze di avviso attivate vengono instradate ai punti di contatto",
"description-configure-receives-notifications": "Configura chi riceve le notifiche e come vengono inviate",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "Regole di avviso",
"title-contact-points": "Punti di contatto",
"title-notification-policies": "Politiche di notifica"
@@ -14396,6 +14399,17 @@
"series-to-rows": "Serie a righe"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "Ordina i campi in un frame."
+14
View File
@@ -3124,9 +3124,12 @@
"table": "テーブル"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "アラートルールが発生される前に満たすべき条件を定義します",
"description-configure-firing-alert-instances-routed-contact": "発生中のアラートインスタンスを連絡先にルーティングする方法を設定",
"description-configure-receives-notifications": "通知の受信者と送信方法を設定",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "アラートルール",
"title-contact-points": "コンタクトポイント",
"title-notification-policies": "通知ポリシー"
@@ -14340,6 +14343,17 @@
"series-to-rows": "系列を行に変換"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "フレーム内のフィールドを並べ替えます。"
+14
View File
@@ -3124,9 +3124,12 @@
"table": "표"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "경고 규칙이 발동되기 전에 충족되어야 하는 조건을 정의합니다",
"description-configure-firing-alert-instances-routed-contact": "경고 발생 인스턴스가 연락처로 라우팅되는 방식을 구성합니다",
"description-configure-receives-notifications": "알림을 받는 사람과 전송 방식을 구성합니다",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "경고 규칙",
"title-contact-points": "연락처",
"title-notification-policies": "알림 정책"
@@ -14340,6 +14343,17 @@
"series-to-rows": "계열에서 행으로"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "프레임에서 필드를 정렬합니다."
+14
View File
@@ -3135,9 +3135,12 @@
"table": "Tabel"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "Definieer de voorwaarde waaraan moet worden voldaan voordat een waarschuwingsregel geactiveerd wordt",
"description-configure-firing-alert-instances-routed-contact": "Configureer hoe geactiveerde waarschuwingsinstanties worden gerouteerd naar contactpunten",
"description-configure-receives-notifications": "Configureer wie meldingen ontvangt en hoe deze worden verzonden",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "Waarschuwingsregels",
"title-contact-points": "Contactpunten",
"title-notification-policies": "Meldingsbeleid"
@@ -14396,6 +14399,17 @@
"series-to-rows": "Reeksen naar rijen"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "Velden in een frame sorteren."
+14
View File
@@ -3157,9 +3157,12 @@
"table": "Tabela"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "Zdefiniuj warunek, który musi zostać spełniony przed uruchomieniem reguły alertu",
"description-configure-firing-alert-instances-routed-contact": "Skonfiguruj, w jaki sposób uruchamiane instancje alertów są kierowane do punktów kontaktu",
"description-configure-receives-notifications": "Skonfiguruj, kto otrzymuje powiadomienia i jak są one wysyłane",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "Reguły alertu",
"title-contact-points": "Punkty kontaktowe",
"title-notification-policies": "Zasady powiadamiania"
@@ -14508,6 +14511,17 @@
"series-to-rows": "Szeregi do wierszy"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "Sortuj pola w ramce."
+14
View File
@@ -3135,9 +3135,12 @@
"table": "Tabela"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "Defina a condição que deve ser atendida antes que uma regra de alerta seja acionada",
"description-configure-firing-alert-instances-routed-contact": "Configure como as instâncias de alertas ativos são encaminhadas para os pontos de contato",
"description-configure-receives-notifications": "Configure quem recebe notificações e como elas são enviadas",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "Regras de alerta",
"title-contact-points": "Pontos de contato",
"title-notification-policies": "Política de notificações"
@@ -14396,6 +14399,17 @@
"series-to-rows": "Série para fileiras"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "Classificar os campos em um quadro."
+14
View File
@@ -3135,9 +3135,12 @@
"table": "Tabela"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "Definir a condição que deve ser cumprida antes de uma regra de alerta ser acionada",
"description-configure-firing-alert-instances-routed-contact": "Configurar como as instâncias de alerta de ativação são encaminhadas para os pontos de contacto",
"description-configure-receives-notifications": "Configurar quem recebe notificações e como são enviadas",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "Regras de alerta",
"title-contact-points": "Pontos de contacto",
"title-notification-policies": "Políticas de notificação"
@@ -14396,6 +14399,17 @@
"series-to-rows": "Série para linhas"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "Ordenar campos num quadro."
+14
View File
@@ -3157,9 +3157,12 @@
"table": "Таблица"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "Задайте условие, которое должно быть выполнено до того, как автивируется правило оповещения.",
"description-configure-firing-alert-instances-routed-contact": "Установите способ направления активных экземпляров оповещений в точки контакта.",
"description-configure-receives-notifications": "Установите получателей уведомлений и способы их отправки.",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "Правила оповещения",
"title-contact-points": "Точки контакта",
"title-notification-policies": "Политики уведомления"
@@ -14508,6 +14511,17 @@
"series-to-rows": "Ряды в строки"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "Сортируйте поля в фрейме."
+14
View File
@@ -3135,9 +3135,12 @@
"table": "Tabell"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "Definiera villkoret som måste uppfyllas innan en larmregel utlöses",
"description-configure-firing-alert-instances-routed-contact": "Konfigurera hur utlösta larminstanser dirigeras till kontaktpunkter",
"description-configure-receives-notifications": "Konfigurera vem som tar emot aviseringar och hur de skickas",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "Varningsregler",
"title-contact-points": "Kontaktpunkter",
"title-notification-policies": "Aviseringspolicyer"
@@ -14396,6 +14399,17 @@
"series-to-rows": "Serie till rader"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "Sortera fält i en ram."
+14
View File
@@ -3135,9 +3135,12 @@
"table": "Tablo"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "Bir uyarı kuralının tetiklenmesi için karşılanması gereken koşulu tanımlayın",
"description-configure-firing-alert-instances-routed-contact": "Tetiklenen uyarı örneklerinin iletişim noktalarına nasıl yönlendirileceğini yapılandırın",
"description-configure-receives-notifications": "Bildirimlerin kime gönderileceğini ve nasıl gönderileceğini yapılandırın",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "Uyarı kuralları",
"title-contact-points": "İletişim noktaları",
"title-notification-policies": "Bildirim politikaları"
@@ -14396,6 +14399,17 @@
"series-to-rows": "Seriden satırlara"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "Alanları bir çerçevede sıralayın."
+14
View File
@@ -3124,9 +3124,12 @@
"table": "表格"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "定义警报规则触发前必须满足的条件",
"description-configure-firing-alert-instances-routed-contact": "配置如何将触发的警报实例路由到联络点",
"description-configure-receives-notifications": "配置接收通知的人员以及通知发送方式",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "警报规则",
"title-contact-points": "联络点",
"title-notification-policies": "通知策略"
@@ -14340,6 +14343,17 @@
"series-to-rows": "序列到行"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "对帧中的字段进行排序。"
+14
View File
@@ -3124,9 +3124,12 @@
"table": "表格"
},
"welcome-header": {
"description-alert-activity": "",
"description-alert-rules": "定義警報規則觸發前必須滿足的條件",
"description-configure-firing-alert-instances-routed-contact": "設定如何將觸發的警報執行個體傳送至聯絡點",
"description-configure-receives-notifications": "設定接收通知的對象以及傳送方式",
"href-text-alert-activity": "",
"title-alert-activity": "",
"title-alert-rules": "警報規則",
"title-contact-points": "聯絡點",
"title-notification-policies": "通知政策"
@@ -14340,6 +14343,17 @@
"series-to-rows": "將序列轉為列"
}
},
"smoothing": {
"description": "",
"effective-resolution": "",
"effective-resolution-tooltip": "",
"is-applicable-description": "",
"name": "",
"resolution": {
"label": "",
"tooltip": ""
}
},
"sort-by-transformer-editor": {
"description": {
"sort-fields": "對框架中的欄位進行排序。"