-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Infra] Create endpoint to verify if there is data (#189470)
closes [189247](#189247) ## Summary Create an endpoint to return whether there is data for modules passed via `modules` query param. When `modules` is not passed, the query will just check if there is any data in the index patterns configured in the Settings page ### How to test - Start a local Kibana instance - Run `node scripts/synthtrace infra_hosts_with_apm_hosts --live` - Run in the Dev tools: - `GET kbn:/api/metrics/source/hasData?modules=kubernetes&modules=system` - `GET kbn:/api/metrics/source/hasData?modules=system` - `GET kbn:/api/metrics/source/hasData?modules=kubernetes&modules=system&modules=kafka&modules=aws&modules=azure` - should return 400 - `GET kbn:/api/metrics/source/hasData`
- Loading branch information
1 parent
d86e139
commit ea64b47
Showing
9 changed files
with
166 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
x-pack/plugins/observability_solution/infra/common/metrics_sources/get_has_data.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import * as rt from 'io-ts'; | ||
|
||
export const getHasDataQueryParamsRT = rt.partial({ | ||
// Integrations `event.module` value | ||
modules: rt.union([rt.string, rt.array(rt.string)]), | ||
}); | ||
|
||
export const getHasDataResponseRT = rt.partial({ | ||
hasData: rt.boolean, | ||
}); | ||
|
||
export type GetHasDataQueryParams = rt.TypeOf<typeof getHasDataQueryParamsRT>; | ||
export type GetHasDataResponse = rt.TypeOf<typeof getHasDataResponseRT>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters