-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Logs UI] Log alerts chart previews #75296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Kerry350
merged 16 commits into
elastic:master
from
Kerry350:69530-logs-alerting-chart-previews
Aug 25, 2020
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
43c8aa4
Add chart previews for log threshold alerts
Kerry350 778dc0c
Remove casting
Kerry350 53bd350
Improve chart rendering for grouped scenario and add extended bounds …
Kerry350 2f3545c
Amend colour types
Kerry350 3c56a2c
Merge remote-tracking branch 'upstream/master' into 69530-logs-alerti…
Kerry350 d270e3c
Tweak lookback message for ungrouped scenario
Kerry350 cd8dd8f
Fix typecheck
Kerry350 3e87a0b
Merge remote-tracking branch 'upstream/master' into 69530-logs-alerti…
Kerry350 74d4d6a
Merge branch 'master' into 69530-logs-alerting-chart-previews
elasticmachine d97e807
Merge remote-tracking branch 'upstream/master' into 69530-logs-alerti…
Kerry350 7d0711b
Update x-pack/plugins/infra/public/components/alerting/logs/expressio…
Kerry350 9814507
Merge branch '69530-logs-alerting-chart-previews' of github.com:Kerry…
Kerry350 8b6c960
Update x-pack/plugins/infra/public/components/alerting/logs/expressio…
Kerry350 7871252
Merge branch '69530-logs-alerting-chart-previews' of github.com:Kerry…
Kerry350 dc5851b
Tweaks
Kerry350 d3c2041
Tweaks
Kerry350 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
63 changes: 63 additions & 0 deletions
63
x-pack/plugins/infra/common/http_api/log_alerts/chart_preview_data.ts
This file contains hidden or 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,63 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| import * as rt from 'io-ts'; | ||
| import { criteriaRT, TimeUnitRT, timeSizeRT, groupByRT } from '../../alerting/logs/types'; | ||
|
|
||
| export const LOG_ALERTS_CHART_PREVIEW_DATA_PATH = '/api/infra/log_alerts/chart_preview_data'; | ||
|
|
||
| const pointRT = rt.type({ | ||
| timestamp: rt.number, | ||
| value: rt.number, | ||
| }); | ||
|
|
||
| export type Point = rt.TypeOf<typeof pointRT>; | ||
|
|
||
| const serieRT = rt.type({ | ||
| id: rt.string, | ||
| points: rt.array(pointRT), | ||
| }); | ||
|
|
||
| const seriesRT = rt.array(serieRT); | ||
|
|
||
| export type Series = rt.TypeOf<typeof seriesRT>; | ||
|
|
||
| export const getLogAlertsChartPreviewDataSuccessResponsePayloadRT = rt.type({ | ||
| data: rt.type({ | ||
| series: seriesRT, | ||
| }), | ||
| }); | ||
|
|
||
| export type GetLogAlertsChartPreviewDataSuccessResponsePayload = rt.TypeOf< | ||
| typeof getLogAlertsChartPreviewDataSuccessResponsePayloadRT | ||
| >; | ||
|
|
||
| export const getLogAlertsChartPreviewDataAlertParamsSubsetRT = rt.intersection([ | ||
| rt.type({ | ||
| criteria: criteriaRT, | ||
| timeUnit: TimeUnitRT, | ||
| timeSize: timeSizeRT, | ||
| }), | ||
| rt.partial({ | ||
| groupBy: groupByRT, | ||
| }), | ||
| ]); | ||
|
|
||
| export type GetLogAlertsChartPreviewDataAlertParamsSubset = rt.TypeOf< | ||
| typeof getLogAlertsChartPreviewDataAlertParamsSubsetRT | ||
| >; | ||
|
|
||
| export const getLogAlertsChartPreviewDataRequestPayloadRT = rt.type({ | ||
| data: rt.type({ | ||
| sourceId: rt.string, | ||
| alertParams: getLogAlertsChartPreviewDataAlertParamsSubsetRT, | ||
| buckets: rt.number, | ||
| }), | ||
| }); | ||
|
|
||
| export type GetLogAlertsChartPreviewDataRequestPayload = rt.TypeOf< | ||
| typeof getLogAlertsChartPreviewDataRequestPayloadRT | ||
| >; | ||
This file contains hidden or 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,7 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| export * from './chart_preview_data'; |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.