Skip to content

Add documentation for k8s alerts installation - #5364

Merged
ChrsMark merged 10 commits into
elastic:mainfrom
ChrsMark:add_alerts
Mar 1, 2023
Merged

Add documentation for k8s alerts installation#5364
ChrsMark merged 10 commits into
elastic:mainfrom
ChrsMark:add_alerts

Conversation

@ChrsMark

@ChrsMark ChrsMark commented Feb 23, 2023

Copy link
Copy Markdown
Member

This PR adds basic alert samples for Kubernetes clusters. The alerts for now are suggested inside the documentation pages but the long term solution would be to add them as part of the package's assets so that they can be installed through Kibana/Fleet.

More details and the related discussions can be found at #4997.

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@elasticmachine

elasticmachine commented Feb 23, 2023

Copy link
Copy Markdown

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-03-01T08:41:00.853+0000

  • Duration: 29 min 26 sec

Test stats 🧪

Test Results
Failed 0
Passed 92
Skipped 0
Total 92

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@ChrsMark ChrsMark changed the title Add 1st alert Feb 28, 2023
@ChrsMark
ChrsMark requested a review from gizas February 28, 2023 04:15
@ChrsMark ChrsMark self-assigned this Feb 28, 2023
@ChrsMark
ChrsMark marked this pull request as ready for review February 28, 2023 04:15
@ChrsMark
ChrsMark requested a review from a team as a code owner February 28, 2023 04:15
@ChrsMark
ChrsMark requested a review from constanca-m February 28, 2023 04:15
@elasticmachine

elasticmachine commented Feb 28, 2023

Copy link
Copy Markdown

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (0/0) 💚
Files 100.0% (0/0) 💚
Classes 100.0% (0/0) 💚
Methods 96.154% (75/78) 👎 -3.846
Lines 100.0% (0/0) 💚 5.682
Conditionals 100.0% (0/0) 💚
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
"must": [
{
"query_string": {
"query": "event.module:kubernetes AND metricset.name: apiserver AND NOT (kubernetes.apiserver.request.verb: WATCH or kubernetes.apiserver.request.verb: CONNECT)",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Instead of event.module:kubernetes AND metricset.name: apiserver we can use data_stream.dataset: kubernetes.apiserver the same way we do in the dashboards.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This comment applies for all.

@MichaelKatsoulis

Copy link
Copy Markdown
Contributor

How can a user access these alerts suggestions? Should we add a link in the kubernetes integration README ?

@ChrsMark

Copy link
Copy Markdown
Member Author

How can a user access these alerts suggestions? Should we add a link in the kubernetes integration README ?

Those would be listed at https://docs.elastic.co/integrations/kubernetes like the docs' pages for the data_streams families. I can check if I can link them somehow but maybe the README is not a good place? Maybe https://www.elastic.co/guide/en/fleet/master/running-on-kubernetes-managed-by-fleet.html or a similar page is a better place to put them?
@gizas any thoughts here? Personally I would be ok with not advertising those much since the long term plan is to make them part of the package as assets. The current approach is more of a validation/PoC.

@gizas

gizas commented Feb 28, 2023

Copy link
Copy Markdown
Contributor

Wondering if writing a blog can be an option to advertise the ongoing work
We also have the work of automation through CI where same comments were received. That we have something that users dont know.

If we go for a blog a new story should be created.
Also opening a ticket to docs team and include such details for above stories can also be an option

@ChrsMark

ChrsMark commented Mar 1, 2023

Copy link
Copy Markdown
Member Author

Wondering if writing a blog can be an option to advertise the ongoing work We also have the work of automation through CI where same comments were received. That we have something that users dont know.

If we go for a blog a new story should be created. Also opening a ticket to docs team and include such details for above stories can also be an option

Yes a blogpost is planned for this as listed in #4997.
In this regard, I would suggest to re-evaluate the docs coverage once we have completed #4997 so as to have the big picture of what is missing and what is the best way to cover it.
@MichaelKatsoulis @gizas let me know what do you think folks.

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Comment thread packages/kubernetes/docs/pod-terminated-oomkilled-alert.md Outdated
"aggs": {
"my_rate": {
"rate": {
"field": "kubernetes.pod.network.rx.errors",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"field": "kubernetes.pod.network.rx.errors",
"field": "kubernetes.pod.network.tx.errors",
},
"condition": {
"array_compare": {
"ctx.payload.aggregations.rx_error_rates.buckets": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"ctx.payload.aggregations.rx_error_rates.buckets": {
"ctx.payload.aggregations.tx_error_rates.buckets": {
},
"actions": {
"log_hits": {
"foreach": "ctx.payload.aggregations.rx_error_rates.buckets",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"foreach": "ctx.payload.aggregations.rx_error_rates.buckets",
"foreach": "ctx.payload.aggregations.tx_error_rates.buckets",
"foreach": "ctx.payload.aggregations.rx_error_rates.buckets",
"max_iterations": 500,
"logging": {
"text": "Kubernetes Pod found with high rx error rate: {{ctx.payload.key}} -> {{ctx.payload.avg_minute_rate.value}}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"text": "Kubernetes Pod found with high rx error rate: {{ctx.payload.key}} -> {{ctx.payload.avg_minute_rate.value}}"
"text": "Kubernetes Pod found with high tx error rate: {{ctx.payload.key}} -> {{ctx.payload.avg_minute_rate.value}}"
"xpack": {
"type": "json"
},
"name": "Pod RX Error Rate"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"name": "Pod RX Error Rate"
"name": "Pod TX Error Rate"
@@ -0,0 +1,102 @@
## PID Pressure Kubernetes Node alert

In order to install the PID Pressure Node alert run the following:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you provide a link for PID Pressure explanation?

@@ -0,0 +1,79 @@
## Kubernetes Kubernetes Shipped Docs alert

In order to install the Kubernetes Shipped Docs alert run the following:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you provide one sentence why we need this alert?

@@ -0,0 +1,102 @@
## Unschedulable Kubernetes Node alert

In order to install the Unschedulable Node alert run the following:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also a link for what unsceduble nodes are can be handy

@MichaelKatsoulis

Copy link
Copy Markdown
Contributor

In this regard, I would suggest to re-evaluate the docs coverage once we have completed #4997 so as to have the big picture of what is missing and what is the best way to cover it.

@ChrsMark I agree about the blogspot. Regarding opening a PR to the docs team to include those alerts in the official documentation I would expect this to be also listed in the #4997 so that it can be tracked.

ChrsMark added 2 commits March 1, 2023 16:19
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@ChrsMark

ChrsMark commented Mar 1, 2023

Copy link
Copy Markdown
Member Author

@gizas @MichaelKatsoulis thanks for the feedback folks! I think your comments are now covered. Feel free to have another look when you have the time.

@ChrsMark
ChrsMark requested a review from gizas March 1, 2023 08:31
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@ChrsMark
ChrsMark merged commit afea63c into elastic:main Mar 1, 2023
@elasticmachine

Copy link
Copy Markdown

Package kubernetes - 1.32.0 containing this change is available at https://epr.elastic.co/search?package=kubernetes

agithomas pushed a commit to agithomas/integrations that referenced this pull request Mar 20, 2023
agithomas pushed a commit to agithomas/integrations that referenced this pull request Mar 21, 2023
orestisfl pushed a commit to orestisfl/integrations that referenced this pull request May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants