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
  • Loading branch information
ogupte authored Aug 6, 2020
1 parent 626fbc2 commit 13fd9e3
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 13fd9e3

Please sign in to comment.