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

Add doc for alerting comments #7360

Merged
merged 52 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
6784390
alerting comments first documentation rough draft
toepkerd-zz Jun 11, 2024
c889fab
formatting and styling changes
toepkerd-zz Jun 11, 2024
c8fd502
more formatting changes
toepkerd-zz Jun 11, 2024
8353cb0
more spacing changes
toepkerd-zz Jun 11, 2024
3b6f9a3
added not about rbac and added some links
toepkerd-zz Jun 11, 2024
a9d7dde
removing comments history enabled setting
toepkerd-zz Jun 11, 2024
ee44f1e
Update comments.md
vagimeli Jun 14, 2024
17c0fe8
Merge branch 'main' into main
vagimeli Jun 14, 2024
e67935b
Update _observing-your-data/alerting/api.md
toepkerd Jun 14, 2024
48c4082
Update _observing-your-data/alerting/api.md
toepkerd Jun 14, 2024
b2ee323
Update _observing-your-data/alerting/settings.md
toepkerd Jun 14, 2024
e646f26
Update _observing-your-data/alerting/settings.md
toepkerd Jun 14, 2024
d8cabe5
Update _observing-your-data/alerting/settings.md
toepkerd Jun 14, 2024
2e856a2
Update _observing-your-data/alerting/settings.md
toepkerd Jun 14, 2024
4075e8e
minor edits and dead link fix attempt
toepkerd-zz Jun 14, 2024
52a100e
misc edits
toepkerd-zz Jun 14, 2024
1015d27
minor edit
toepkerd-zz Jun 14, 2024
c59defd
Merge branch 'main' into main
vagimeli Jun 17, 2024
566e49e
Update api.md
vagimeli Jun 17, 2024
1a212ff
Update _observing-your-data/alerting/comments.md
vagimeli Jun 17, 2024
d02daff
Update api.md
vagimeli Jun 17, 2024
50c576d
Update comments.md
vagimeli Jun 17, 2024
295635e
Update api.md
vagimeli Jun 17, 2024
7442adb
Update api.md
vagimeli Jun 17, 2024
c97bda9
Update api.md
vagimeli Jun 17, 2024
fb2dbf2
Update api.md
vagimeli Jun 17, 2024
3f513e6
Update api.md
vagimeli Jun 18, 2024
6257d1c
Update api.md
vagimeli Jun 18, 2024
b8da713
Update _observing-your-data/alerting/api.md
vagimeli Jun 18, 2024
aa2bc95
Update _observing-your-data/alerting/api.md
vagimeli Jun 18, 2024
c7fda09
Update _observing-your-data/alerting/api.md
vagimeli Jun 18, 2024
f5e6950
Update _observing-your-data/alerting/api.md
vagimeli Jun 18, 2024
8ac0919
Update _observing-your-data/alerting/api.md
vagimeli Jun 18, 2024
85e54b6
Update _observing-your-data/alerting/settings.md
vagimeli Jun 18, 2024
a6a29b4
Update _observing-your-data/alerting/settings.md
vagimeli Jun 18, 2024
b29454d
Update _observing-your-data/alerting/settings.md
vagimeli Jun 18, 2024
96fd6f0
Update _observing-your-data/alerting/comments.md
vagimeli Jun 18, 2024
fbd9e71
Merge branch 'main' into main
vagimeli Jun 18, 2024
0968ba6
Update _observing-your-data/alerting/settings.md
vagimeli Jun 18, 2024
d24204c
Update _observing-your-data/alerting/comments.md
vagimeli Jun 18, 2024
316d50c
Update _observing-your-data/alerting/comments.md
vagimeli Jun 18, 2024
4b4b1b3
Update _observing-your-data/alerting/comments.md
vagimeli Jun 18, 2024
584cea1
Update api.md
vagimeli Jun 18, 2024
68a3322
Update settings.md
vagimeli Jun 18, 2024
61c7718
Update api.md
vagimeli Jun 18, 2024
aee2f5b
Update api.md
vagimeli Jun 18, 2024
49ea8cc
Update _observing-your-data/alerting/api.md
vagimeli Jun 18, 2024
a5f6b50
Update api.md
vagimeli Jun 19, 2024
e99c254
Update _observing-your-data/alerting/api.md
vagimeli Jun 19, 2024
716724e
Merge branch 'main' into main
vagimeli Jun 19, 2024
b54e5c1
Fix broken link
vagimeli Jun 19, 2024
7991b41
Fix broken link
vagimeli Jun 19, 2024
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
143 changes: 143 additions & 0 deletions _observing-your-data/alerting/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2075,4 +2075,147 @@ POST _plugins/_alerting/destinations/email_groups/_search
}
}
```

## Create comment (experimental)

#### Request

```json
POST _plugins/_alerting/comments/<alert-id>
{
"content": "sample comment"
}
```

#### Example response

```json
{
"_id": "0U6aBJABVWc3FrmWer9s",
"_seq_no": 7,
"_primary_term": 2,
"comment": {
"entity_id": "vCZkA5ABWTh3kzuBEL_9",
"entity_type": "alert",
"content": "sample comment",
"created_time": 1718064151148,
"last_updated_time": null,
"user": "admin"
}
}
```

## Update comment (experimental)
toepkerd marked this conversation as resolved.
Show resolved Hide resolved

#### Request

```json
PUT _plugins/_alerting/comments/<comment-id>
{
"content": "sample updated comment"
}
```

#### Example response

```json
{
"_id": "0U6aBJABVWc3FrmWer9s",
"_seq_no": 8,
"_primary_term": 3,
"comment": {
"entity_id": "vCZkA5ABWTh3kzuBEL_9",
"entity_type": "alert",
"content": "sample updated comment",
"created_time": 1718064151148,
"last_updated_time": 1718064745485,
"user": "admin"
}
}
```

## Search comments (experimental)

#### Request

```json
GET _plugins/_alerting/comments/_search
{
"query": {
"match_all" : {}
}
}
```

#### Example response

```json
{
"took": 14,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 2,
"relation": "eq"
},
"max_score": 1,
"hits": [
{
"_index": ".opensearch-alerting-comments-history-2024.06.10-1",
"_id": "xE5tBJABVWc3FrmWRL5i",
"_version": 1,
"_seq_no": 3,
"_primary_term": 2,
"_score": 1,
"_source": {
"entity_id": "vCZkA5ABWTh3kzuBEL_9",
"entity_type": "alert",
"content": "a different sample comment",
"created_time": 1718061188191,
"last_updated_time": null,
"user": "admin"
}
},
{
"_index": ".opensearch-alerting-comments-history-2024.06.10-1",
"_id": "0U6aBJABVWc3FrmWer9s",
"_version": 3,
"_seq_no": 9,
"_primary_term": 3,
"_score": 1,
"_source": {
"entity_id": "vCZkA5ABWTh3kzuBEL_9",
"entity_type": "alert",
"content": "sample updated comment",
"created_time": 1718064151148,
"last_updated_time": 1718064745485,
"user": "admin"
}
}
]
}
}
```

## Delete comment (experimental)
toepkerd marked this conversation as resolved.
Show resolved Hide resolved

#### Request

```json
DELETE _plugins/_alerting/comments/<comment-id>
```

#### Example response

```json
{
"_id": "0U6aBJABVWc3FrmWer9s"
}
```
---
24 changes: 24 additions & 0 deletions _observing-your-data/alerting/comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
layout: default
title: Adding comments
nav_order: 35
parent: Alerting
has_children: false
redirect_from:
- /monitoring-plugins/alerting/comments/
---

# Adding comments

This is an experimental feature and is not recommended for use in a production environment. For updates on the progress of the feature or if you want to leave feedback, see the associated [GitHub issue](<insert-issue-link>).
{: .warning}

When an alert is generated, add comments to share insights into its root cause and facilitate resolution. Comments are enabled by setting plugins.alerting.comments_enabled to "true" using the [cluster settings API]({{site.url}}{{site.baseurl}}/observing-your-data/alerting/settings/).

## Viewing comment authors

If the Security plugin is installed, the author of a comment is displayed. Otherwise, comments on alerts are shown as `Unknown`.

## Assigning permissions

Comment permissions inherit from the Alert's backend roles, which in turn inherit from the generating Monitor. For more details, see [Limit access by backend role]({{site.url}}{{site.baseurl}}/observing-your-data/alerting/security/#advanced-limit-access-by-backend-role).
8 changes: 8 additions & 0 deletions _observing-your-data/alerting/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,11 @@
`plugins.scheduled_jobs.sweeper.backoff_millis` | 50ms | The amount of time the sweeper waits between retries---increases exponentially after each failed retry.
`plugins.scheduled_jobs.sweeper.retry_count` | 3 | The total number of times the sweeper should retry before throwing an error.
`plugins.scheduled_jobs.request_timeout` | 10s | The timeout for the request that sweeps shards for jobs.
`plugins.alerting.comments_enabled` | "false" | Whether comments for the Alerting plugin is enabled or not.
toepkerd marked this conversation as resolved.
Show resolved Hide resolved
`plugins.alerting.comments_history_max_docs` | 1000 | The maximum number of comments to store in the `.opensearch-alerting-comments-history-<date>` index before creating a new index.
`plugins.alerting.comments_history_max_age` | 30d | The oldest document to store in the `.opensearch-alerting-comments-history-<date>` index before creating a new index. If the number of comments in this time period does not exceed comments_history_max_docs, the Alerting plugin creates one comments history index per period (e.g. one index every 30 days).
toepkerd marked this conversation as resolved.
Show resolved Hide resolved
`plugins.alerting.comments_history_rollover_period` | 12h | How frequently to check whether the .opensearch-alerting-comments-history-write alias should roll over to a new history index and whether the Alerting plugin should delete any comments history indexes.

Check failure on line 66 in _observing-your-data/alerting/settings.md

View workflow job for this annotation

GitHub Actions / style-job

[vale] reported by reviewdog 🐶 [Vale.Terms] Use 'OpenSearch' instead of 'opensearch'. Raw Output: {"message": "[Vale.Terms] Use 'OpenSearch' instead of 'opensearch'.", "location": {"path": "_observing-your-data/alerting/settings.md", "range": {"start": {"line": 66, "column": 98}}}, "severity": "ERROR"}
toepkerd marked this conversation as resolved.
Show resolved Hide resolved
`plugins.alerting.comments_history_retention_period` | 60d | The amount of time to keep comments history indexes before automatically deleting them.
toepkerd marked this conversation as resolved.
Show resolved Hide resolved
`plugins.alerting.max_comment_character_length` | 2000 | The maximum character length of a comment.
`plugins.alerting.max_comments_per_alert` | 500 | The maximum number of comments that can be posted on an alert.
`plugins.alerting.max_comments_per_notification` | 3 | The maximum number of comments per alert to include in the `ctx` mustache template variable for alert notifications.
vagimeli marked this conversation as resolved.
Show resolved Hide resolved
Loading