seyren icon indicating copy to clipboard operation
seyren copied to clipboard

Hipchat notifications are too generic

Open anitakrueger opened this issue 9 years ago • 13 comments

I have a lot of checks which cover multiple hosts, i.e. the check uses the following target for example:

collectd.*.load.load.longterm

When an alert is generated, the actual host shows up in the target and I can see that in the PagerDuty notification for example.

In Hipchat however, the message only shows up like follows:

Check Longterm Load has entered its WARN state.

What I would expect is the actual target that triggered the alert showing up in the message.

I see the Hipchat message is being generated by the following code: https://github.com/scobal/seyren/blob/master/seyren-core/src/main/java/com/seyren/core/service/notification/HipChatNotificationService.java#L81

Is there any chance that you can include the alert details in the message like it is being done with the PagerDuty notification? May be make the details optional?

Thanks a bunch!

  • Anita

anitakrueger avatar May 06 '15 20:05 anitakrueger

one of our devs fixed this with a regex in the subscription target. I don't see that he did a PR for it, but I'll remind him on Monday.

Here is the regex working. It does exactly what you want in the hipchat message

http://i.imgur.com/OsS3tCc.png

ezeeetm avatar May 09 '15 01:05 ezeeetm

Ah ok. Trying to understand what the regex does exactly. Is the HipChat notification service parse the target differently?

Thanks a lot!!

anitakrueger avatar May 10 '15 10:05 anitakrueger

using a regex you can say what piece of the target you want to have put into your hipchat message.

Here's the modified code:

https://github.com/johnboker/seyren/blob/master/seyren-core/src/main/java/com/seyren/core/service/notification/HipChatNotificationService.java#L100

If i get some time i'll create a pull request to see if it can be put into the master repo.

johnboker avatar May 11 '15 13:05 johnboker

That would be cool, thanks for the heads up.

anitakrueger avatar May 13 '15 20:05 anitakrueger

@johnboker Any chance you can create a pull request for this? Thanks a bunch

anitakrueger avatar May 27 '15 23:05 anitakrueger

@anitakrueger @johnboker and his wife just had a baby. He's out of commission for a bit....

In the meantime you could always just clone his fork? The change you want is already in his fork (so its essentially what you'd get if he did a PR and they pulled it in)

https://github.com/johnboker/seyren.git

I'm not a java dev, but I'm pretty sure that's all you'd have to do is build it with javac. Then instead of using the official build (wget https://github.com/scobal/seyren/releases/download/1.3.0/seyren-1.3.0.jar ) just use the build you just made.

ezeeetm avatar May 28 '15 11:05 ezeeetm

@johnboker congratulations! I have a 5-month old so I know what out of commission means :)

@ezeeetm I'll try. Haven't compiled any java in a long time, but I'll see how far I get. May be I can submit the PR

anitakrueger avatar May 28 '15 17:05 anitakrueger

@anitakrueger did you make any progress on this? I was just working on this today, going to submit a PR when I clean it up.

sofam avatar Sep 02 '15 17:09 sofam

No, no progress here unfortunately :(

anitakrueger avatar Sep 02 '15 18:09 anitakrueger

@anitakrueger OK, I'll ping you in the patch I'm making, hopefully will be able to finish it this week.

sofam avatar Sep 02 '15 18:09 sofam

@sofam that would be awesome!

anitakrueger avatar Sep 02 '15 19:09 anitakrueger

Was this fixed?

anitakrueger avatar May 03 '16 20:05 anitakrueger

@anitakrueger no, I'll re-open, apologies.

scobal avatar May 03 '16 20:05 scobal