Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into 181674-fix-bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerry350 committed May 31, 2024
2 parents 4c1f7d1 + f89b5ae commit 816dff4
Show file tree
Hide file tree
Showing 247 changed files with 6,120 additions and 5,805 deletions.
2 changes: 0 additions & 2 deletions .buildkite/pipelines/pull_request/deploy_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ steps:
machineType: n2-standard-16
preemptible: true
timeout_in_minutes: 60
soft_fail: true
retry:
automatic:
- exit_status: '-1'
Expand All @@ -29,4 +28,3 @@ steps:
- linting_with_types
- checks
- check_types
soft_fail: true
6 changes: 5 additions & 1 deletion docs/management/action-types.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ a| <<teams-action-type,Microsoft Teams>>

| Send a message to a Microsoft Teams channel.

a| <<obs-ai-assistant-action-type,Observability AI Assistant>>

| Add AI-driven insights and custom actions to your workflow.

a| <<openai-action-type,OpenAI>>

| Send a request to OpenAI.
Expand Down Expand Up @@ -144,7 +148,7 @@ image::images/connector-filter-by-type.png[Filtering the connector list by types
// NOTE: This is an autogenerated screenshot. Do not edit it directly.

You can delete individual connectors using the trash icon. Alternatively, select
multiple connectors and delete them in bulk using the *Delete* button.
multiple connectors and delete them in bulk using the *Delete* button.

[role="screenshot"]
image::images/connector-delete.png[Deleting connectors individually or in bulk]
Expand Down
67 changes: 67 additions & 0 deletions docs/management/connectors/action-types/obs-ai-assistant.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[[obs-ai-assistant-action-type]]
== Observability AI Assistant connector and action
++++
<titleabbrev>Observability AI Assistant</titleabbrev>
++++
:frontmatter-description: Add a rule action that adds AI-driven insights and custom actions to your workflow.
:frontmatter-tags-products: [kibana]
:frontmatter-tags-content-type: [how-to]
:frontmatter-tags-user-goals: [configure]

preview::[]

The Observability AI Assistant connector adds AI-driven insights and custom actions to your workflow.

To learn how to interact with the assistant through this connector, refer to the {observability-guide}/obs-ai-assistant.html[Observability AI Assistant] documentation.

[float]
[[define-obs-ai-assistant-ui]]
=== Create connectors in {kib}

To use this connector, you must have been granted access to use the Observability AI Assistant feature.
You cannot manage this connector in *{stack-manage-app} > {connectors-ui}* or by using APIs.
You also cannot create an Observability AI Assistant <<pre-configured-connectors,preconfigured connector>>.
It is available only when you're creating a rule in {kib}.
For example:

[role="screenshot"]
image::management/connectors/images/obs-ai-assistant-action.png[Add an Observability AI Assistant action while creating a rule in the Observability UI]

NOTE: You can have only one Observability AI Assistant action in each rule.

[float]
[[obs-ai-assistant-connector-configuration]]
==== Connector configuration

Observability AI Assistant connectors have the following configuration properties:

Connector::
The name of the connector to use to send requests to your AI provider.
For more information, refer to <<openai-action-type>> or <<bedrock-action-type>>.

Message::
A message containing the prompt to send to the Observability AI Assistant.
The message can specify a set of tasks for the assistant to perform, such as creating a graph or report,
and it can call an available connector to send messages to an external system, such as Slack.

NOTE: Currently you can only send messages to a Slack webhook.
Support for additional connectors will be added in the future.

For example, you can create a rule that sends the following prompt to the AI Assistant when an error count threshold is breached:

[source,text]
-----
High error count alert has triggered. Execute the following steps:
- create a graph of the error count for the service impacted by the alert
for the last 24h
- to help troubleshoot, recall past occurrences of this alert, plus any
other active alerts. Generate a report with all the found information
and send it to the Slack connector as a single message. Also include
the link to this conversation in the report.
-----

[float]
[[obs-ai-assistant-action-configuration]]
=== Test connectors

You cannot test or edit these connectors in {kib} or by using APIs.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/management/connectors/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include::action-types/resilient.asciidoc[leveloffset=+1]
include::action-types/index.asciidoc[leveloffset=+1]
include::action-types/jira.asciidoc[leveloffset=+1]
include::action-types/teams.asciidoc[leveloffset=+1]
include::action-types/obs-ai-assistant.asciidoc[leveloffset=+1]
include::action-types/openai.asciidoc[leveloffset=+1]
include::action-types/opsgenie.asciidoc[leveloffset=+1]
include::action-types/pagerduty.asciidoc[leveloffset=+1]
Expand Down
4 changes: 2 additions & 2 deletions fleet_packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
[
{
"name": "apm",
"version": "8.13.1-preview-1708411360",
"version": "8.15.0-preview-1716438434",
"forceAlignStackVersion": true,
"allowSyncToPrerelease": true
},
Expand Down Expand Up @@ -56,6 +56,6 @@
},
{
"name": "security_detection_engine",
"version": "8.14.1"
"version": "8.14.2"
}
]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1617,7 +1617,7 @@
"file-loader": "^4.2.0",
"find-cypress-specs": "^1.41.4",
"form-data": "^4.0.0",
"geckodriver": "^4.4.0",
"geckodriver": "^4.4.1",
"gulp-brotli": "^3.0.0",
"gulp-postcss": "^9.0.1",
"gulp-terser": "^2.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { trackPerformanceMeasureEntries } from './track_performance_measure_entr
import { trackClicks } from './track_clicks';

import { getSessionId } from './get_session_id';
import { createLogger } from './logger';
import { trackViewportSize } from './track_viewport_size';

/** @internal */
Expand All @@ -32,7 +31,7 @@ export class AnalyticsService {
constructor(core: CoreContext) {
this.analyticsClient = createAnalytics({
isDev: core.env.mode.dev,
logger: createLogger(core.env.mode.dev),
logger: core.logger.get('analytics'),
// TODO: We need to be able to edit sendTo once we resolve the telemetry config.
// For now, we are relying on whether it's a distributable or running from source.
sendTo: core.env.packageInfo.dist ? 'production' : 'staging',
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
},
"include": ["**/*.ts"],
"kbn_references": [
"@kbn/logging",
"@kbn/analytics-client",
"@kbn/ebt-tools",
"@kbn/core-base-browser-internal",
"@kbn/core-injected-metadata-browser-internal",
"@kbn/core-analytics-browser",
"@kbn/core-base-browser-mocks",
"@kbn/core-injected-metadata-browser-mocks",
"@kbn/security-hardening"
],
"exclude": ["target/**/*"]
}
6 changes: 6 additions & 0 deletions packages/core/analytics/core-analytics-browser/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# @kbn/core-analytics-browser

This package contains the public types for Core's browser-side analytics service.

## Enabling debug logging

Most events-related messages are logged under the `debug` level, which is silenced by default.

Until per-context logging configuration is available, use `logging.browser.root.level: DEBUG` to enable debug logging.

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 @@ -54,4 +54,11 @@ describe('CdnConfig', () => {
const cdnConfig = CdnConfig.from({ url: '' });
expect(cdnConfig.getCspConfig()).toEqual({});
});

it('accepts "null" URL', () => {
const cdnConfig = CdnConfig.from({ url: null });
expect(cdnConfig.baseHref).toBeUndefined();
expect(cdnConfig.host).toBeUndefined();
expect(cdnConfig.getCspConfig()).toEqual({});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import { URL, format } from 'node:url';
import type { CspAdditionalConfig } from '../csp';

export interface Input {
url?: string;
url?: null | string;
}

export class CdnConfig {
private readonly url: undefined | URL;
constructor(url?: string) {
constructor(url?: null | string) {
if (url) {
this.url = new URL(url); // This will throw for invalid URLs, although should be validated before reaching this point
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,9 +549,14 @@ describe('cdn', () => {
cdn: { url: 'https://cdn.example.com' },
});
});
it('can be "unset" using "null"', () => {
expect(config.schema.validate({ cdn: { url: null } })).toMatchObject({
cdn: { url: null },
});
});
it.each([['foo'], ['http:./']])('throws for invalid URL %s', (url) => {
expect(() => config.schema.validate({ cdn: { url } })).toThrowErrorMatchingInlineSnapshot(
`"[cdn.url]: expected URI with scheme [http|https]."`
expect(() => config.schema.validate({ cdn: { url } })).toThrow(
/expected URI with scheme \[http\|https\]/
);
});
it.each([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ const configSchema = schema.object(
},
}),
cdn: schema.object({
url: schema.maybe(schema.uri({ scheme: ['http', 'https'], validate: validateCdnURL })),
url: schema.nullable(
schema.maybe(schema.uri({ scheme: ['http', 'https'], validate: validateCdnURL }))
),
}),
oas: schema.object({
enabled: schema.boolean({ defaultValue: false }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ describe('StaticAssets', () => {
staticAssets = new StaticAssets(args);
expect(staticAssets.isUsingCdn()).toBe(true);
});

it('returns false when CDN config contains "null" URL', () => {
args.cdnConfig = CdnConfig.from({ url: null });
staticAssets = new StaticAssets(args);
expect(staticAssets.isUsingCdn()).toBe(false);
});
});

describe('#getPluginAssetHref()', () => {
Expand Down
3 changes: 0 additions & 3 deletions packages/kbn-alerts-ui-shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,5 @@ export { AlertsSearchBar } from './src/alerts_search_bar';
export type { AlertsSearchBarProps } from './src/alerts_search_bar/types';

export * from './src/alert_fields_table';

export * from './src/rule_type_modal';
export * from './src/alert_filter_controls/types';
export * from './src/rule_form';
export * from './src/common/hooks';
Loading

0 comments on commit 816dff4

Please sign in to comment.