-
Notifications
You must be signed in to change notification settings - Fork 46
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
[Idea] Split core Grafana interactions into its own node module #48
Comments
Alternatively, if somebody else creates one, make this package use it. 😀 |
@stephenyeargin, I'm looking at swapping some of the features to a Can you give this one a look? KeesCBakker#1 |
The only two things we need out of the
In all this time, there still isn't an official SDK published to NPM. You can go to the Swagger documentation and generate a ZIP file of one, but that's a lot of baggage for the handful of endpoints we use. Similar story if you wanted to use one of the published third-party packages. They all appear to be older and not maintained. All that to say, I think you're on the right path here. We would need to make sure we add the class to the From there, you can mock the |
It took some time and a lot of mental gymnastics, but I think I now have a GrafanaClient that only depends on the Class can be viewed here: https://github.com/KeesCBakker/hubot-grafana/pull/1/files#diff-a9f71d2f2ecf00aa3fa557f10b2c5dcdc1779e356082ec556a85b638cc50e900 Now I need to check if this works for my setup (Slack/S3). So far, all the tests are working 😄 . |
In its present state, this Hubot package builds all of the requests to a Grafana instance and handles the interaction with the user. Ideally, these should be two separate modules.
node-grafana
(new)Low-level HTTP(S) request library that handles authentication and common queries against the API (retrieve a list of dashboards, grab a specific dashboard's data, build the URLs for images, etc.).
grafana-hubot
(this package)A much lighter-weight wrapper that uses a configured instance of
node-grafana
to query the API. It also would handle the various adapters for uploading images, such as S3, Slack, HipChat, etc.This should cut down the total lines of code in this package while giving Hubot and other node developers an alternative to relying on the conventions of this package.
/cc #47
The text was updated successfully, but these errors were encountered: