Giter Club home page Giter Club logo

Comments (3)

dbbaughe avatar dbbaughe commented on July 17, 2024

Hi aradhell,

I'm assuming you have a monitor that has a trigger and an action with a slack destination (if wrong let me know!). When the trigger evaluates to true, you are sending the alert information to slack. The first time it is null, and the second time it has no alert id.

Currently the alert being provided to the trigger context and action context variables is the "current" alert that exists as the trigger is being evaluated (which is basically the previous alert if there is one). This is poor wording on our part, and we can look into providing both alerts.

Regarding the missing alert.id, could you provide what your action message looks like?

Thanks,
Drew

from alerting.

aradhell avatar aradhell commented on July 17, 2024

Hi @dbbaughe

You are right.

Please correct me if I am providing wrong message.

If it helps, my action configuration http://prntscr.com/n6vr63 and I also tried with Webhook but the result is same.

first alert message (ctx - context object)

array (
  'monitor' => 
  array (
    '_id' => 'qR_WxGkBTgUv7vc0rrKA',
    '_version' => 7,
    'name' => 'xx Critical',
    'enabled' => true,
  ),
  'trigger' => 
  array (
    'id' => '-h_cxGkBTgUv7vc0ibUf',
    'name' => 'xx critical trigger',
    'severity' => '1',
    'actions' => 
    array (
      0 => 
      array (
        'name' => 'Web Alert',
      ),
      1 => 
      array (
        'name' => 'notify slack xx critical channel',
      ),
    ),
  ),
  'results' => 
  array (),
  'periodStart' => '2019-03-29T10:04:37.564Z',
  'periodEnd' => '2019-03-29T10:05:37.564Z',
  'alert' => NULL,
  'error' => NULL,
)  

and the second one

'monitor' => 
  array (
    '_id' => 'qR_WxGkBTgUv7vc0rrKA',
    '_version' => 7,
    'name' => 'xx Critical',
    'enabled' => true,
  ),
  'trigger' => 
  array (
    'id' => '-h_cxGkBTgUv7vc0ibUf',
    'name' => 'xx critical trigger',
    'severity' => '1',
    'actions' => 
    array (
      0 => 
      array (
        'name' => 'Web Alert',
      ),
      1 => 
      array (
        'name' => 'notify slack xx critical channel',
      ),
    ),
  ),
  'results' => 
  array (),
  'periodStart' => '2019-03-29T10:05:37.564Z',
  'periodEnd' => '2019-03-29T10:06:37.564Z',
  'alert' => 
  array (
    'state' => 'ACTIVE',
    'error_message' => NULL,
    'acknowledged_time' => NULL,
    'last_notification_time' => 1553853937999,
  ),
  'error' => NULL,
)

from alerting.

dbbaughe avatar dbbaughe commented on July 17, 2024

Hi aradhell,

Thanks for finding this issue, it looks like we only bring back those values currently as noted here.
I will make an issue to allow the full alert to be sent.

from alerting.

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.