Skip to content

Commit ef42d3c

Browse files
authored
Merge branch 'main' into fix/edit-description-refresh
2 parents 8f3f0ce + c993ff2 commit ef42d3c

File tree

85 files changed

+1997
-875
lines changed

Some content is hidden

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

85 files changed

+1997
-875
lines changed

packages/elastic-apm-synthtrace/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
export { timerange } from './lib/timerange';
1010
export { apm } from './lib/apm';
1111
export { stackMonitoring } from './lib/stack_monitoring';
12+
export { observer } from './lib/agent_config';
1213
export { cleanWriteTargets } from './lib/utils/clean_write_targets';
1314
export { createLogger, LogLevel } from './lib/utils/create_logger';
1415

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
import { AgentConfigFields } from './agent_config_fields';
10+
import { Metricset } from '../apm/metricset';
11+
12+
export class AgentConfig extends Metricset<AgentConfigFields> {
13+
constructor() {
14+
super({
15+
'metricset.name': 'agent_config',
16+
agent_config_applied: 1,
17+
});
18+
}
19+
20+
etag(etag: string) {
21+
this.fields['labels.etag'] = etag;
22+
return this;
23+
}
24+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
import { ApmFields } from '../apm/apm_fields';
10+
11+
export type AgentConfigFields = Pick<
12+
ApmFields,
13+
| '@timestamp'
14+
| 'processor.event'
15+
| 'processor.name'
16+
| 'metricset.name'
17+
| 'observer'
18+
| 'ecs.version'
19+
| 'event.ingested'
20+
> &
21+
Partial<{
22+
'labels.etag': string;
23+
agent_config_applied: number;
24+
'event.agent_id_status': string;
25+
}>;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
export { observer } from './observer';
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
import { AgentConfigFields } from './agent_config_fields';
10+
import { AgentConfig } from './agent_config';
11+
import { Entity } from '../entity';
12+
13+
export class Observer extends Entity<AgentConfigFields> {
14+
agentConfig() {
15+
return new AgentConfig();
16+
}
17+
}
18+
19+
export function observer() {
20+
return new Observer({});
21+
}

packages/elastic-apm-synthtrace/src/lib/apm/instance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class Instance extends Entity<ApmFields> {
4545
}
4646

4747
appMetrics(metrics: ApmApplicationMetricFields) {
48-
return new Metricset({
48+
return new Metricset<ApmFields>({
4949
...this.fields,
5050
'metricset.name': 'app',
5151
...metrics,

packages/elastic-apm-synthtrace/src/lib/apm/metricset.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
*/
88

99
import { Serializable } from '../serializable';
10-
import { ApmFields } from './apm_fields';
10+
import { Fields } from '../entity';
1111

12-
export class Metricset extends Serializable<ApmFields> {
13-
constructor(fields: ApmFields) {
12+
export class Metricset<TFields extends Fields> extends Serializable<TFields> {
13+
constructor(fields: TFields) {
1414
super({
1515
'processor.event': 'metric',
1616
'processor.name': 'metric',

packages/elastic-apm-synthtrace/src/lib/stream_processor.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ export class StreamProcessor<TFields extends Fields = ApmFields> {
211211
const eventType = d.processor.event as keyof ApmElasticsearchOutputWriteTargets;
212212
let dataStream = writeTargets[eventType];
213213
if (eventType === 'metric') {
214-
if (!d.service?.name) {
214+
if (d.metricset?.name === 'agent_config') {
215+
dataStream = 'metrics-apm.internal-default';
216+
} else if (!d.service?.name) {
215217
dataStream = 'metrics-apm.app-default';
216218
} else {
217219
if (!d.transaction && !d.span) {
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
import { observer, timerange } from '../..';
10+
import { Scenario } from '../scenario';
11+
import { getLogger } from '../utils/get_common_services';
12+
import { RunOptions } from '../utils/parse_run_cli_flags';
13+
import { AgentConfigFields } from '../../lib/agent_config/agent_config_fields';
14+
15+
const scenario: Scenario<AgentConfigFields> = async (runOptions: RunOptions) => {
16+
const logger = getLogger(runOptions);
17+
18+
return {
19+
generate: ({ from, to }) => {
20+
const agentConfig = observer().agentConfig();
21+
22+
const range = timerange(from, to);
23+
return range
24+
.interval('30s')
25+
.rate(1)
26+
.generator((timestamp) => {
27+
const events = logger.perf('generating_agent_config_events', () => {
28+
return agentConfig.etag('test-etag').timestamp(timestamp);
29+
});
30+
return events;
31+
});
32+
},
33+
};
34+
};
35+
36+
export default scenario;

src/plugins/unified_search/public/actions/apply_filter_action.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import { i18n } from '@kbn/i18n';
1010
import { ThemeServiceSetup } from '@kbn/core/public';
1111
import { toMountPoint } from '@kbn/kibana-react-plugin/public';
1212
import { Action, createAction, IncompatibleActionError } from '@kbn/ui-actions-plugin/public';
13-
import { Filter, FilterManager, TimefilterContract, esFilters } from '@kbn/data-plugin/public';
13+
// for cleanup esFilters need to fix the issue https://github.com/elastic/kibana/issues/131292
14+
import { FilterManager, TimefilterContract, esFilters } from '@kbn/data-plugin/public';
15+
import type { Filter } from '@kbn/es-query';
1416
import { getOverlays, getIndexPatterns } from '../services';
1517
import { applyFiltersPopover } from '../apply_filters';
1618

0 commit comments

Comments
 (0)