Skip to content

Commit

Permalink
Merge branch 'main' into fleet-api-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored Nov 14, 2024
2 parents 2e5f239 + bdf62b6 commit 749d7b5
Show file tree
Hide file tree
Showing 120 changed files with 1,964 additions and 385 deletions.
4 changes: 3 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,9 @@ x-pack/packages/observability/alerting_rule_utils @elastic/obs-ux-management-tea
x-pack/packages/observability/alerting_test_data @elastic/obs-ux-management-team
x-pack/packages/observability/get_padded_alert_time_range_util @elastic/obs-ux-management-team
x-pack/packages/observability/logs_overview @elastic/obs-ux-logs-team
x-pack/packages/observability/observability_utils @elastic/observability-ui
x-pack/packages/observability/observability_utils/observability_utils_browser @elastic/observability-ui
x-pack/packages/observability/observability_utils/observability_utils_common @elastic/observability-ui
x-pack/packages/observability/observability_utils/observability_utils_server @elastic/observability-ui
x-pack/packages/observability/synthetics_test_data @elastic/obs-ux-management-team
x-pack/packages/rollup @elastic/kibana-management
x-pack/packages/search/shared_ui @elastic/search-kibana
Expand Down
33 changes: 11 additions & 22 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,26 @@ Summarize your PR. If it involves visual changes include a screenshot or gif.

### Checklist

Delete any items that are not applicable to this PR.
Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials
- [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
- [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed
- [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.
- [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section, and the correct `release_node:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
### Identify risks

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

| Risk | Probability | Severity | Mitigation/Notes |
|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces—unexpected behavior in non-default Kibana Space. | Low | High | Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces. |
| Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. | High | Low | Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure. |
| Code should gracefully handle cases when feature X or plugin Y are disabled. | Medium | High | Unit tests will verify that any feature flag or plugin combination still results in our service operational. |
| [See more potential risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |
Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
- [ ] This will appear in the **Release Notes** and follow the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

42 changes: 42 additions & 0 deletions docs/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,48 @@ include::upgrade-notes.asciidoc[]

For information about the {kib} 8.16.0 release, review the following information.

The 8.16.0 release includes the following known issues.

[float]
[[known-issues-8.16.0]]
=== Known issues

[discrete]
[[known-199902]]
.Stack Monitoring shows "Unable to load page error"
[%collapsible]
====
*Details* +
The Stack Monitoring pages Overview, Nodes, Logs can stop working with the error "Unable to load page error". The Stack trace mentions `TypeError: Cannot read properties of undefined (reading 'logsLocator')`.
*Workaround* +
Disabling the `Set feature visibility > Logs` feature at Kibana Space settings level will prevent the error to occur. Please note the `Logs` feature will not be available on such space.
It's also possible to `Observability > Logs` feature privilege to `None` on the role level - this will hide the `Logs` feature for individual users and prevent the error for these users as well.
For more information, refer to {kibana-issue}199902[#199902].
====

[discrete]
[[known-199891-199892]]
.Onboarding, tutorial of APM and OpenTelemetry and some "Beats Only" integrations will show the error "Unable to load page error"
[%collapsible]
====
*Details* +
Tutorials linked from the {kib} home page show an error "Unable to load page error". The Stack trace mentions `The above error occurred in tutorial_TutorialUi`.
*Workaround* +
The APM / OpenTelemetry tutorials represented a shortcut to get important parameters to use in the configuration files quickly.
It is still possible to obtain the same parameters following the documentation tutorials of APM.
More information can be found in the {observability-guide}/apm-collect-application-data.html[APM documentation] and the {observability-guide}/get-started-with-fleet-apm-server.html[Fleet documentation].
For information about how to create APM API keys, please check the {observability-guide}/apm-api-key.html#apm-create-an-api-key[API key documentation].
For more information, refer to {kibana-issue}199891[#199891] and {kibana-issue}199892[#199892].
====

[float]
[[deprecations-8.16.0]]
=== Deprecations
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,9 @@
"@kbn/observability-plugin": "link:x-pack/plugins/observability_solution/observability",
"@kbn/observability-shared-plugin": "link:x-pack/plugins/observability_solution/observability_shared",
"@kbn/observability-synthetics-test-data": "link:x-pack/packages/observability/synthetics_test_data",
"@kbn/observability-utils": "link:x-pack/packages/observability/observability_utils",
"@kbn/observability-utils-browser": "link:x-pack/packages/observability/observability_utils/observability_utils_browser",
"@kbn/observability-utils-common": "link:x-pack/packages/observability/observability_utils/observability_utils_common",
"@kbn/observability-utils-server": "link:x-pack/packages/observability/observability_utils/observability_utils_server",
"@kbn/oidc-provider-plugin": "link:x-pack/test/security_api_integration/plugins/oidc_provider",
"@kbn/open-telemetry-instrumented-plugin": "link:test/common/plugins/otel_metrics",
"@kbn/openapi-common": "link:packages/kbn-openapi-common",
Expand Down
45 changes: 40 additions & 5 deletions packages/kbn-apm-utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import agent from 'elastic-apm-node';
import agent, { Logger } from 'elastic-apm-node';
import asyncHooks from 'async_hooks';

export interface SpanOptions {
Expand All @@ -34,14 +34,48 @@ const runInNewContext = <T extends (...args: any[]) => any>(cb: T): ReturnType<T

export async function withSpan<T>(
optionsOrName: SpanOptions | string,
cb: (span?: Span) => Promise<T>
cb: (span?: Span) => Promise<T>,
logger?: Logger
): Promise<T> {
const options = parseSpanOptions(optionsOrName);

const { name, type, subtype, labels, intercept } = options;

let time: number | undefined;
if (logger?.isLevelEnabled('debug')) {
time = performance.now();
}

function logTook(failed: boolean) {
if (time) {
logger?.debug(
() =>
`Operation ${name}${failed ? ` (failed)` : ''} ${
Math.round(performance.now() - time!) / 1000
}s`
);
}
}

const withLogTook = [
<TR>(res: TR): TR | Promise<TR> => {
logTook(false);
return res;
},
(err: any): never => {
logTook(true);
throw err;
},
];

if (!agent.isStarted()) {
return cb();
const promise = cb();
// make sure tests that mock out the callback with a sync
// function don't fail.
if (typeof promise === 'object' && 'then' in promise) {
return promise.then(...withLogTook);
}
return promise;
}

let createdSpan: Span | undefined;
Expand All @@ -57,7 +91,7 @@ export async function withSpan<T>(
createdSpan = agent.startSpan(name) ?? undefined;

if (!createdSpan) {
return cb();
return cb().then(...withLogTook);
}
}

Expand All @@ -76,7 +110,7 @@ export async function withSpan<T>(
}

if (!span) {
return promise;
return promise.then(...withLogTook);
}

const targetedSpan = span;
Expand All @@ -98,6 +132,7 @@ export async function withSpan<T>(
}

return promise
.then(...withLogTook)
.then((res) => {
if (!targetedSpan.outcome || targetedSpan.outcome === 'unknown') {
targetedSpan.outcome = 'success';
Expand Down
Loading

0 comments on commit 749d7b5

Please sign in to comment.