Giter VIP home page Giter VIP logo

Comments (10)

c-kruse avatar c-kruse commented on May 28, 2024 2

@jadiunr thank you for the proposal and the PRs! Everything looks sound to me.

Pinging @fguimond who is working on pulling things together for a 6.10.0 release early next week. Perhaps we can move forward with this for a 6.10.1 release?

from sensu-go.

echlebek avatar echlebek commented on May 28, 2024 1

One of the biggest changes between sensu classic and sensu-go is that successful events now move all the way through the pipeline. (Previously only failing events did this.) I think this is a great enhancement because it reflects that same spirit of design for metrics thresholds. Thanks for the great issue and PRs.

from sensu-go.

echlebek avatar echlebek commented on May 28, 2024 1

We've accepted this proposal for the main branch, it will be a part of 7.x.

from sensu-go.

jadiunr avatar jadiunr commented on May 28, 2024

Thank you for replying!

I am considering having multiple thresholds for annotations as a better improvement idea.

"metadata": {
  "namespace": "default",
  "annotations": {
    "sensu.io/notifications/ok": "The value of test_metric.value is within the configured threshold (max: 200 (status: warning) 300 (status: critical), actual: 100).",
    "sensu.io/output_metric_thresholds/test_metric.value/max/ok": "The value of test_metric.value is within the configured threshold (max: 200 (status: warning) 300 (status: critical), actual: 100)."
  }
},

My current PR only shows a single threshold value in the annotations for successful events.
In the documentation, the null_status annotation can be displayed multiple threshold values.

{
  "annotations": {
    "sensu.io/output_metric_thresholds/system_host_processes/null": "WARNING: no metric matching \"system_host_processes\" (namespace=\"production\") was found; expected min: 5 - max: 50 (status: warning) min:2 - max: 75 (status: critical)"
  }
}

After submitting PR, but if the work is not too complicated, I would like to make the above improvements.

from sensu-go.

jadiunr avatar jadiunr commented on May 28, 2024

Considering the various use cases for threshold monitoring, it seems that the above proposal (#4987 (comment)) is not as simple as it appears....

Spoiler
---
type: CheckConfig
api_version: core/v2
metadata:
  name: test
spec:
  command: "echo \"test_metric value=250\""
  output_metric_format: influxdb_line
  output_metric_thresholds:
  - name: test_metric.value
    null_status: 2
    thresholds:
    - max: "200"
      min: "50"
      status: 1
    - max: "300"
      min: "25"
      status: 2
  subscriptions:
  - test
  interval: 15
  publish: true
  • An example of a less appropriate output
      "annotations": {
        "sensu.io/notifications/warning": "The value of test_metric.value is within the configured threshold (max: 200 (status: warning) 300 (status: critical), actual: 250).",
        "sensu.io/output_metric_thresholds/test_metric.value/max/ok": "The value of test_metric.value is within the configured threshold (max: 200 (status: warning) 300 (status: critical), actual: 250).",
        "sensu.io/output_metric_thresholds/test_metric.value/max/warning": "The value of test_metric.value exceeded the configured threshold (max: 200 (status: warning) 300 (status: critical), actual: 250).",
        "sensu.io/output_metric_thresholds/test_metric.value/min/ok": "The value of test_metric.value is within the configured threshold (min: 50 (status: warning) 25 (status: critical), actual: 250)."
      }

It may well require more deliberation, but for now, would it be worthwhile just to add to the annotation that the threshold monitoring is normal?

from sensu-go.

jadiunr avatar jadiunr commented on May 28, 2024

I have attempted to improve the output content of the threshold annotations.
(However I think this is a slight deviation from the purpose of the PR 😥 Changed Issue and PR titles.)
e17ae2c

threshold annotations output
root@c3fa6e172611:/sensu-go# ./sensuctl event list --format wrapped-json | jq '.metadata.annotations'
null
{
  "sensu.io/notifications/critical": "The value of test_metric_for_status_max_crit.value exceeded the configured threshold; expected min: 50 - max: 200 (status: warning); expected min: 25 - max: 300 (status: critical); actual: 350",
  "sensu.io/output_metric_thresholds/test_metric_for_status_max_crit.value/critical": "The value of test_metric_for_status_max_crit.value exceeded the configured threshold; expected min: 50 - max: 200 (status: warning); expected min: 25 - max: 300 (status: critical); actual: 350"
}
{
  "sensu.io/notifications/warning": "The value of test_metric_for_status_max_warn.value is within the configured threshold; expected min: 50 - max: 200 (status: warning); expected min: 25 - max: 300 (status: critical); actual: 250",
  "sensu.io/output_metric_thresholds/test_metric_for_status_max_warn.value/warning": "The value of test_metric_for_status_max_warn.value exceeded the configured threshold; expected min: 50 - max: 200 (status: warning); expected min: 25 - max: 300 (status: critical); actual: 250"
}
{
  "sensu.io/notifications/critical": "The value of test_metric_for_status_min_crit.value exceeded the configured threshold; expected min: 50 - max: 200 (status: warning); expected min: 25 - max: 300 (status: critical); actual: 20",
  "sensu.io/output_metric_thresholds/test_metric_for_status_min_crit.value/critical": "The value of test_metric_for_status_min_crit.value exceeded the configured threshold; expected min: 50 - max: 200 (status: warning); expected min: 25 - max: 300 (status: critical); actual: 20"
}
{
  "sensu.io/notifications/warning": "The value of test_metric_for_status_min_warn.value is within the configured threshold; expected min: 50 - max: 200 (status: warning); expected min: 25 - max: 300 (status: critical); actual: 40",
  "sensu.io/output_metric_thresholds/test_metric_for_status_min_warn.value/warning": "The value of test_metric_for_status_min_warn.value exceeded the configured threshold; expected min: 50 - max: 200 (status: warning); expected min: 25 - max: 300 (status: critical); actual: 40"
}
{
  "sensu.io/notifications/critical": "CRITICAL : no metric matching \"test_metric_for_status_null.value\" was found; expected min: 50 - max: 200 (status: warning); expected min: 25 - max: 300 (status: critical)",
  "sensu.io/output_metric_thresholds/test_metric_for_status_null.value/critical": "CRITICAL : no metric matching \"test_metric_for_status_null.value\" was found; expected min: 50 - max: 200 (status: warning); expected min: 25 - max: 300 (status: critical)"
}
{
  "sensu.io/notifications/ok": "The value of test_metric_for_status_ok.value is within the configured threshold; expected min: 50 - max: 200 (status: warning); expected min: 25 - max: 300 (status: critical); actual: 100",
  "sensu.io/output_metric_thresholds/test_metric_for_status_ok.value/ok": "The value of test_metric_for_status_ok.value is within the configured threshold; expected min: 50 - max: 200 (status: warning); expected min: 25 - max: 300 (status: critical); actual: 100"
}

I would like to hear someone's opinion about this one.

from sensu-go.

jadiunr avatar jadiunr commented on May 28, 2024

@c-kruse @echlebek @fguimond Is there any progress on this matter?

from sensu-go.

echlebek avatar echlebek commented on May 28, 2024

Hi @jadiunr, sorry for letting this lapse. I think we can accept the changes targeted at main, but not for 6.x as we have effectively frozen that branch now.

from sensu-go.

jadiunr avatar jadiunr commented on May 28, 2024

Understood.
Then I will withdraw the 6.x PR.

from sensu-go.

jadiunr avatar jadiunr commented on May 28, 2024

Oh, it was already all over.
Thank you for your response!

from sensu-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.