mirror of https://github.com/grafana/grafana
Prometheus: Disable exemplar queries for alerting (#41607)
* Prometheus: Dont include empty exempalr frame in results * Prometheus: Never run exemplar queries for alerting * Remove exemplar field from alerting and set exemplar to false * Add tests for frontend * Add test for backendpull/41638/head
parent
44837fc592
commit
9b9e41e036
@ -1,209 +0,0 @@ |
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP |
||||
|
||||
exports[`Render PromQueryEditor with basic options should render 1`] = ` |
||||
<PromQueryField |
||||
ExtraFieldElement={ |
||||
<div |
||||
className="gf-form-inline" |
||||
> |
||||
<div |
||||
className="gf-form" |
||||
> |
||||
<FormLabel |
||||
tooltip="Controls the name of the time series, using name or pattern. For example |
||||
{{hostname}} will be replaced with label value for the label hostname." |
||||
width={7} |
||||
> |
||||
Legend |
||||
</FormLabel> |
||||
<input |
||||
className="gf-form-input" |
||||
onBlur={[Function]} |
||||
onChange={[Function]} |
||||
placeholder="legend format" |
||||
type="text" |
||||
value="" |
||||
/> |
||||
</div> |
||||
<div |
||||
className="gf-form" |
||||
> |
||||
<FormLabel |
||||
tooltip={ |
||||
<React.Fragment> |
||||
An additional lower limit for the step parameter of the Prometheus query and for the |
||||
|
||||
<code> |
||||
$__interval |
||||
</code> |
||||
and |
||||
<code> |
||||
$__rate_interval |
||||
</code> |
||||
variables. The limit is absolute and not modified by the "Resolution" setting. |
||||
</React.Fragment> |
||||
} |
||||
width={7} |
||||
> |
||||
Min step |
||||
</FormLabel> |
||||
<input |
||||
className="gf-form-input width-8" |
||||
onBlur={[Function]} |
||||
onChange={[Function]} |
||||
placeholder="" |
||||
type="text" |
||||
value="" |
||||
/> |
||||
</div> |
||||
<div |
||||
className="gf-form" |
||||
> |
||||
<div |
||||
className="gf-form-label" |
||||
> |
||||
Resolution |
||||
</div> |
||||
<Select |
||||
isSearchable={false} |
||||
menuShouldPortal={true} |
||||
onChange={[Function]} |
||||
options={ |
||||
Array [ |
||||
Object { |
||||
"label": "1/1", |
||||
"value": 1, |
||||
}, |
||||
Object { |
||||
"label": "1/2", |
||||
"value": 2, |
||||
}, |
||||
Object { |
||||
"label": "1/3", |
||||
"value": 3, |
||||
}, |
||||
Object { |
||||
"label": "1/4", |
||||
"value": 4, |
||||
}, |
||||
Object { |
||||
"label": "1/5", |
||||
"value": 5, |
||||
}, |
||||
Object { |
||||
"label": "1/10", |
||||
"value": 10, |
||||
}, |
||||
] |
||||
} |
||||
value={ |
||||
Object { |
||||
"label": "1/1", |
||||
"value": 1, |
||||
} |
||||
} |
||||
/> |
||||
</div> |
||||
<div |
||||
className="gf-form" |
||||
> |
||||
<div |
||||
className="gf-form-label width-7" |
||||
> |
||||
Format |
||||
</div> |
||||
<Select |
||||
className="select-container" |
||||
isSearchable={false} |
||||
menuShouldPortal={true} |
||||
onChange={[Function]} |
||||
options={ |
||||
Array [ |
||||
Object { |
||||
"label": "Time series", |
||||
"value": "time_series", |
||||
}, |
||||
Object { |
||||
"label": "Table", |
||||
"value": "table", |
||||
}, |
||||
Object { |
||||
"label": "Heatmap", |
||||
"value": "heatmap", |
||||
}, |
||||
] |
||||
} |
||||
value={ |
||||
Object { |
||||
"label": "Time series", |
||||
"value": "time_series", |
||||
} |
||||
} |
||||
width={16} |
||||
/> |
||||
<Switch |
||||
checked={false} |
||||
label="Instant" |
||||
onChange={[Function]} |
||||
/> |
||||
<FormLabel |
||||
tooltip="Link to Graph in Prometheus" |
||||
width={10} |
||||
> |
||||
<Memo(PromLink) |
||||
datasource={ |
||||
Object { |
||||
"createQuery": [MockFunction], |
||||
"getPrometheusTime": [MockFunction], |
||||
} |
||||
} |
||||
query={ |
||||
Object { |
||||
"exemplar": true, |
||||
"expr": "", |
||||
"interval": "", |
||||
"legendFormat": "", |
||||
"refId": "A", |
||||
} |
||||
} |
||||
/> |
||||
</FormLabel> |
||||
</div> |
||||
<PromExemplarField |
||||
datasource={ |
||||
Object { |
||||
"createQuery": [MockFunction], |
||||
"getPrometheusTime": [MockFunction], |
||||
} |
||||
} |
||||
onChange={[Function]} |
||||
query={ |
||||
Object { |
||||
"exemplar": true, |
||||
"expr": "", |
||||
"interval": "", |
||||
"legendFormat": "", |
||||
"refId": "A", |
||||
} |
||||
} |
||||
/> |
||||
</div> |
||||
} |
||||
data-testid="prom-editor" |
||||
datasource={ |
||||
Object { |
||||
"createQuery": [MockFunction], |
||||
"getPrometheusTime": [MockFunction], |
||||
} |
||||
} |
||||
history={Array []} |
||||
onChange={[Function]} |
||||
onRunQuery={[Function]} |
||||
query={ |
||||
Object { |
||||
"expr": "", |
||||
"refId": "A", |
||||
} |
||||
} |
||||
/> |
||||
`; |
Loading…
Reference in new issue