Skip to content

Commit e6eeb01

Browse files
committed
Merge branch 'master' into search-session-locators
2 parents db0116f + 504896d commit e6eeb01

File tree

282 files changed

+5380
-4127
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+5380
-4127
lines changed

docs/maps/vector-layer.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ Results exceeding `index.max_result_window` are not displayed.
2727

2828
* *Show clusters when results exceed 10,000* When results exceed `index.max_result_window`, the layer uses {ref}/search-aggregations-bucket-geotilegrid-aggregation.html[GeoTile grid aggregation] to group your documents into clusters and displays metrics for each cluster. When results are less then `index.max_result_window`, the layer displays features from individual documents.
2929

30-
* *Use vector tiles.* Vector tiles partition your map into 6 to 8 tiles.
30+
* *Use vector tiles.* Vector tiles partition your map into tiles.
3131
Each tile request is limited to the `index.max_result_window` index setting.
32-
Tiles exceeding `index.max_result_window` have a visual indicator when there are too many features to display.
32+
When a tile exceeds `index.max_result_window`, results exceeding `index.max_result_window` are not contained in the tile and a dashed rectangle outlining the bounding box containing all geo values within the tile is displayed.
3333

3434
*EMS Boundaries*:: Administrative boundaries from https://www.elastic.co/elastic-maps-service[Elastic Maps Service].
3535

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
103103
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.21",
104104
"@elastic/ems-client": "7.16.0",
105-
"@elastic/eui": "39.1.1",
105+
"@elastic/eui": "40.0.0",
106106
"@elastic/filesaver": "1.1.2",
107107
"@elastic/maki": "6.3.0",
108108
"@elastic/node-crypto": "1.2.1",
@@ -166,7 +166,6 @@
166166
"@mapbox/geojson-rewind": "^0.5.0",
167167
"@mapbox/mapbox-gl-draw": "1.3.0",
168168
"@mapbox/mapbox-gl-rtl-text": "0.2.3",
169-
"@mapbox/vector-tile": "1.3.1",
170169
"@reduxjs/toolkit": "^1.6.1",
171170
"@slack/webhook": "^5.0.4",
172171
"@turf/along": "6.0.1",
@@ -460,6 +459,7 @@
460459
"@kbn/test": "link:bazel-bin/packages/kbn-test",
461460
"@kbn/test-subj-selector": "link:bazel-bin/packages/kbn-test-subj-selector",
462461
"@loaders.gl/polyfills": "^2.3.5",
462+
"@mapbox/vector-tile": "1.3.1",
463463
"@microsoft/api-documenter": "7.7.2",
464464
"@microsoft/api-extractor": "7.7.0",
465465
"@octokit/rest": "^16.35.0",
@@ -743,7 +743,7 @@
743743
"jsondiffpatch": "0.4.1",
744744
"license-checker": "^16.0.0",
745745
"listr": "^0.14.1",
746-
"lmdb-store": "^1.6.8",
746+
"lmdb-store": "^1.6.11",
747747
"marge": "^1.0.1",
748748
"micromatch": "3.1.10",
749749
"minimist": "^1.2.5",

packages/elastic-apm-generator/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ NPM_MODULE_EXTRA_FILES = [
2525
]
2626

2727
RUNTIME_DEPS = [
28+
"//packages/elastic-datemath",
2829
"@npm//@elastic/elasticsearch",
2930
"@npm//lodash",
3031
"@npm//moment",
@@ -36,6 +37,7 @@ RUNTIME_DEPS = [
3637
]
3738

3839
TYPES_DEPS = [
40+
"//packages/elastic-datemath",
3941
"@npm//@elastic/elasticsearch",
4042
"@npm//moment",
4143
"@npm//p-limit",

packages/elastic-apm-generator/README.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This section assumes that you've installed Kibana's dependencies by running `yar
1111
This library can currently be used in two ways:
1212

1313
- Imported as a Node.js module, for instance to be used in Kibana's functional test suite.
14-
- With a command line interface, to index data based on some example scenarios.
14+
- With a command line interface, to index data based on a specified scenario.
1515

1616
### Using the Node.js module
1717

@@ -32,7 +32,7 @@ const instance = service('synth-go', 'production', 'go')
3232
.instance('instance-a');
3333

3434
const from = new Date('2021-01-01T12:00:00.000Z').getTime();
35-
const to = new Date('2021-01-01T12:00:00.000Z').getTime() - 1;
35+
const to = new Date('2021-01-01T12:00:00.000Z').getTime();
3636

3737
const traceEvents = timerange(from, to)
3838
.interval('1m')
@@ -82,12 +82,26 @@ const esEvents = toElasticsearchOutput([
8282

8383
### CLI
8484

85-
Via the CLI, you can upload examples. The supported examples are listed in `src/lib/es.ts`. A `--target` option that specifies the Elasticsearch URL should be defined when running the `example` command. Here's an example:
85+
Via the CLI, you can upload scenarios, either using a fixed time range or continuously generating data. Some examples are available in in `src/scripts/examples`. Here's an example for live data:
8686

87-
`$ node packages/elastic-apm-generator/src/scripts/es.js example simple-trace --target=http://admin:changeme@localhost:9200`
87+
`$ node packages/elastic-apm-generator/src/scripts/run packages/elastic-apm-generator/src/examples/01_simple_trace.ts --target=http://admin:changeme@localhost:9200 --live`
88+
89+
For a fixed time window:
90+
`$ node packages/elastic-apm-generator/src/scripts/run packages/elastic-apm-generator/src/examples/01_simple_trace.ts --target=http://admin:changeme@localhost:9200 --from=now-24h --to=now`
91+
92+
The script will try to automatically find bootstrapped APM indices. __If these indices do not exist, the script will exit with an error. It will not bootstrap the indices itself.__
8893

8994
The following options are supported:
90-
- `to`: the end of the time range, in ISO format. By default, the current time will be used.
91-
- `from`: the start of the time range, in ISO format. By default, `to` minus 15 minutes will be used.
92-
- `apm-server-version`: the version used in the index names bootstrapped by APM Server, e.g. `7.16.0`. __If these indices do not exist, the script will exit with an error. It will not bootstrap the indices itself.__
95+
| Option | Description | Default |
96+
| -------------- | ------------------------------------------------------- | ------------ |
97+
| `--from` | The start of the time window. | `now - 15m` |
98+
| `--to` | The end of the time window. | `now` |
99+
| `--live` | Continously ingest data | `false` |
100+
| `--bucketSize` | Size of bucket for which to generate data. | `15m` |
101+
| `--clean` | Clean APM indices before indexing new data. | `false` |
102+
| `--interval` | The interval at which to index data. | `10s` |
103+
| `--logLevel` | Log level. | `info` |
104+
| `--lookback` | The lookback window for which data should be generated. | `15m` |
105+
| `--target` | Elasticsearch target, including username/password. | **Required** |
106+
| `--workers` | Amount of simultaneously connected ES clients. | `1` |
93107

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
module.exports = {
10+
rules: {
11+
'import/no-default-export': 'off',
12+
},
13+
};

packages/elastic-apm-generator/src/lib/interval.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class Interval {
2121
throw new Error('Failed to parse interval');
2222
}
2323
const timestamps: number[] = [];
24-
while (now <= this.to) {
24+
while (now < this.to) {
2525
timestamps.push(...new Array<number>(rate).fill(now));
2626
now = moment(now)
2727
.add(Number(args[1]), args[2] as any)

packages/elastic-apm-generator/src/lib/output/to_elasticsearch_output.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,25 @@ import { set } from 'lodash';
1010
import { getObserverDefaults } from '../..';
1111
import { Fields } from '../entity';
1212

13-
export function toElasticsearchOutput(events: Fields[], versionOverride?: string) {
13+
export interface ElasticsearchOutput {
14+
_index: string;
15+
_source: unknown;
16+
}
17+
18+
export interface ElasticsearchOutputWriteTargets {
19+
transaction: string;
20+
span: string;
21+
error: string;
22+
metric: string;
23+
}
24+
25+
export function toElasticsearchOutput({
26+
events,
27+
writeTargets,
28+
}: {
29+
events: Fields[];
30+
writeTargets: ElasticsearchOutputWriteTargets;
31+
}): ElasticsearchOutput[] {
1432
return events.map((event) => {
1533
const values = {
1634
...event,
@@ -29,7 +47,7 @@ export function toElasticsearchOutput(events: Fields[], versionOverride?: string
2947
set(document, key, val);
3048
}
3149
return {
32-
_index: `apm-${versionOverride || values['observer.version']}-${values['processor.event']}`,
50+
_index: writeTargets[event['processor.event'] as keyof ElasticsearchOutputWriteTargets],
3351
_source: document,
3452
};
3553
});

packages/elastic-apm-generator/src/scripts/es.ts

Lines changed: 0 additions & 113 deletions
This file was deleted.

packages/elastic-apm-generator/src/scripts/examples/01_simple_trace.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
import { service, timerange, getTransactionMetrics, getSpanDestinationMetrics } from '../..';
1010
import { getBreakdownMetrics } from '../../lib/utils/get_breakdown_metrics';
1111

12-
export function simpleTrace(from: number, to: number) {
12+
export default function ({ from, to }: { from: number; to: number }) {
1313
const instance = service('opbeans-go', 'production', 'go').instance('instance');
1414

1515
const range = timerange(from, to);
1616

17-
const transactionName = '240rpm/60% 1000ms';
17+
const transactionName = '240rpm/75% 1000ms';
1818

1919
const successfulTraceEvents = range
2020
.interval('1s')

packages/elastic-apm-generator/src/scripts/es.js renamed to packages/elastic-apm-generator/src/scripts/run.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ require('@babel/register')({
1212
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'],
1313
});
1414

15-
require('./es.ts');
15+
require('./run.ts');

0 commit comments

Comments
 (0)