Hi,

I 've had a look at SLING-6855 that Clint contributed, and I have a
slightly different proposal.

The goal is to declare health check results that remain valid for a
specified time or forever.

For example, a quota has been tripped - warn for 30 minutes.

Or an events queue overflowed and the instance is considered damaged -
raise a critical alarm forever.

With the current SLING-6855 one can raise such alarms but they are all
grouped in a single health check - doing this results in that HC
having both A and B tags and returning two results:

  ResultRegistry reg = sling.getService(ResultRegistry.class)
  reg.put("testA", new Result(Result.Status.CRITICAL, "It's
critical"), null, "A");
  reg.put("testB", new Result(Result.Status.WARN, "B is just a
warning"), null, "B");

So if you query for tag B you get both results, although they are unrelated.

I would prefer creating one HC for each such alarm, and rename the
service StickyResults instead of ResultRegistry.

So the above example (with service interface renamed) would cause two
HCs to be created:

1) StickyResult (testA) ; status CRITICAL, message "it's critical", tag A
2) StickyResult (testB) ; status WARN, message "B is just a warning", tag B

The HCs are keyed based on the "identifier" parameter, so in the above
example putting another "testB" overwrites the existing one.

Clint and others, WDYT?

-Bertrand

Reply via email to