Skip to content

Commit

Permalink
[ML] AIOps: Rename Explain Log Rate Spikes to Log Rate Analysis. (ela…
Browse files Browse the repository at this point in the history
…stic#161764)

## Summary

Part of elastic#161832.

This PR renames the Explain Log Rate Spikes feature to **Log Rate
Analysis**.

- [x] Renamed references in `docs/developer/*`
- [x] Updated docs screenshots
- [x] Redirect in docs
- [x] Redirect urls from `explain_log_rate_spikes` to `log_rate_analysis`
- [x] API versioning
- [x] Renamed navigation links
- [x] Renamed variable names
- [x] Renamed file names
- [x] Renamed i18n ids
- [x] Renamed breadcrumbs 
- [x] Removed hard coded `AIOPS_ENABLED` feature flag
  • Loading branch information
walterra authored and Devon Thomson committed Aug 1, 2023
1 parent a87cd55 commit d0aa8aa
Show file tree
Hide file tree
Showing 103 changed files with 770 additions and 817 deletions.
2 changes: 1 addition & 1 deletion docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ The plugin exposes the static DefaultEditorController class to consume.
|{kib-repo}blob/{branch}/x-pack/plugins/aiops/README.md[aiops]
|The plugin provides APIs and components for AIOps features, including the “Explain log rate spikes” UI, maintained by the ML team.
|The plugin provides APIs and components for AIOps features, including the “Log rate analysis” UI, maintained by the ML team.
|{kib-repo}blob/{branch}/x-pack/plugins/alerting/README.md[alerting]
Expand Down
4 changes: 4 additions & 0 deletions docs/redirects.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
The following pages have moved or been deleted.

--
[role="exclude",id="explain-log-rate-spikes"]
== Explain log rate spikes
Refer to <<log-rate-analysis>>.

[role="exclude",id="snapshot-repositories"]
== Snapshot and Restore
Refer to {ref}/snapshot-restore.html[Snapshot and Restore].
Expand Down
Binary file removed docs/user/ml/images/ml-explain-log-rate-before.png
Binary file not shown.
Binary file removed docs/user/ml/images/ml-explain-log-rate.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/ml/images/ml-log-rate-analysis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions docs/user/ml/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -117,27 +117,27 @@ AIOps Labs is a part of {ml-app} in {kib} which provides features that use
advanced statistical methods to help you interpret your data and its behavior.

[discrete]
[[explain-log-rate-spikes]]
=== Explain log rate spikes
[[log-rate-analysis]]
=== Log rate analysis

preview::[]

Explain log rate spikes is a feature that uses advanced statistical methods to
identify reasons for increases in log rates. It makes it easy to find and
investigate causes of unusual spikes by using the analysis workflow view.
Log rate analysis is a feature that uses advanced statistical methods to
identify reasons for increases or decreases in log rates. It makes it easy to find and
investigate causes of unusual spikes or drops by using the analysis workflow view.
Examine the histogram chart of the log rates for a given {data-source}, and find
the reason behind a particular change possibly in millions of log events across
multiple fields and values.

You can find explain log rate spikes under **{ml-app}** > **AIOps Labs** where
You can find log rate analysis under **{ml-app}** > **AIOps Labs** where
you can select the {data-source} or saved search that you want to analyze.

[role="screenshot"]
image::user/ml/images/ml-explain-log-rate-before.png[Log event histogram chart]
image::user/ml/images/ml-log-rate-analysis-before.png[Log event histogram chart]

Select a spike in the log event histogram chart to start the analysis. It
Select a spike or drop in the log event histogram chart to start the analysis. It
identifies statistically significant field-value combinations that contribute to
the spike and displays them in a table. You can optionally choose to summarize
the spike or drop and displays them in a table. You can optionally choose to summarize
the results into groups. The table also shows an indicator of the level of
impact and a sparkline showing the shape of the impact in the chart. Hovering
over a row displays the impact on the histogram chart in more detail. You can
Expand All @@ -153,7 +153,7 @@ analyzed data. You can move the brushes to redefine both the baseline and the
deviation and rerun the analysis with the modified values.

[role="screenshot"]
image::user/ml/images/ml-explain-log-rate.png[Log rate spike explained]
image::user/ml/images/ml-log-rate-analysis.png[Log rate spike explained]


[discrete]
Expand Down Expand Up @@ -205,7 +205,7 @@ image::user/ml/images/ml-change-point-detection.png[Change point detection UI]
Select a function and a metric field, then pick a date range to start detecting
change points in the defined range. Optionally, you can split the data by a
field. If the cardinality of the split field exceeds 10,000, then only the first
10,000, sorted by document count, are analyzed. You can configure a maximum of 6
10,000, sorted by document count, are analyzed. You can configure a maximum of 6
combinations of a function applied to a metric field, partitioned by a split
field to identify change points.

Expand All @@ -222,4 +222,4 @@ change; lower values indicate more significant changes. You can use the change
point type selector to filter the results by specific types of change points.

[role="screenshot"]
image::user/ml/images/ml-change-point-detection-selected.png[Selected change points]
image::user/ml/images/ml-change-point-detection-selected.png[Selected change points]
2 changes: 1 addition & 1 deletion packages/deeplinks/ml/deep_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type LinkId =
| 'resultExplorer'
| 'analyticsMap'
| 'aiOps'
| 'explainLogRateSpikes'
| 'logRateAnalysis'
| 'logPatternAnalysis'
| 'changePointDetections'
| 'modelManagement'
Expand Down
2 changes: 1 addition & 1 deletion packages/default-nav/ml/default_navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const defaultNavigation: MlNodeDefinition = {
}),
children: [
{
link: 'ml:explainLogRateSpikes',
link: 'ml:logRateAnalysis',
},
{
link: 'ml:logPatternAnalysis',
Expand Down
2 changes: 1 addition & 1 deletion packages/shared-ux/chrome/navigation/mocks/src/navlinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ const allNavLinks: AppDeepLinkId[] = [
'ml:changePointDetections',
'ml:dataFrameAnalytics',
'ml:dataVisualizer',
'ml:explainLogRateSpikes',
'ml:fileUpload',
'ml:filterListsSettings',
'ml:indexDataVisualizer',
'ml:logPatternAnalysis',
'ml:logRateAnalysis',
'ml:memoryUsage',
'ml:modelManagement',
'ml:nodes',
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion x-pack/packages/ml/agg_utils/src/type_guards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { SignificantTerm } from './types';

/**
* Type guard for a significant term.
* Note this is used as a custom type within Explain Log Rate Spikes
* Note this is used as a custom type within Log Rate Analysis
* for a p-value based variant, not a generic significant terms
* aggregation type.
* @param arg The unknown type to be evaluated
Expand Down
2 changes: 1 addition & 1 deletion x-pack/packages/ml/agg_utils/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface HistogramField {

/**
* Significant term meta data for a field/value pair.
* Note this is used as a custom type within Explain Log Rate Spikes
* Note this is used as a custom type within Log Rate Analysis
* for a p-value based variant, not a generic significant terms
* aggregation type.
*/
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/aiops/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# aiops

The plugin provides APIs and components for AIOps features, including the “Explain log rate spikes” UI, maintained by the ML team.
The plugin provides APIs and components for AIOps features, including the “Log rate analysis” UI, maintained by the ML team.

---

Expand Down
21 changes: 12 additions & 9 deletions x-pack/plugins/aiops/common/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@
*/

import type {
AiopsExplainLogRateSpikesSchema,
AiopsExplainLogRateSpikesApiAction,
} from './explain_log_rate_spikes';
AiopsLogRateAnalysisSchema,
AiopsLogRateAnalysisApiAction,
} from './log_rate_analysis';
import { streamReducer } from './stream_reducer';

export const API_ENDPOINT = {
EXPLAIN_LOG_RATE_SPIKES: '/internal/aiops/explain_log_rate_spikes',
export const AIOPS_API_ENDPOINT = {
LOG_RATE_ANALYSIS: '/internal/aiops/log_rate_analysis',
} as const;

export interface ApiExplainLogRateSpikes {
endpoint: typeof API_ENDPOINT.EXPLAIN_LOG_RATE_SPIKES;
type AiopsApiEndpointKeys = keyof typeof AIOPS_API_ENDPOINT;
export type AiopsApiEndpoint = typeof AIOPS_API_ENDPOINT[AiopsApiEndpointKeys];

export interface AiopsApiLogRateAnalysis {
endpoint: AiopsApiEndpoint;
apiVersion: string;
reducer: typeof streamReducer;
body: AiopsExplainLogRateSpikesSchema;
actions: AiopsExplainLogRateSpikesApiAction;
body: AiopsLogRateAnalysisSchema;
actions: AiopsLogRateAnalysisApiAction;
}
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export function updateLoadingStateAction(
};
}

export type AiopsExplainLogRateSpikesApiAction =
export type AiopsLogRateAnalysisApiAction =
| ApiActionAddSignificantTerms
| ApiActionAddSignificantTermsGroup
| ApiActionAddSignificantTermsHistogram
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export {
updateLoadingStateAction,
API_ACTION_NAME,
} from './actions';
export type { AiopsExplainLogRateSpikesApiAction } from './actions';
export type { AiopsLogRateAnalysisApiAction } from './actions';

export { aiopsExplainLogRateSpikesSchema } from './schema';
export type { AiopsExplainLogRateSpikesSchema } from './schema';
export { aiopsLogRateAnalysisSchema } from './schema';
export type { AiopsLogRateAnalysisSchema } from './schema';
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { schema, TypeOf } from '@kbn/config-schema';

export const aiopsExplainLogRateSpikesSchema = schema.object({
export const aiopsLogRateAnalysisSchema = schema.object({
start: schema.number(),
end: schema.number(),
searchQuery: schema.string(),
Expand Down Expand Up @@ -38,4 +38,4 @@ export const aiopsExplainLogRateSpikesSchema = schema.object({
sampleProbability: schema.maybe(schema.number()),
});

export type AiopsExplainLogRateSpikesSchema = TypeOf<typeof aiopsExplainLogRateSpikesSchema>;
export type AiopsLogRateAnalysisSchema = TypeOf<typeof aiopsLogRateAnalysisSchema>;
2 changes: 1 addition & 1 deletion x-pack/plugins/aiops/common/api/stream_reducer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
resetAllAction,
resetGroupsAction,
updateLoadingStateAction,
} from './explain_log_rate_spikes';
} from './log_rate_analysis';
import { initialState, streamReducer } from './stream_reducer';

describe('streamReducer', () => {
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/aiops/common/api/stream_reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import type { SignificantTerm, SignificantTermGroup } from '@kbn/ml-agg-utils';

import { API_ACTION_NAME, AiopsExplainLogRateSpikesApiAction } from './explain_log_rate_spikes';
import { API_ACTION_NAME, AiopsLogRateAnalysisApiAction } from './log_rate_analysis';

interface StreamState {
ccsWarning: boolean;
Expand All @@ -31,7 +31,7 @@ export const initialState: StreamState = {

export function streamReducer(
state: StreamState,
action: AiopsExplainLogRateSpikesApiAction | AiopsExplainLogRateSpikesApiAction[]
action: AiopsLogRateAnalysisApiAction | AiopsLogRateAnalysisApiAction[]
): StreamState {
if (Array.isArray(action)) {
return action.reduce(streamReducer, state);
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/aiops/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

export const SPIKE_ANALYSIS_THRESHOLD = 0.02;

// For the technical preview of Explain Log Rate Spikes we use a hard coded seed.
// For the technical preview of Log Rate Analysis we use a hard coded seed.
// In future versions we might use a user specific seed or let the user costumise it.
export const RANDOM_SAMPLER_SEED = 3867412;
6 changes: 0 additions & 6 deletions x-pack/plugins/aiops/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ export const PLUGIN_ID = 'aiops';
*/
export const PLUGIN_NAME = 'AIOps';

/**
* This is an internal hard coded feature flag so we can easily turn on/off the
* "Explain log rate spikes UI" during development until the first release.
*/
export const AIOPS_ENABLED = true;

/**
* This is an internal hard coded feature flag so we can easily turn on/off the
* "Change Point Detection UI" during development until the first release.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import type { SignificantTerm } from '@kbn/ml-agg-utils';

import type { GroupTableItem } from '../../components/spike_analysis_table/types';
import type { GroupTableItem } from '../../components/log_rate_analysis_results_table/types';

import { buildExtendedBaseFilterCriteria } from './build_extended_base_filter_criteria';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { SignificantTerm } from '@kbn/ml-agg-utils';

import { buildBaseFilterCriteria } from '@kbn/ml-query-utils';

import type { GroupTableItem } from '../../components/spike_analysis_table/types';
import type { GroupTableItem } from '../../components/log_rate_analysis_results_table/types';

/*
* Contains utility functions for building and processing queries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { i18n } from '@kbn/i18n';

export function timeSeriesDataViewWarning(
dataView: DataView,
feature: 'change_point_detection' | 'log_categorization' | 'explain_log_rate_spikes'
feature: 'change_point_detection' | 'log_categorization' | 'log_rate_analysis'
) {
if (dataView.isTimeBased()) {
return null;
Expand All @@ -29,9 +29,9 @@ export function timeSeriesDataViewWarning(
description = i18n.translate('xpack.aiops.logCategorizationTimeSeriesWarning.description', {
defaultMessage: 'Log pattern analysis only runs over time-based indices.',
});
} else if (feature === 'explain_log_rate_spikes') {
description = i18n.translate('xpack.aiops.logRateSpikesTimeSeriesWarning.description', {
defaultMessage: 'Log rate spikes only runs over time-based indices.',
} else if (feature === 'log_rate_analysis') {
description = i18n.translate('xpack.aiops.logRateAnalysisTimeSeriesWarning.description', {
defaultMessage: 'Log rate analysis only runs over time-based indices.',
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,9 @@ export const ChangePointsTable: FC<ChangePointsTableProps> = ({
})}
>
<span>
{i18n.translate(
'xpack.aiops.explainLogRateSpikes.spikeAnalysisTableGroups.pValueLabel',
{
defaultMessage: 'p-value',
}
)}
{i18n.translate('xpack.aiops.changePointDetection.pValueLabel', {
defaultMessage: 'p-value',
})}
<EuiIcon size="s" color="subdued" type="questionInCircle" className="eui-alignTop" />
</span>
</EuiToolTip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const ChartsGrid: FC<ChartsGridProps> = ({ changePoints: changePointsDict
{
title: (
<FormattedMessage
id="xpack.aiops.explainLogRateSpikes.spikeAnalysisTableGroups.pValueLabel"
id="xpack.aiops.changePointDetection.pValueLabel"
defaultMessage="p-value"
/>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const FieldFilterApplyButton: FC<FieldFilterApplyButtonProps> = ({
disabled={disabled}
>
<FormattedMessage
id="xpack.aiops.explainLogRateSpikesPage.fieldFilterApplyButtonLabel"
id="xpack.aiops.logRateAnalysis.page.fieldFilterApplyButtonLabel"
defaultMessage="Apply"
/>
</EuiButton>
Expand Down
Loading

0 comments on commit d0aa8aa

Please sign in to comment.