diff --git a/public/app/plugins/datasource/prometheus/components/PromExemplarField.tsx b/public/app/plugins/datasource/prometheus/components/PromExemplarField.tsx index 620a18bbeb4..66e0864c703 100644 --- a/public/app/plugins/datasource/prometheus/components/PromExemplarField.tsx +++ b/public/app/plugins/datasource/prometheus/components/PromExemplarField.tsx @@ -26,7 +26,8 @@ export function PromExemplarField({ datasource, onChange, query }: Props) { onChange(false); } else { setError(null); - if (prevError !== error) { + // If error is cleared, we want to change exemplar to true + if (prevError && !error) { onChange(true); } }