diff --git a/e2e/various-suite/loki-editor.spec.ts b/e2e/various-suite/loki-editor.spec.ts index a965a5c3acf..0f33f683b7f 100644 --- a/e2e/various-suite/loki-editor.spec.ts +++ b/e2e/various-suite/loki-editor.spec.ts @@ -5,7 +5,7 @@ const addDataSource = () => { e2e.flows.addDataSource({ type: 'Loki', expectedAlertMessage: - 'Unable to fetch labels from Loki (Failed to call resource), please check the server logs for more details', + 'Unable to connect with Loki (Failed to call resource). Please check the server logs for more details.', name: dataSourceName, form: () => { e2e.components.DataSource.DataSourceHttpSettings.urlInput().type('http://loki-url:3100'); diff --git a/e2e/various-suite/loki-query-builder.spec.ts b/e2e/various-suite/loki-query-builder.spec.ts index 96bf1230a86..c2f6a98675e 100644 --- a/e2e/various-suite/loki-query-builder.spec.ts +++ b/e2e/various-suite/loki-query-builder.spec.ts @@ -6,7 +6,7 @@ const addDataSource = () => { e2e.flows.addDataSource({ type: 'Loki', expectedAlertMessage: - 'Unable to fetch labels from Loki (Failed to call resource), please check the server logs for more details', + 'Unable to connect with Loki (Failed to call resource). Please check the server logs for more details.', name: dataSourceName, form: () => { e2e.components.DataSource.DataSourceHttpSettings.urlInput().type('http://loki-url:3100'); diff --git a/packages/grafana-ui/src/components/DataSourceSettings/AlertingSettings.test.tsx b/packages/grafana-ui/src/components/DataSourceSettings/AlertingSettings.test.tsx index e68e6829975..e860f0ade63 100644 --- a/packages/grafana-ui/src/components/DataSourceSettings/AlertingSettings.test.tsx +++ b/packages/grafana-ui/src/components/DataSourceSettings/AlertingSettings.test.tsx @@ -44,8 +44,8 @@ describe('Alerting Settings', () => { expect(screen.queryByText('Alertmanager data source')).toBeNull(); }); - it('should show the option to Manage alerts via Alerting UI', () => { + it('should show the option to manager alerts', () => { setup(); - expect(screen.getByText('Manage alerts via Alerting UI')).toBeVisible(); + expect(screen.getByText('Manage alert rules in Alerting UI')).toBeVisible(); }); }); diff --git a/packages/grafana-ui/src/components/DataSourceSettings/AlertingSettings.tsx b/packages/grafana-ui/src/components/DataSourceSettings/AlertingSettings.tsx index 171858ae17d..e02c7954daf 100644 --- a/packages/grafana-ui/src/components/DataSourceSettings/AlertingSettings.tsx +++ b/packages/grafana-ui/src/components/DataSourceSettings/AlertingSettings.tsx @@ -19,7 +19,12 @@ export function AlertingSettings({ options, onOptionsC
- + diff --git a/public/app/plugins/datasource/loki/configuration/ConfigEditor.tsx b/public/app/plugins/datasource/loki/configuration/ConfigEditor.tsx index 73706113841..f5a3dee4ccb 100644 --- a/public/app/plugins/datasource/loki/configuration/ConfigEditor.tsx +++ b/public/app/plugins/datasource/loki/configuration/ConfigEditor.tsx @@ -44,16 +44,10 @@ export const ConfigEditor = (props: Props) => { options={options} onOptionsChange={onOptionsChange} /> -
-
-
- onOptionsChange(setMaxLines(options, value))} - /> -
-
-
+ onOptionsChange(setMaxLines(options, value))} + /> { const { value, onChange } = props; return ( - onChange(event.currentTarget.value)} - spellCheck={false} - placeholder="1000" - /> - } - tooltip={ - <> - Loki queries must contain a limit of the maximum number of lines returned (default: 1000). Increase this limit - to have a bigger result set for ad-hoc analysis. Decrease this limit if your browser becomes sluggish when - displaying the log results. - - } - /> + <> +

Queries

+
+
+
+ onChange(event.currentTarget.value)} + spellCheck={false} + placeholder="1000" + /> + } + tooltip={ + <> + Loki queries must contain a limit of the maximum number of lines returned (default: 1000). Increase + this limit to have a bigger result set for ad-hoc analysis. Decrease this limit if your browser + becomes sluggish when displaying the log results. + + } + /> +
+
+
+ ); }; diff --git a/public/app/plugins/datasource/loki/datasource.test.ts b/public/app/plugins/datasource/loki/datasource.test.ts index bfa63d0791d..ad3e48e7944 100644 --- a/public/app/plugins/datasource/loki/datasource.test.ts +++ b/public/app/plugins/datasource/loki/datasource.test.ts @@ -336,7 +336,7 @@ describe('LokiDatasource', () => { expect(result).toStrictEqual({ status: 'success', - message: 'Data source connected and labels found.', + message: 'Data source successfully connected.', }); }); @@ -347,7 +347,8 @@ describe('LokiDatasource', () => { expect(result).toStrictEqual({ status: 'error', - message: 'Data source connected, but no labels received. Verify that Loki and Promtail is configured properly.', + message: + 'Data source connected, but no labels were received. Verify that Loki and Promtail are correctly configured.', }); }); @@ -358,7 +359,7 @@ describe('LokiDatasource', () => { expect(result).toStrictEqual({ status: 'error', - message: 'Unable to fetch labels from Loki, please check the server logs for more details', + message: 'Unable to connect with Loki. Please check the server logs for more details.', }); }); @@ -374,7 +375,7 @@ describe('LokiDatasource', () => { expect(result).toStrictEqual({ status: 'error', - message: 'Unable to fetch labels from Loki (error42), please check the server logs for more details', + message: 'Unable to connect with Loki (error42). Please check the server logs for more details.', }); }); }); diff --git a/public/app/plugins/datasource/loki/datasource.ts b/public/app/plugins/datasource/loki/datasource.ts index 527ba30ca42..f07f7b1c52d 100644 --- a/public/app/plugins/datasource/loki/datasource.ts +++ b/public/app/plugins/datasource/loki/datasource.ts @@ -735,11 +735,11 @@ export class LokiDatasource return this.metadataRequest('labels', params).then( (values) => { return values.length > 0 - ? { status: 'success', message: 'Data source connected and labels found.' } + ? { status: 'success', message: 'Data source successfully connected.' } : { status: 'error', message: - 'Data source connected, but no labels received. Verify that Loki and Promtail is configured properly.', + 'Data source connected, but no labels were received. Verify that Loki and Promtail are correctly configured.', }; }, (err) => { @@ -750,7 +750,7 @@ export class LokiDatasource // because those will only describe how the request between browser<>server failed const info: string = err?.data?.message ?? ''; const infoInParentheses = info !== '' ? ` (${info})` : ''; - const message = `Unable to fetch labels from Loki${infoInParentheses}, please check the server logs for more details`; + const message = `Unable to connect with Loki${infoInParentheses}. Please check the server logs for more details.`; return { status: 'error', message: message }; } );