mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Tempo: fix test data source (#28836)
This commit is contained in:
parent
9155f46315
commit
62138e8ad4
@ -79,13 +79,12 @@ export class TempoDatasource extends DataSourceApi<TempoQuery> {
|
|||||||
try {
|
try {
|
||||||
await this._request(`/api/traces/random`).toPromise();
|
await this._request(`/api/traces/random`).toPromise();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// As we are not searching for a valid trace here this will definitely fail but we should return 502 if it's
|
// If all went well this request will get back with 400 - Bad request
|
||||||
// unreachable. 500 should otherwise be from tempo it self but probably makes sense to report them here.
|
if (e?.status !== 400) {
|
||||||
if (e?.status >= 500 && e?.status < 600) {
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return { status: 'success', message: 'Data source is working' };
|
||||||
}
|
}
|
||||||
|
|
||||||
getTimeRange(): { start: number; end: number } {
|
getTimeRange(): { start: number; end: number } {
|
||||||
|
Loading…
Reference in New Issue
Block a user