Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added help text where needed on connectors and alert actions UI #69601

Merged
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
710c890
Added help text where needed on connectors and alert actions UI
YulNaumenko Jun 18, 2020
520d9db
Merge remote-tracking branch 'upstream/master' into alerting-ui-actio…
YulNaumenko Jun 22, 2020
4c7fa92
Merge remote-tracking branch 'upstream/master' into alerting-ui-actio…
YulNaumenko Jun 23, 2020
f709dda
fixed ui form
YulNaumenko Jun 23, 2020
3742a8e
Merge upstream
YulNaumenko Jun 23, 2020
7023a26
Merge remote-tracking branch 'upstream/master' into alerting-ui-actio…
YulNaumenko Jun 26, 2020
7874318
Added index action type examples, fixed slack link
YulNaumenko Jun 27, 2020
3555e71
Merge master
YulNaumenko Jul 8, 2020
d38ae8c
Fixed email connector docs and links
YulNaumenko Jul 9, 2020
b7197c2
Additional cleanup on email
YulNaumenko Jul 9, 2020
54a9371
Removed autofocus to avoid twice link click for opening in the new page
YulNaumenko Jul 9, 2020
78c3683
Extended documentation for es index action type
YulNaumenko Jul 9, 2020
76b129f
Fixed tests
YulNaumenko Jul 9, 2020
3cf6705
Fixed doc link
YulNaumenko Jul 9, 2020
a5b5628
Merge remote-tracking branch 'upstream/master' into alerting-ui-actio…
YulNaumenko Jul 13, 2020
316cc7b
fixed due to comments
YulNaumenko Jul 13, 2020
1f4e13e
fixed due to comments
YulNaumenko Jul 13, 2020
7f11a48
Update docs/user/alerting/action-types/email.asciidoc
YulNaumenko Jul 13, 2020
b0a28f5
Update docs/user/alerting/action-types/email.asciidoc
YulNaumenko Jul 13, 2020
ce97972
Update docs/user/alerting/action-types/email.asciidoc
YulNaumenko Jul 13, 2020
4d8fa7d
Update docs/user/alerting/action-types/email.asciidoc
YulNaumenko Jul 13, 2020
12a0364
Update docs/user/alerting/action-types/email.asciidoc
YulNaumenko Jul 13, 2020
817a476
Update docs/user/alerting/action-types/email.asciidoc
YulNaumenko Jul 13, 2020
0ae05ae
Update docs/user/alerting/action-types/email.asciidoc
YulNaumenko Jul 13, 2020
39f15d1
Update x-pack/plugins/actions/README.md
YulNaumenko Jul 13, 2020
0ac7dc1
Update x-pack/plugins/actions/README.md
YulNaumenko Jul 13, 2020
15c4b37
Update x-pack/plugins/triggers_actions_ui/README.md
YulNaumenko Jul 13, 2020
c87ea4e
Update docs/user/alerting/action-types/email.asciidoc
YulNaumenko Jul 13, 2020
4a1feb3
Update docs/user/alerting/action-types/email.asciidoc
YulNaumenko Jul 13, 2020
3c2dd52
Update docs/user/alerting/action-types/email.asciidoc
YulNaumenko Jul 13, 2020
3191843
Update docs/user/alerting/action-types/email.asciidoc
YulNaumenko Jul 13, 2020
bed176e
Update docs/user/alerting/action-types/index.asciidoc
YulNaumenko Jul 13, 2020
59681ef
Update docs/user/alerting/action-types/slack.asciidoc
YulNaumenko Jul 13, 2020
50e613d
Fixed due to comments
YulNaumenko Jul 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions docs/user/alerting/action-types/email.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,125 @@ Email actions have the following configuration properties:
To, CC, BCC:: Each is a list of addresses. Addresses can be specified in `user@host-name` format, or in `name <user@host-name>` format. One of To, CC, or BCC must contain an entry.
Subject:: The subject line of the email.
Message:: The message text of the email. Markdown format is supported.

[[configuring-email]]
==== Configuring email accounts

Email action can send email using any SMTP email service.
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

You configure the accounts Email action can use to send emails using the connector form.
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
For more information about configuring Email connector to work with different email
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
systems, see:
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

* <<gmail>>
* <<outlook>>
* <<exchange>>
* <<amazon-ses>>

[float]
[[gmail]]
===== Sending email from Gmail

Use the following email account settings to send email from the
https://mail.google.com[Gmail] SMTP service:

[source,js]
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
--------------------------------------------------
config:
host: smtp.gmail.com
port: 587
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
secure: true
secrets:
user: <username>
password: <password>
--------------------------------------------------
// CONSOLE

If you get an authentication error that indicates that you need to continue the
sign-in process from a web browser when Email action attempts to send email, you need
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
to configure Gmail to https://support.google.com/accounts/answer/6010255?hl=en[Allow
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
Less Secure Apps to access your account].
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

If two-step verification is enabled for your account, you must generate and use
a unique App Password to send email from {watcher}. See
https://support.google.com/accounts/answer/185833?hl=en[Sign in using App Passwords]
for more information.

[float]
[[outlook]]
===== Sending email from Outlook.com

Use the following email account settings to send email action from the
https://www.outlook.com/[Outlook.com] SMTP service:

[source,js]
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
--------------------------------------------------
config:
host: smtp-mail.outlook.com
port: 587
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
secure: true
secrets:
user: <email.address>
password: <password>
--------------------------------------------------
// CONSOLE

When sending emails, you have to provide a from address, either a default one
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
in your account configuration or as part of the email action in the watch.

NOTE: You need to use a unique App Password if two-step verification is enabled.
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
See http://windows.microsoft.com/en-us/windows/app-passwords-two-step-verification[App
passwords and two-step verification] for more information.

[float]
[[amazon-ses]]
===== Sending email from Amazon SES (Simple Email Service)

Use the following email account settings to send email from the
http://aws.amazon.com/ses[Amazon Simple Email Service] (SES) SMTP service:

[source,js]
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
--------------------------------------------------
config:
host: email-smtp.us-east-1.amazonaws.com <1>
port: 587
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
secure: true
secrets:
user: <username>
password: <password>
--------------------------------------------------
// CONSOLE
<1> `smtp.host` varies depending on the region

NOTE: You need to use your Amazon SES SMTP credentials to send email through
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
Amazon SES. For more information, see
http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html[Obtaining
Your Amazon SES SMTP Credentials]. You might also need to verify
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html[your email address]
or https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-domains.html[your whole domain]
at AWS.

[float]
[[exchange]]
===== Sending email from Microsoft Exchange

Use the following email account settings to send email action from Microsoft
Exchange:

[source,js]
--------------------------------------------------
config:
host: <your exchange server>
port: 587
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
secure: true
from: <email address of service account> <1>
secrets:
user: <email address of service account> <2>
password: <password>
--------------------------------------------------
// CONSOLE
<1> Some organizations configure Exchange to validate that the `from` field is a
valid local email account.
<2> Many organizations support use of your email address as your username, though
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
it is a good idea to check with your system administrator if you receive
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
authentication-related failures.
39 changes: 38 additions & 1 deletion docs/user/alerting/action-types/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[[index-action-type]]
=== Index action

The index action type will index a document into {es}.
The index action type will index a document into {es}. There is an {ref}/indices-create-index.html[info] how to create an index in {es}.
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

[float]
[[index-connector-configuration]]
Expand Down Expand Up @@ -54,3 +54,40 @@ Execution time field:: This field will be automatically set to the time the ale
Index actions have the following properties:

Document:: The document to index in json format.
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

The create test index using index API:
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

[source,js]
--------------------------------------------------
PUT test
{
"settings" : {
"number_of_shards" : 1
},
"mappings" : {
"_doc" : {
"properties" : {
"alert_id" : { "type" : "text" },
"alert_name" : { "type" : "text" },
"alert_instance_id" : { "type" : "text" },
"context_message": { "type" : "text" }
}
}
}
}
--------------------------------------------------
// CONSOLE


Example of the index document for Index Threshold Alert:
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

[source,js]
--------------------------------------------------
{
"alert_id": "{{alertId}}",
"alert_name": "{{alertName}}",
"alert_instance_id": "{{alertInstanceId}}",
"context_message": "{{context.message}}"
}
--------------------------------------------------
// CONSOLE
20 changes: 20 additions & 0 deletions docs/user/alerting/action-types/slack.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,23 @@ Webhook URL:: The URL of the incoming webhook. See https://api.slack.com/messa
Slack actions have the following properties:

Message:: The message text, converted to the `text` field in the Webhook JSON payload. Currently only the text field is supported. Markdown, images, and other advanced formatting are not yet supported.

[[configuring-slack]]
==== Configuring Slack Accounts

You configure the accounts Slack action type can use to communicate with Slack in the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest removing this sentence

connector form.

You need a https://api.slack.com/incoming-webhooks[Slack webhook URL] to
configure a Slack account. To create a webhook
URL, set up an an _Incoming Webhook Integration_ through the Slack console:
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

. Log in to http://slack.com[slack.com] as a team administrator.
. Go to https://my.slack.com/services/new/incoming-webhook.
. Select a default channel for the integration.
+
image::images/slack-add-webhook-integration.png[]
. Click *Add Incoming Webhook Integration*.
. Copy the generated webhook URL so you can paste it into your Slack connector form.
+
image::images/slack-copy-webhook-url.png[]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 9 additions & 10 deletions x-pack/plugins/actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,23 +427,22 @@ The config and params properties are modelled after the [Watcher Index Action](h

### `config`

| Property | Description | Type |
| -------- | -------------------------------------- | ------------------- |
| index | The Elasticsearch index to index into. | string _(optional)_ |
| Property | Description | Type |
| -------------------- | ---------------------------------------------------------- | -------------------- |
| index | The Elasticsearch index to index into. | string _(optional)_ |
| doc_id | The optional \_id of the document. | string _(optional)_ |
| execution_time_field | The field that will store/index the action execution time. | string _(optional)_ |
| refresh | Setting of the refresh policy for the write request | boolean _(optional)_ |
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

### `secrets`

This action type has no `secrets` properties.

### `params`

| Property | Description | Type |
| -------------------- | ---------------------------------------------------------- | -------------------- |
| index | The Elasticsearch index to index into. | string _(optional)_ |
| doc_id | The optional \_id of the document. | string _(optional)_ |
| execution_time_field | The field that will store/index the action execution time. | string _(optional)_ |
| refresh | Setting of the refresh policy for the write request | boolean _(optional)_ |
| body | The documument body/bodies to index. | object or object[] |
| Property | Description | Type |
| --------- | ---------------------------------------- | ------------------- |
| documents | JSON object which describe the [document](https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-index.html#getting-started-batch-processing). | object[] |
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

---

Expand Down
17 changes: 15 additions & 2 deletions x-pack/plugins/triggers_actions_ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -900,10 +900,23 @@ export function getActionType(): ActionTypeModel {

![Index connector card](https://i.imgur.com/fflsmu5.png)

![Index connector form](https://i.imgur.com/tbgyvAL.png)
![Index connector form](https://i.imgur.com/IkixGMV.png)

and action params form available in Create Alert form:
![Index action form](https://i.imgur.com/VsWMLeU.png)
![Index action form](https://i.imgur.com/mpxnPOF.png)

Example of the index document for Index Threshold Alert:
YulNaumenko marked this conversation as resolved.
Show resolved Hide resolved

```
{
"alert_id": "{{alertId}}",
"alert_name": "{{alertName}}",
"alert_instance_id": "{{alertInstanceId}}",
"context_title": "{{context.title}}",
"context_value": "{{context.value}}",
"context_message": "{{context.message}}"
}
```

### Webhook

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ import {
EuiFormRow,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { EuiLink } from '@elastic/eui';
import { ActionConnectorFieldsProps } from '../../../../types';
import { EmailActionConnector } from '../types';

export const EmailActionConnectorFields: React.FunctionComponent<ActionConnectorFieldsProps<
EmailActionConnector
>> = ({ action, editActionConfig, editActionSecrets, errors }) => {
>> = ({ action, editActionConfig, editActionSecrets, errors, docLinks }) => {
const { from, host, port, secure } = action.config;
const { user, password } = action.secrets;

Expand All @@ -38,6 +40,17 @@ export const EmailActionConnectorFields: React.FunctionComponent<ActionConnector
defaultMessage: 'Sender',
}
)}
helpText={
<EuiLink
href={`${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/email-action-type.html#configuring-email`}
target="_blank"
>
<FormattedMessage
id="xpack.triggersActionsUI.components.builtinActionTypes.emailAction.configureAccountsHelpLabel"
defaultMessage="Configuring email accounts."
/>
</EuiLink>
}
>
<EuiFieldText
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
import React from 'react';
import { mountWithIntl } from 'test_utils/enzyme_helpers';
import { DocLinksStart } from 'kibana/public';
import EmailParamsFields from './email_params';

describe('EmailParamsFields renders', () => {
Expand All @@ -22,6 +23,7 @@ describe('EmailParamsFields renders', () => {
errors={{ to: [], cc: [], bcc: [], subject: [], message: [] }}
editAction={() => {}}
index={0}
docLinks={{ ELASTIC_WEBSITE_URL: '', DOC_LINK_VERSION: '' } as DocLinksStart}
/>
);
expect(wrapper.find('[data-test-subj="toEmailAddressInput"]').length > 0).toBeTruthy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
EuiSelect,
EuiTitle,
EuiIconTip,
EuiLink,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
Expand All @@ -28,7 +29,7 @@ import {

const IndexActionConnectorFields: React.FunctionComponent<ActionConnectorFieldsProps<
EsIndexActionConnector
>> = ({ action, editActionConfig, errors, http }) => {
>> = ({ action, editActionConfig, errors, http, docLinks }) => {
const { index, refresh, executionTimeField } = action.config;
const [hasTimeFieldCheckbox, setTimeFieldCheckboxState] = useState<boolean>(
executionTimeField != null
Expand Down Expand Up @@ -77,10 +78,22 @@ const IndexActionConnectorFields: React.FunctionComponent<ActionConnectorFieldsP
isInvalid={errors.index.length > 0 && index !== undefined}
error={errors.index}
helpText={
<FormattedMessage
id="xpack.triggersActionsUI.components.builtinActionTypes.indexAction.howToBroadenSearchQueryDescription"
defaultMessage="Use * to broaden your query."
/>
<>
<FormattedMessage
id="xpack.triggersActionsUI.components.builtinActionTypes.indexAction.howToBroadenSearchQueryDescription"
defaultMessage="Use * to broaden your query."
/>
<EuiSpacer size="s" />
<EuiLink
href={`${docLinks.ELASTIC_WEBSITE_URL}guide/en/kibana/${docLinks.DOC_LINK_VERSION}/index-action-type.html`}
target="_blank"
>
<FormattedMessage
id="xpack.triggersActionsUI.components.builtinActionTypes.indexAction.configureIndexHelpLabel"
defaultMessage="Configuring index connector."
/>
</EuiLink>
</>
}
>
<EuiComboBox
Expand Down Expand Up @@ -186,9 +199,9 @@ const IndexActionConnectorFields: React.FunctionComponent<ActionConnectorFieldsP
</>
}
/>
<EuiSpacer size="m" />
{hasTimeFieldCheckbox ? (
<>
<EuiSpacer size="m" />
<EuiFormRow
id="executionTimeField"
fullWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import React from 'react';
import { mountWithIntl } from 'test_utils/enzyme_helpers';
import ParamsFields from './es_index_params';
import { DocLinksStart } from 'kibana/public';

describe('IndexParamsFields renders', () => {
test('all params fields is rendered', () => {
Expand All @@ -18,6 +19,7 @@ describe('IndexParamsFields renders', () => {
errors={{ index: [] }}
editAction={() => {}}
index={0}
docLinks={{ ELASTIC_WEBSITE_URL: '', DOC_LINK_VERSION: '' } as DocLinksStart}
/>
);
expect(wrapper.find('[data-test-subj="documentsJsonEditor"]').first().prop('value')).toBe(`{
Expand Down
Loading