Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Librato integration #648

Closed

Conversation

RafaelloLollipop
Copy link

Add Librato integration

#68

@smarx
Copy link

smarx commented Apr 11, 2016

Automated message from Dropbox CLA bot

@VallHer, it looks like you've already signed the Dropbox CLA. Thanks!

@RafaelloLollipop RafaelloLollipop changed the title Librato integration Add Librato integration Apr 11, 2016
name <code>librato</code>.</p>

<p>Next, on your <a href="/#settings" target="_blank">Zulip settings
page</a>, create an Librato bot. Please note the bot name and API key. Then:</p>
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

s/an/a/ before Librato bot

@timabbott
Copy link
Sponsor Member

@VallHer thanks for working on this! I posted a few comments.

@timabbott
Copy link
Sponsor Member

Also, you should squash the two commits together.

@timabbott
Copy link
Sponsor Member

It'd be great if we could get feedback from the Librato folks or someone who has used Librato on the message format -- I pinged the person who opened the original issue to see if he's willing to take a look. The format is relatively verbose compared to how most of our integrations read, but I'm not sure if that's the nature of the Librato service.

@RafaelloLollipop RafaelloLollipop force-pushed the librato-integration branch 2 times, most recently from 8ed3d2c to e1a0aee Compare April 11, 2016 19:19
@RafaelloLollipop
Copy link
Author

@timabbott
Slack example:
http://wrzuc.se/images/570bfee268230.png

I can change it to slack style, should I?

@timabbott
Copy link
Sponsor Member

I think that's mostly reasonable, except that Slack doesn't have topics/threading, and we should move some part of that content into the topic (is "runbook" the machine here? If so maybe "runbook ToHighTemperatureAlert" would be a good thread name?).

It might be helpful to have a few more example Librato alerts in the fixtures that we can work with...

@zack-ahdach
Copy link

@timabbott I've reviewed screenshot 006 and as far as I'm concerned it looks fine. The only improvement I can think of is adding some color to easily recognise wether an alert is new or resolved.
For reference, here's a "new" alert (green) and a "resolved" alert (blue) from Librato in Slack.

screen shot 2016-04-12 at 10 38 45

@timabbott
Copy link
Sponsor Member

Cool. We don't currently have a way to do that variable color thing in Zulip, but it might be a formatting capability worth adding; shouldn't be too hard to do. Certainly I don't think green for new and blue for resolved is the right approach :). @VallHer does this give you the info you need to do a revised version?

Also I guess this needs to be rebased across the tests refactoring I merged yesterday.

@RafaelloLollipop RafaelloLollipop force-pushed the librato-integration branch 4 times, most recently from f52a8ec to 5c0807e Compare April 12, 2016 22:39
@RafaelloLollipop
Copy link
Author

@zack-ahdach
Thanks for feedback

@timabbott

  • update structure of notification (006.png)
  • add new fixture with longer example
  • add handling of "cleared" message (+tests)
  • default topic is unique for error name
  • add option to change default topic

EDIT:
I find that i can implement charts functionality, so don't close this request yet!

@RafaelloLollipop RafaelloLollipop force-pushed the librato-integration branch 2 times, most recently from 71d6f15 to 8f296cd Compare April 13, 2016 12:00

@api_key_only_webhook_view
@has_request_variables
def api_librato_webhook(request, user_profile, stream=REQ(default='librato'), topic=REQ(default=None)):
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

This line is too long; the topic argument should be on a second line.

@timabbott
Copy link
Sponsor Member

OK will wait for the charts stuff to show up!

@RafaelloLollipop
Copy link
Author

Ok I added option to handle charts. We need to wait for guys from librato for better solution.

@RafaelloLollipop RafaelloLollipop force-pushed the librato-integration branch 2 times, most recently from f388baa to 7a0732e Compare April 14, 2016 11:43
@RafaelloLollipop
Copy link
Author

Ok i found how to write service for Librato, however i need also some more time beacuse it is in Ruby and i don't have experience at all.

@timabbott
Copy link
Sponsor Member

timabbott commented Apr 19, 2016

What do you mean by "write service for Librato"? Is the idea to do a non-webhook integration?

@RafaelloLollipop
Copy link
Author

RafaelloLollipop commented Apr 19, 2016

Librato webhooks allow us to handle only 'Alert' module.
image
To use snaps, we need to create our integration(service). It looks the same as webhook at all.
image

Easy way: we can totally copy Slack service and it will be (propably) work.
However i think it is good possibility to little expand menu and add for example topic input.

@timabbott
Copy link
Sponsor Member

Ahh, OK, that makes sense!


<p><b>Congratulations! You're done!</b><br /> When a snapshot comes, you'll get a Zulip notification that looks like this:</p>

<p><img class="screenshot" src="/static/images/integrations/librato/009.png" /></p>
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Can you retake these screenshots showing the stream/topic recipient bar? That's how the screenshots work in our other integrations. While you're doing it, can you give the bot the name "Librato Bot" to match the bot naming style of the other integrations.

Also, you should line wrap the text in a lot of these paragraphs, like we do for the other integrations.

Thanks!

@timabbott
Copy link
Sponsor Member

Posted a few comments on the details of the documentation for this.

Thanks for building this @VallHer, it's looking really good.

@timabbott
Copy link
Sponsor Member

@VallHer how are you doing on this? If you're too busy to finish this, let me know and perhaps someone else can pick it up.

@RafaelloLollipop
Copy link
Author

@timabbott
I have a problem with ruby service. To make this integration completely we need to copy almost slack integration and provide zulip one. However i don't have any experience in Ruby.
https://github.com/librato/librato-services

Or i just can finish integration without snapshot. However it will be better if someone can help me here.

@timabbott
Copy link
Sponsor Member

@VallHer if we just finished and merged the Librato integration without snapshot support, would the work done need to be thrown away to add snapshot support, or would it be a more incremental extension? If the extension would be incremental, I'd recommend we finish and merging without snapshot support, and adding snapshot support can be a future project.

Otherwise, @TomaszKolek do you know Ruby / are you interested in learning it to help with this?

@TomaszKolek
Copy link

@timabbott
Some time (~3 years) ago I wrote one project in RoR. But yes, I'm interesting in learning it!

@TomaszKolek
Copy link

TomaszKolek commented Jul 13, 2016

@timabbott
I did a research and my conclusions are:

  1. We should end this PR and we merge it as a webhook integration.
  2. We should create service (probably with cooperation with somebody from Librato)
  3. I guess we'll be waiting some time before merging it into Librato so it's not worth to wait for it with a merge.

@VallHer please confirm my conclusions. Or not If I'm talking nonsense.
Also please tell me if you'd like to end this ticket (I mean adjusting with new style webhook/tests) or I can do it?

@RafaelloLollipop
Copy link
Author

@TomaszKolek
Yes, you are right.

I will be glad if you can do it instead of me. I actually lost 'connection' with project and forgot basic things.

@timabbott
Copy link
Sponsor Member

@TomaszKolek that's reasonable to me; I think we should go ahead and merge a webhook integration. Then if we find time to add a Librato service, we can have that service use a similar format to the existing webhook integration for sending data over, to reuse the existing code.

@timabbott
Copy link
Sponsor Member

Closing this since development is proceeding on #1749.

@timabbott timabbott closed this Sep 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants