diff --git a/public/app/overrides/services/apps.ts b/public/app/overrides/services/apps.ts index 4e6cc2d106..aeac3b72e1 100644 --- a/public/app/overrides/services/apps.ts +++ b/public/app/overrides/services/apps.ts @@ -80,11 +80,17 @@ function removeDuplicateApps(app: App[]) { export async function fetchApps(): Promise< Result > { - // TODO: is this the best query? - const response = await requestWithOrgID('/querier.v1.QuerierService/Series', { + let response = await requestWithOrgID('/querier.v1.QuerierService/Series', { method: 'POST', body: JSON.stringify({ matchers: [], + labelNames: [ + PyroscopeAppLabel, + ServiceNameLabel, + '__profile_type__', + '__type__', + '__name__', + ], }), headers: { 'content-type': 'application/json', @@ -95,5 +101,19 @@ export async function fetchApps(): Promise< return parseResponse(response, ListOfAppsSchema); } + // try without labelNames in case of an error since this has been added in a later version + response = await requestWithOrgID('/querier.v1.QuerierService/Series', { + method: 'POST', + body: JSON.stringify({ + matchers: [], + }), + headers: { + 'content-type': 'application/json', + }, + }); + if (response.isOk) { + return parseResponse(response, ListOfAppsSchema); + } + return Result.err(response.error); }