Observability Overview fix extra basepath prepend for alerting fetch (#74465)

This commit is contained in:
Oliver Gupte 2020-08-06 01:12:48 -07:00 committed by GitHub
parent 626fbc2948
commit 13fd9e39ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,15 +11,12 @@ const allowedConsumers = ['apm', 'uptime', 'logs', 'metrics', 'alerts'];
export async function getObservabilityAlerts({ core }: { core: AppMountContext['core'] }) {
try {
const { data = [] }: { data: Alert[] } = await core.http.get(
core.http.basePath.prepend('/api/alerts/_find'),
{
query: {
page: 1,
per_page: 20,
},
}
);
const { data = [] }: { data: Alert[] } = await core.http.get('/api/alerts/_find', {
query: {
page: 1,
per_page: 20,
},
});
return data.filter(({ consumer }) => allowedConsumers.includes(consumer));
} catch (e) {