Skip to content

Commit

Permalink
Observability Overview fix extra basepath prepend for alerting fetch (#…
Browse files Browse the repository at this point in the history
…74465) (#74480)

Co-authored-by: Oliver Gupte <ogupte@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 6, 2020
1 parent 94f88a4 commit 60edc17
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 60edc17

Please sign in to comment.