Skip to content

Commit 24ce1c0

Browse files
Merge branch 'master' into nls/tpr_url_forwarding
2 parents ad99ae8 + 8c07eb9 commit 24ce1c0

File tree

455 files changed

+5241
-3332
lines changed

Some content is hidden

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

455 files changed

+5241
-3332
lines changed
Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
---
2-
name: Bug report for Security Solution
3-
about: Help us identify bugs in Elastic Security, SIEM, and Endpoint so we can fix them!
4-
title: '[Security Solution]'
5-
labels: 'Team: SecuritySolution'
6-
---
7-
8-
**Describe the bug:**
9-
10-
**Kibana/Elasticsearch Stack version:**
11-
12-
**Server OS version:**
13-
14-
**Browser and Browser OS versions:**
15-
16-
**Elastic Endpoint version:**
17-
18-
**Original install method (e.g. download page, yum, from source, etc.):**
19-
20-
**Functional Area (e.g. Endpoint management, timelines, resolver, etc.):**
21-
22-
**Steps to reproduce:**
23-
24-
1.
25-
2.
26-
3.
27-
28-
**Current behavior:**
29-
30-
**Expected behavior:**
31-
32-
**Screenshots (if relevant):**
33-
34-
**Errors in browser console (if relevant):**
35-
36-
**Provide logs and/or server output (if relevant):**
37-
38-
**Any additional context (logs, chat logs, magical formulas, etc.):**
1+
---
2+
name: Bug report for Security Solution
3+
about: Help us identify bugs in Elastic Security, SIEM, and Endpoint so we can fix them!
4+
title: '[Security Solution]'
5+
labels: 'bug, Team: SecuritySolution'
6+
---
7+
8+
**Describe the bug:**
9+
10+
**Kibana/Elasticsearch Stack version:**
11+
12+
**Server OS version:**
13+
14+
**Browser and Browser OS versions:**
15+
16+
**Elastic Endpoint version:**
17+
18+
**Original install method (e.g. download page, yum, from source, etc.):**
19+
20+
**Functional Area (e.g. Endpoint management, timelines, resolver, etc.):**
21+
22+
**Steps to reproduce:**
23+
24+
1.
25+
2.
26+
3.
27+
28+
**Current behavior:**
29+
30+
**Expected behavior:**
31+
32+
**Screenshots (if relevant):**
33+
34+
**Errors in browser console (if relevant):**
35+
36+
**Provide logs and/or server output (if relevant):**
37+
38+
**Any additional context (logs, chat logs, magical formulas, etc.):**

.github/ISSUE_TEMPLATE/v8_breaking_change.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: 8.0 Breaking change
33
about: Breaking changes from 7.x -> 8.0
44
title: "[Breaking change]"
5-
labels: Team:Elasticsearch UI, Feature:Upgrade Assistant
5+
labels: Team:Elasticsearch UI, Feature:Upgrade Assistant, Breaking Change
66
assignees: ''
77

88
---
@@ -11,15 +11,16 @@ assignees: ''
1111

1212
**Which release will ship the breaking change?**
1313

14-
<!-- e.g., v7.6.2 -->
14+
8.0
1515

1616
**Describe the change. How will it manifest to users?**
1717

18-
**What percentage of users will be affected?**
18+
**How many users will be affected?**
1919

20-
<!-- e.g., Roughly 75% will need to make changes to x. -->
20+
<!-- e.g., Based on telemetry data, roughly 75% of our users will need to make changes to x -->
21+
<!-- e.g., A majority of users will need to make changes to x. -->
2122

22-
**What can users to do to address the change manually?**
23+
**What can users do to address the change manually?**
2324

2425
<!-- If applicable, describe the manual workaround -->
2526

packages/kbn-apm-config-loader/src/config.test.ts

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import {
2828

2929
import { ApmConfiguration } from './config';
3030

31+
const initialEnv = { ...process.env };
32+
3133
describe('ApmConfiguration', () => {
3234
beforeEach(() => {
3335
packageMock.raw = {
@@ -39,6 +41,7 @@ describe('ApmConfiguration', () => {
3941
});
4042

4143
afterEach(() => {
44+
process.env = { ...initialEnv };
4245
resetAllMocks();
4346
});
4447

@@ -90,13 +93,16 @@ describe('ApmConfiguration', () => {
9093
let config = new ApmConfiguration(mockedRootDir, {}, false);
9194
expect(config.getConfig('serviceName')).toEqual(
9295
expect.objectContaining({
93-
serverUrl: expect.any(String),
94-
secretToken: expect.any(String),
96+
breakdownMetrics: true,
9597
})
9698
);
9799

98100
config = new ApmConfiguration(mockedRootDir, {}, true);
99-
expect(Object.keys(config.getConfig('serviceName'))).not.toContain('serverUrl');
101+
expect(config.getConfig('serviceName')).toEqual(
102+
expect.objectContaining({
103+
breakdownMetrics: false,
104+
})
105+
);
100106
});
101107

102108
it('loads the configuration from the kibana config file', () => {
@@ -156,4 +162,32 @@ describe('ApmConfiguration', () => {
156162
})
157163
);
158164
});
165+
166+
it('correctly sets environment', () => {
167+
delete process.env.ELASTIC_APM_ENVIRONMENT;
168+
delete process.env.NODE_ENV;
169+
170+
let config = new ApmConfiguration(mockedRootDir, {}, false);
171+
expect(config.getConfig('serviceName')).toEqual(
172+
expect.objectContaining({
173+
environment: 'development',
174+
})
175+
);
176+
177+
process.env.NODE_ENV = 'production';
178+
config = new ApmConfiguration(mockedRootDir, {}, false);
179+
expect(config.getConfig('serviceName')).toEqual(
180+
expect.objectContaining({
181+
environment: 'production',
182+
})
183+
);
184+
185+
process.env.ELASTIC_APM_ENVIRONMENT = 'ci';
186+
config = new ApmConfiguration(mockedRootDir, {}, false);
187+
expect(config.getConfig('serviceName')).toEqual(
188+
expect.objectContaining({
189+
environment: 'ci',
190+
})
191+
);
192+
});
159193
});

packages/kbn-apm-config-loader/src/config.ts

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,26 @@ import { readFileSync } from 'fs';
2626
import { ApmAgentConfig } from './types';
2727

2828
const getDefaultConfig = (isDistributable: boolean): ApmAgentConfig => {
29-
if (isDistributable) {
30-
return {
31-
active: false,
32-
globalLabels: {},
33-
// Do not use a centralized controlled config
34-
centralConfig: false,
35-
// Capture all exceptions that are not caught
36-
logUncaughtExceptions: true,
37-
// Can be performance intensive, disabling by default
38-
breakdownMetrics: false,
39-
};
40-
}
41-
29+
// https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html
4230
return {
43-
active: false,
44-
serverUrl: 'https://f1542b814f674090afd914960583265f.apm.us-central1.gcp.cloud.es.io:443',
31+
active: process.env.ELASTIC_APM_ACTIVE || false,
32+
environment: process.env.ELASTIC_APM_ENVIRONMENT || process.env.NODE_ENV || 'development',
33+
34+
serverUrl: 'https://b1e3b4b4233e44cdad468c127d0af8d8.apm.europe-west1.gcp.cloud.es.io:443',
35+
4536
// The secretToken below is intended to be hardcoded in this file even though
4637
// it makes it public. This is not a security/privacy issue. Normally we'd
4738
// instead disable the need for a secretToken in the APM Server config where
4839
// the data is transmitted to, but due to how it's being hosted, it's easier,
4940
// for now, to simply leave it in.
50-
secretToken: 'R0Gjg46pE9K9wGestd',
41+
secretToken: '2OyjjaI6RVkzx2O5CV',
42+
43+
logUncaughtExceptions: true,
5144
globalLabels: {},
52-
breakdownMetrics: true,
5345
centralConfig: false,
54-
logUncaughtExceptions: true,
46+
47+
// Can be performance intensive, disabling by default
48+
breakdownMetrics: isDistributable ? false : true,
5549
};
5650
};
5751

@@ -84,7 +78,8 @@ export class ApmConfiguration {
8478
getDefaultConfig(this.isDistributable),
8579
this.getConfigFromKibanaConfig(),
8680
this.getDevConfig(),
87-
this.getDistConfig()
81+
this.getDistConfig(),
82+
this.getCIConfig()
8883
);
8984

9085
const rev = this.getGitRev();
@@ -146,6 +141,21 @@ export class ApmConfiguration {
146141
};
147142
}
148143

144+
private getCIConfig(): ApmAgentConfig {
145+
if (process.env.ELASTIC_APM_ENVIRONMENT !== 'ci') {
146+
return {};
147+
}
148+
149+
return {
150+
globalLabels: {
151+
branch: process.env.ghprbSourceBranch || '',
152+
targetBranch: process.env.ghprbTargetBranch || '',
153+
ciJobName: process.env.JOB_NAME || '',
154+
ciBuildNumber: process.env.BUILD_NUMBER || '',
155+
},
156+
};
157+
}
158+
149159
private getGitRev() {
150160
if (this.isDistributable) {
151161
return this.pkgBuild.sha;

packages/kbn-optimizer/src/cli.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,11 @@ run(
146146
await lastValueFrom(update$.pipe(logOptimizerState(log, config)));
147147

148148
if (updateLimits) {
149-
updateBundleLimits(log, config);
149+
updateBundleLimits({
150+
log,
151+
config,
152+
dropMissing: !(focus || filter),
153+
});
150154
}
151155
},
152156
{

packages/kbn-optimizer/src/limits.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,18 @@ export function validateLimitsForAllBundles(log: ToolingLog, config: OptimizerCo
7979
log.success('limits.yml file valid');
8080
}
8181

82-
export function updateBundleLimits(log: ToolingLog, config: OptimizerConfig) {
82+
interface UpdateBundleLimitsOptions {
83+
log: ToolingLog;
84+
config: OptimizerConfig;
85+
dropMissing: boolean;
86+
}
87+
88+
export function updateBundleLimits({ log, config, dropMissing }: UpdateBundleLimitsOptions) {
8389
const metrics = getMetrics(log, config);
8490

85-
const pageLoadAssetSize: NonNullable<Limits['pageLoadAssetSize']> = {};
91+
const pageLoadAssetSize: NonNullable<Limits['pageLoadAssetSize']> = dropMissing
92+
? {}
93+
: config.limits.pageLoadAssetSize ?? {};
8694

8795
for (const metric of metrics.sort((a, b) => a.id.localeCompare(b.id))) {
8896
if (metric.group === 'page load bundle size') {

src/dev/ci_setup/setup_env.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export NODE_OPTIONS="$NODE_OPTIONS --max-old-space-size=4096"
2424
###
2525
export FORCE_COLOR=1
2626

27+
### APM tracking
28+
###
29+
export ELASTIC_APM_ENVIRONMENT=ci
30+
2731
###
2832
### check that we seem to be in a kibana project
2933
###

src/plugins/discover/public/application/angular/context_app.html

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
>
1111
</kbn-top-nav>
1212

13-
1413
<!-- Error feedback -->
1514
<context-error-message
1615
status="contextApp.state.loadingStatus.anchor.status"
@@ -21,43 +20,23 @@
2120
class="kuiViewContent kuiViewContentItem"
2221
ng-if="contextApp.state.loadingStatus.anchor.status !== contextApp.constants.LOADING_STATUS.FAILED"
2322
>
24-
<!-- Controls -->
25-
<context-action-bar
26-
default-step-size="contextApp.state.queryParameters.defaultStepSize"
27-
doc-count="contextApp.state.queryParameters.predecessorCount"
28-
doc-count-available="contextApp.state.rows.predecessors.length"
29-
is-disabled="contextApp.state.loadingStatus.anchor.status !== contextApp.constants.LOADING_STATUS.LOADED"
30-
is-loading="![
31-
contextApp.constants.LOADING_STATUS.LOADED,
32-
contextApp.constants.LOADING_STATUS.FAILED,
33-
].includes(contextApp.state.loadingStatus.predecessors.status)"
34-
on-change-count="contextApp.actions.fetchGivenPredecessorRows"
35-
type="'predecessors'"
36-
></context-action-bar>
37-
3823
<!-- Table -->
3924
<context-app-legacy
4025
filter="contextApp.actions.addFilter"
4126
hits="contextApp.state.rows.all"
4227
index-pattern="contextApp.indexPattern"
4328
sorting="contextApp.state.queryParameters.sort"
4429
columns="contextApp.state.queryParameters.columns"
45-
infinite-scroll="true"
4630
minimum-visible-rows="contextApp.state.rows.all.length"
4731
status="contextApp.state.loadingStatus.anchor.status"
48-
></context-app-legacy>
49-
50-
<!-- Controls -->
51-
<context-action-bar
5232
default-step-size="contextApp.state.queryParameters.defaultStepSize"
53-
doc-count="contextApp.state.queryParameters.successorCount"
54-
doc-count-available="contextApp.state.rows.successors.length"
55-
is-disabled="contextApp.state.loadingStatus.anchor.status !== contextApp.constants.LOADING_STATUS.LOADED"
56-
is-loading="![
57-
contextApp.constants.LOADING_STATUS.LOADED,
58-
contextApp.constants.LOADING_STATUS.FAILED,
59-
].includes(contextApp.state.loadingStatus.successors.status)"
60-
on-change-count="contextApp.actions.fetchGivenSuccessorRows"
61-
type="'successors'"
62-
></context-action-bar>
33+
predecessor-count="contextApp.state.queryParameters.predecessorCount"
34+
predecessor-available="contextApp.state.rows.predecessors.length"
35+
predecessor-status="contextApp.state.loadingStatus.predecessors.status"
36+
on-change-predecessor-count="contextApp.actions.fetchGivenPredecessorRows"
37+
successor-count="contextApp.state.queryParameters.successorCount"
38+
successor-available="contextApp.state.rows.successors.length"
39+
successor-status="contextApp.state.loadingStatus.successors.status"
40+
on-change-successor-count="contextApp.actions.fetchGivenSuccessorRows"
41+
></context-app-legacy>
6342
</main>

0 commit comments

Comments
 (0)