From 5d183677f8aaf1f4c781e1214b12379c29d53374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Sepi=C3=B3=C5=82?= Date: Tue, 7 Apr 2026 09:54:47 +0200 Subject: [PATCH] [FEATURE] add test connection button to prometheus plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrian Sepiół Signed-off-by: Adrian Sepiół --- prometheus/src/plugins/PrometheusDatasourceEditor.tsx | 11 ++++------- prometheus/src/plugins/prometheus-datasource.tsx | 1 + 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/prometheus/src/plugins/PrometheusDatasourceEditor.tsx b/prometheus/src/plugins/PrometheusDatasourceEditor.tsx index f19340e99..aa5a9fd27 100644 --- a/prometheus/src/plugins/PrometheusDatasourceEditor.tsx +++ b/prometheus/src/plugins/PrometheusDatasourceEditor.tsx @@ -13,7 +13,7 @@ import { Box, IconButton, TextField, Typography } from '@mui/material'; import { QueryParamValues } from '@perses-dev/components'; -import { HTTPSettingsEditor } from '@perses-dev/plugin-system'; +import { HTTPSettingsEditor, OptionsEditorProps } from '@perses-dev/plugin-system'; import MinusIcon from 'mdi-material-ui/Minus'; import PlusIcon from 'mdi-material-ui/Plus'; import { ReactElement, useRef, useState } from 'react'; @@ -27,14 +27,10 @@ interface QueryParamEntry { value: string; } -export interface PrometheusDatasourceEditorProps { - value: PrometheusDatasourceSpec; - onChange: (next: PrometheusDatasourceSpec) => void; - isReadonly?: boolean; -} +export type PrometheusDatasourceEditorProps = OptionsEditorProps; export function PrometheusDatasourceEditor(props: PrometheusDatasourceEditorProps): ReactElement { - const { value, onChange, isReadonly } = props; + const { value, onChange, isReadonly, testConnection } = props; // Counter for generating unique IDs const nextIdRef = useRef(0); @@ -171,6 +167,7 @@ export function PrometheusDatasourceEditor(props: PrometheusDatasourceEditorProp isReadonly={isReadonly} initialSpecDirect={initialSpecDirect} initialSpecProxy={initialSpecProxy} + testConnection={testConnection} /> Query Parameters diff --git a/prometheus/src/plugins/prometheus-datasource.tsx b/prometheus/src/plugins/prometheus-datasource.tsx index 53fc53293..9011d9000 100644 --- a/prometheus/src/plugins/prometheus-datasource.tsx +++ b/prometheus/src/plugins/prometheus-datasource.tsx @@ -129,4 +129,5 @@ export const PrometheusDatasource: DatasourcePlugin ({ directUrl: '' }), + healthCheckPath: '/api/v1/status/buildinfo', };