Skip to content

Commit

Permalink
Merge branch 'main' into alerts/new_terms_perfromance_improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliidm authored Nov 16, 2022
2 parents 5b95dd9 + 6cd5d3d commit 7516076
Show file tree
Hide file tree
Showing 105 changed files with 3,205 additions and 1,082 deletions.
7 changes: 3 additions & 4 deletions docs/user/alerting/alerting-troubleshooting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,11 @@ The result of this HTTP request (and printed to stdout by https://github.com/pmu
[[alerting-error-banners]]
=== Look for error banners

The *Rule Management* and *Rule Details* pages contain an error banner, which helps to identify the errors for the rules:
[role="screenshot"]
image::images/rules-management-health.png[Rule management page with the errors banner]
The **{stack-manage-app}** > *{rules-ui}* page contains an error banner that
helps to identify the errors for the rules:

[role="screenshot"]
image::images/rules-details-health.png[Rule details page with the errors banner]
image::images/rules-management-health.png[Rule management page with the errors banner]

[float]
[[task-manager-diagnostics]]
Expand Down
Binary file removed docs/user/alerting/images/rules-details-health.png
Binary file not shown.
Binary file modified docs/user/alerting/images/rules-management-health.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion examples/field_formats_example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
Expand Down
2 changes: 1 addition & 1 deletion examples/files_example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target/types"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_world/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target/types"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/partial_results_example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/src/worker/bundle_metrics_plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class BundleMetricsPlugin {
id: bundle.id,
value: entry.size,
limit: bundle.pageLoadAssetSizeLimit,
limitConfigPath: `node_modules/@kbn/optimizer/limits.yml`,
limitConfigPath: `packages/kbn-optimizer/limits.yml`,
},
{
group: `async chunks size`,
Expand Down
4 changes: 4 additions & 0 deletions src/dev/typescript/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,8 @@ export class Project {
? [this.tsConfigPath, ...this.baseProject.getConfigPaths()]
: [this.tsConfigPath];
}

public getProjectsDeep(): Project[] {
return this.baseProject ? [this, ...this.baseProject.getProjectsDeep()] : [this];
}
}
20 changes: 20 additions & 0 deletions src/dev/typescript/run_check_ts_projects_cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { run } from '@kbn/dev-cli-runner';
import { asyncMapWithLimit } from '@kbn/std';
import { createFailError } from '@kbn/dev-cli-errors';
import { getRepoFiles } from '@kbn/get-repo-files';
import { REPO_ROOT } from '@kbn/utils';
import globby from 'globby';

import { File } from '../file';
Expand All @@ -37,6 +38,25 @@ export async function runCheckTsProjectsCli() {
const stats = new Stats();
let failed = false;

const everyProjectDeep = new Set(PROJECTS.flatMap((p) => p.getProjectsDeep()));
for (const proj of everyProjectDeep) {
const [, ...baseConfigRels] = proj.getConfigPaths().map((p) => Path.relative(REPO_ROOT, p));
const configRel = Path.relative(REPO_ROOT, proj.tsConfigPath);

if (baseConfigRels[0] === 'tsconfig.json') {
failed = true;
log.error(
`[${configRel}]: This tsconfig extends the root tsconfig.json file and shouldn't. The root tsconfig.json file is not a valid base config, you probably want to point to the tsconfig.base.json file.`
);
}
if (configRel !== 'tsconfig.base.json' && !baseConfigRels.includes('tsconfig.base.json')) {
failed = true;
log.error(
`[${configRel}]: This tsconfig does not extend the tsconfig.base.json file either directly or indirectly. The TS config setup for the repo expects every tsconfig file to extend this base config file.`
);
}
}

const pathsAndProjects = await asyncMapWithLimit(PROJECTS, 5, async (proj) => {
const paths = await globby(proj.getIncludePatterns(), {
ignore: proj.getExcludePatterns(),
Expand Down
72 changes: 72 additions & 0 deletions x-pack/plugins/apm/common/__snapshots__/apm_telemetry.test.ts.snap

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

Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ export function IconPopover({
ownFocus={false}
button={
<StyledButtonIcon
display="fill"
color="ghost"
color="text"
onClick={onClick}
iconType={icon.type}
iconSize={icon.size ?? 'l'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,38 +383,60 @@ describe('data telemetry collection tasks', () => {
const task = tasks.find((t) => t.name === 'indices_stats');

it('returns a map of index stats', async () => {
const indicesStats = jest.fn().mockResolvedValueOnce({
const indicesStats = jest.fn().mockResolvedValue({
_all: { total: { docs: { count: 1 }, store: { size_in_bytes: 1 } } },
_shards: { total: 1 },
});

const statsResponse = {
shards: {
total: 1,
},
all: {
total: {
docs: {
count: 1,
},
store: {
size_in_bytes: 1,
},
},
},
};

expect(
await task?.executor({
indices,
telemetryClient: { indicesStats },
} as any)
).toEqual({
indices: {
...statsResponse,
metric: statsResponse,
traces: statsResponse,
},
});
});

describe('with no results', () => {
it('returns zero values', async () => {
const indicesStats = jest.fn().mockResolvedValue({});

const statsResponse = {
shards: {
total: 1,
total: 0,
},
all: {
total: {
docs: {
count: 1,
count: 0,
},
store: {
size_in_bytes: 1,
size_in_bytes: 0,
},
},
},
},
});
});

describe('with no results', () => {
it('returns zero values', async () => {
const indicesStats = jest.fn().mockResolvedValueOnce({});
};

expect(
await task?.executor({
Expand All @@ -423,19 +445,9 @@ describe('data telemetry collection tasks', () => {
} as any)
).toEqual({
indices: {
shards: {
total: 0,
},
all: {
total: {
docs: {
count: 0,
},
store: {
size_in_bytes: 0,
},
},
},
...statsResponse,
metric: statsResponse,
traces: statsResponse,
},
});
});
Expand Down
Loading

0 comments on commit 7516076

Please sign in to comment.