npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hubot-chartroom

v1.3.1

Published

Download graphs from Graphite and upload them to HipChat

Downloads

15

Readme

Hubot Chart Room

Give your Hubot its own room for piles of Graphite graphs

Build Status Code Climate Code Coverage

Downloads Version License

Why not just use hubot-graphite

Actually, you should use hubot-graphite if you can. That has support for saved graphs and is significantly faster to respond.

However, the reason it is significantly faster to respond, is because the majority of what it does is construct a URL for the graph.

This is great if your Graphite is accessible from outside of the LAN, so HipChat can generate a thumbnail and all users in the room can get to the graph. But what makes ChartRoom different is that this actually downloads the image from Graphite and shares it via the HipChat API.

NOTE: This script needs a single preconfigured room to share this image with. However once it is posted, Hubot finds the S3 URL and shares that with the requesting user or room.

This extra step of uploading it to a specific room first is to get around issues with the hubot-hipchat adapter regarding renaming rooms. If a room has been renamed, Hubot will be unable to locate the API ID of the room and so will be unable to share that image directly to the room. So users are just expected to provide an API ID for a room in the environment variables. Images will be shared there first, before their links are copied to the end user/room.

Do I need to use to HipChat adapter?

Well...kind of. Mostly. All of the actual messaging stuff it does is adapter independent. But it uses the HipChat API to get the images up onto the Internet first, then to find the S3 URL for the images. Everything other than that is adapter independent.

So you could, in theory, use any adapter you wanted, as long as you also had valid HipChat API information.

Installation

Install the package from npm

$ npm install hubot-chartroom --save

Then edit your external-scripts.json to include the package

[...,'hubot-chartroom',...]

Configuration

GRAPHITE_SERVER: the hostname/ip of your graphite server.

GRAPH_ROOM_ID: the API ID of a HipChat room to which all graphs will be initially shared:

  • This should be a "service room" without anyone else in it (unless they just want to see random graphs).
  • To get the API ID, log into your account on hipchat.com, go to the room list then click on your room to find it.
  • As I say elsewhere, this is just where graphs get uploaded, they eventually end up shared with the right room/user.

HIPCHAT_TOKEN: an API token for your hubot can use for uploading to hipchat.

  • You need to log into hipchat.com as your hubot, click Edit Profile, then click API to generate your token.

(optional)

SUCCESS_MESSAGE: What hubot says after it has completed a message. Defaults to (yougotitdude)

Use

The user saves and requests a graph...

[Room: warroom]
<Norm> hubot save graph jenkinscpu as target=collectd.jenkins001.CPU.load
<Hubot> You can now use "graph me jenkinscpu" to see this graph.
<Norm> hubot graph me jenkinscpu
<Hubot> (yougotitdude) Fetching graph and uploading to HipChat...

Hubot fetches the graph from Graphite and uploads it to the configured room...

[Room: hubot_graphs]
<Hubot> upload.png 539bdb5b-9ff4-2e7d-8cfa-5f889c50645b

Hubot finds the URL of the file in the message containing the above GUID and posts it to the requesting room/user

[Room: warroom]
<Hubot> https://s3.amazonaws.com/uploads.hipchat.com/....etc