Skip to content

Commit

Permalink
Merge branch 'main' into guided_onboarding/8.8/change_api_prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliacech authored Apr 25, 2023
2 parents 1e4c7d7 + ecc54af commit 51c4005
Show file tree
Hide file tree
Showing 258 changed files with 10,371 additions and 2,125 deletions.

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 @@ -47,6 +47,8 @@ export const REMOVED_TYPES: string[] = [
'csp_rule',
// Removed in 8.8 https://github.com/elastic/kibana/pull/151116
'upgrade-assistant-telemetry',
// Removed in 8.8 https://github.com/elastic/kibana/pull/155204
'endpoint:user-artifact',
].sort();

export const excludeUnusedTypesQuery: QueryDslQueryContainer = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ describe('createInitialState', () => {
"type": "csp_rule",
},
},
Object {
"term": Object {
"type": "endpoint:user-artifact",
},
},
Object {
"term": Object {
"type": "file-upload-telemetry",
Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-apm-synthtrace-client/src/lib/apm/apm_fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export type ApmApplicationMetricFields = Partial<{
'faas.timeout': number;
'faas.coldstart_duration': number;
'faas.duration': number;
'application.launch.time': number;
}>;

export type ApmUserAgentFields = Partial<{
Expand Down Expand Up @@ -88,6 +89,7 @@ export type ApmFields = Fields<{
'error.grouping_key': string;
'error.grouping_name': string;
'error.id': string;
'error.type': string;
'event.ingested': number;
'event.name': string;
'event.outcome': string;
Expand Down
22 changes: 21 additions & 1 deletion packages/kbn-apm-synthtrace-client/src/lib/apm/mobile_device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
import { Entity } from '../entity';
import { Span } from './span';
import { Transaction } from './transaction';
import { ApmFields, SpanParams, GeoLocation } from './apm_fields';
import { ApmFields, SpanParams, GeoLocation, ApmApplicationMetricFields } from './apm_fields';
import { generateLongId } from '../utils/generate_id';
import { Metricset } from './metricset';
import { ApmError } from './apm_error';

export interface DeviceInfo {
manufacturer: string;
Expand Down Expand Up @@ -115,6 +117,7 @@ export class MobileDevice extends Entity<ApmFields> {
return this;
}

// FIXME synthtrace shouldn't have side-effects like this. We should use an API like .session() which returns a session
startNewSession() {
this.fields['session.id'] = generateLongId();
return this;
Expand Down Expand Up @@ -238,4 +241,21 @@ export class MobileDevice extends Entity<ApmFields> {

return this.span(spanParameters);
}

appMetrics(metrics: ApmApplicationMetricFields) {
return new Metricset<ApmFields>({
...this.fields,
'metricset.name': 'app',
...metrics,
});
}

crash({ message, groupingName }: { message: string; groupingName?: string }) {
return new ApmError({
...this.fields,
'error.type': 'crash',
'error.exception': [{ message, ...{ type: 'crash' } }],
'error.grouping_name': groupingName || message,
});
}
}
88 changes: 60 additions & 28 deletions packages/kbn-apm-synthtrace/src/scenarios/mobile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ const ENVIRONMENT = getSynthtraceEnvironment(__filename);

type DeviceMetadata = DeviceInfo & OSInfo;

const modelIdentifiersWithCrashes = [
'SM-G930F',
'HUAWEI P2-0000',
'Pixel 3a',
'LG K10',
'iPhone11,8',
'Watch6,8',
'iPad12,2',
];

const ANDROID_DEVICES: DeviceMetadata[] = [
{
manufacturer: 'Samsung',
Expand Down Expand Up @@ -354,34 +364,40 @@ const scenario: Scenario<ApmFields> = async ({ scenarioOpts, logger }) => {
device.startNewSession();
const framework =
device.fields['device.manufacturer'] === 'Apple' ? 'iOS' : 'Android Activity';
const couldCrash = modelIdentifiersWithCrashes.includes(
device.fields['device.model.identifier'] ?? ''
);
const startTx = device
.transaction('Start View - View Appearing', framework)
.timestamp(timestamp)
.duration(500)
.success()
.children(
device
.span({
spanName: 'onCreate',
spanType: 'app',
spanSubtype: 'external',
'service.target.type': 'http',
'span.destination.service.resource': 'external',
})
.duration(50)
.success()
.timestamp(timestamp + 20),
device
.httpSpan({
spanName: 'GET backend:1234',
httpMethod: 'GET',
httpUrl: 'https://backend:1234/api/start',
})
.duration(800)
.failure()
.timestamp(timestamp + 400)
);
return [
device
.transaction('Start View - View Appearing', framework)
.timestamp(timestamp)
.duration(500)
.success()
.children(
device
.span({
spanName: 'onCreate',
spanType: 'app',
spanSubtype: 'external',
'service.target.type': 'http',
'span.destination.service.resource': 'external',
})
.duration(50)
.success()
.timestamp(timestamp + 20),
device
.httpSpan({
spanName: 'GET backend:1234',
httpMethod: 'GET',
httpUrl: 'https://backend:1234/api/start',
})
.duration(800)
.failure()
.timestamp(timestamp + 400)
),
couldCrash && index % 2 === 0
? startTx.errors(device.crash({ message: 'error' }).timestamp(timestamp))
: startTx,
device
.transaction('Second View - View Appearing', framework)
.timestamp(10000 + timestamp)
Expand Down Expand Up @@ -418,7 +434,23 @@ const scenario: Scenario<ApmFields> = async ({ scenarioOpts, logger }) => {
});
};

return [...androidDevices, ...iOSDevices].map((device) => sessionTransactions(device));
const appLaunchMetrics = (device: MobileDevice) => {
return clickRate.generator((timestamp, index) =>
device
.appMetrics({
'application.launch.time': 100 * (index + 1),
})
.timestamp(timestamp)
);
};

return [
...androidDevices.flatMap((device) => [
sessionTransactions(device),
appLaunchMetrics(device),
]),
...iOSDevices.map((device) => sessionTransactions(device)),
];
},
};
};
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-doc-links/src/get_doc_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => {
dashboardSettings: `${KIBANA_DOCS}advanced-options.html#kibana-dashboard-settings`,
indexManagement: `${ELASTICSEARCH_DOCS}index-mgmt.html`,
kibanaSearchSettings: `${KIBANA_DOCS}advanced-options.html#kibana-search-settings`,
discoverSettings: `${KIBANA_DOCS}advanced-options.html#kibana-discover-settings`,
visualizationSettings: `${KIBANA_DOCS}advanced-options.html#kibana-visualization-settings`,
timelionSettings: `${KIBANA_DOCS}advanced-options.html#kibana-timelion-settings`,
savedObjectsApiList: `${KIBANA_DOCS}saved-objects-api.html#saved-objects-api`,
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-rule-data-utils/src/default_alerts_as_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const ALERT_RULE_TAGS = `${ALERT_RULE_NAMESPACE}.tags` as const;
// kibana.alert.rule_type_id - rule type id for rule that generated this alert
const ALERT_RULE_TYPE_ID = `${ALERT_RULE_NAMESPACE}.rule_type_id` as const;

// kibana.alert.url - allow our user to go back to the details url in kibana
// kibana.alert.url - url which will redirect users to a page related to the given alert
const ALERT_URL = `${ALERT_NAMESPACE}.url` as const;

// kibana.alert.rule.uuid - rule ID for rule that generated this alert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"core-usage-stats": "b3c04da317c957741ebcdedfea4524049fdc79ff",
"csp-rule-template": "099c229bf97578d9ca72b3a672d397559b84ee0b",
"dashboard": "71e3f8dfcffeb5fbd410dec81ce46f5691763c43",
"endpoint:user-artifact": "a5b154962fb6cdf5d9e7452e58690054c95cc72a",
"endpoint:user-artifact-manifest": "5989989c0f84dd2d02da1eb46b6254e334bd2ccd",
"endpoint:user-artifact-manifest": "8ad9bd235dcfdc18b567aef0dc36ac686193dc89",
"enterprise_search_telemetry": "4b41830e3b28a16eb92dee0736b44ae6276ced9b",
"epm-packages": "8755f947a00613f994b1bc5d5580e104043e27f6",
"epm-packages-assets": "00c8b5e5bf059627ffc9fbde920e1ac75926c5f6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ describe('split .kibana index into multiple system indices', () => {
"connector_token",
"core-usage-stats",
"csp-rule-template",
"endpoint:user-artifact",
"endpoint:user-artifact-manifest",
"enterprise_search_telemetry",
"epm-packages",
Expand Down
6 changes: 6 additions & 0 deletions src/plugins/discover/server/ui_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ export const getUiSettings: (docLinks: DocLinksServiceSetup) => Record<string, U
}),
category: ['discover'],
schema: schema.boolean(),
deprecation: {
message: i18n.translate('discover.advancedSettings.showLegacyFieldStatsTextDeprecation', {
defaultMessage: 'This setting is deprecated and will not be supported in a future version.',
}),
docLinksKey: 'discoverSettings',
},
},
[DOC_HIDE_TIME_COLUMN_SETTING]: {
name: i18n.translate('discover.advancedSettings.docTableHideTimeColumnTitle', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
],
".kibana_security_solution": [
"csp-rule-template",
"endpoint:user-artifact",
"endpoint:user-artifact-manifest",
"exception-list",
"exception-list-agnostic",
Expand Down Expand Up @@ -750,7 +749,6 @@
],
".kibana_security_solution": [
"csp-rule-template",
"endpoint:user-artifact",
"endpoint:user-artifact-manifest",
"exception-list",
"exception-list-agnostic",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
],
".kibana_security_solution": [
"csp-rule-template",
"endpoint:user-artifact",
"endpoint:user-artifact-manifest",
"exception-list",
"exception-list-agnostic",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
],
".kibana_security_solution": [
"csp-rule-template",
"endpoint:user-artifact",
"endpoint:user-artifact-manifest",
"exception-list",
"exception-list-agnostic",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
],
".kibana_security_solution": [
"csp-rule-template",
"endpoint:user-artifact",
"endpoint:user-artifact-manifest",
"exception-list",
"exception-list-agnostic",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
],
".kibana_security_solution": [
"csp-rule-template",
"endpoint:user-artifact",
"endpoint:user-artifact-manifest",
"exception-list",
"exception-list-agnostic",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
],
".kibana_security_solution": [
"csp-rule-template",
"endpoint:user-artifact",
"endpoint:user-artifact-manifest",
"exception-list",
"exception-list-agnostic",
Expand Down Expand Up @@ -696,7 +695,6 @@
],
".kibana_security_solution": [
"csp-rule-template",
"endpoint:user-artifact",
"endpoint:user-artifact-manifest",
"exception-list",
"exception-list-agnostic",
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugins/apm/common/data_source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ type AnyApmDocumentType =
| ApmDocumentType.TransactionMetric
| ApmDocumentType.TransactionEvent
| ApmDocumentType.ServiceDestinationMetric
| ApmDocumentType.ServiceSummaryMetric;
| ApmDocumentType.ServiceSummaryMetric
| ApmDocumentType.ErrorEvent;

export interface ApmDataSource<
TDocumentType extends AnyApmDocumentType = AnyApmDocumentType
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/apm/common/document_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export enum ApmDocumentType {
TransactionEvent = 'transactionEvent',
ServiceDestinationMetric = 'serviceDestinationMetric',
ServiceSummaryMetric = 'serviceSummaryMetric',
ErrorEvent = 'error',
}

export type ApmServiceTransactionDocumentType =
Expand Down
Loading

0 comments on commit 51c4005

Please sign in to comment.