Giter Site home page Giter Site logo

Comments (12)

stephenyeargin avatar stephenyeargin commented on June 17, 2024 2

See #67. If anyone has a moment, I'd love a 👍 after testing.

from hubot-grafana.

mfilotto avatar mfilotto commented on June 17, 2024

dashboard.rows seems to be missing ?...

from hubot-grafana.

stephenyeargin avatar stephenyeargin commented on June 17, 2024

@mfilotto It looks like there were some breaking changes in v5 we're not ready for. This has happened in previous versions, so I need to better understand what changed.

# Handle refactor done for version 2.0.2+
if dashboard.dashboard
# 2.0.2+: Changed in https://github.com/grafana/grafana/commit/e5c11691203fe68958e66693e429f6f5a3c77200
data = dashboard.dashboard
# The URL was changed in https://github.com/grafana/grafana/commit/35cc0a1cc0bca453ce789056f6fbd2fcb13f74cb
apiEndpoint = 'dashboard-solo'
else
# 2.0.2 and older
data = dashboard.model
apiEndpoint = 'dashboard/solo'

from hubot-grafana.

mechko avatar mechko commented on June 17, 2024

I've got a similar issue, Grafana 5.0.0 as well, hubot-grafana 1.8.0. graf list command is working, graf db not. This is the output when trying to db graf db foo:

Error Stacktrace:

hubot_1 | [Thu Mar 08 2018 13:23:24 GMT+0000 (UTC)] ERROR TypeError: Cannot read property 'length' of undefined
hubot_1 | at /home/hubot/node_modules/hubot-grafana/src/grafana.coffee:167:7
hubot_1 | at /home/hubot/node_modules/hubot-grafana/src/grafana.coffee:314:14
hubot_1 | at IncomingMessage. (/home/hubot/node_modules/hubot/node_modules/scoped-http-client/src/index.js:95:22)
hubot_1 | at emitNone (events.js:72:20)
hubot_1 | at IncomingMessage.emit (events.js:166:7)
hubot_1 | at endReadableNT (_stream_readable.js:923:12)
hubot_1 | at nextTickCallbackWith2Args (node.js:511:9)
hubot_1 | at process._tickCallback (node.js:425:17)

Debug output with dashboard object:

hubot_1 | [Thu Mar 08 2018 13:23:24 GMT+0000 (UTC)] DEBUG Executing listener callback for Message 'b graf db foo'
hubot_1 | [Thu Mar 08 2018 13:23:24 GMT+0000 (UTC)] DEBUG [ 'b graf db foo',
hubot_1 | 'foo',
hubot_1 | undefined,
hubot_1 | index: 0,
hubot_1 | input: 'b graf db foo' ]
hubot_1 | [Thu Mar 08 2018 13:23:24 GMT+0000 (UTC)] DEBUG foo
hubot_1 | [Thu Mar 08 2018 13:23:24 GMT+0000 (UTC)] DEBUG { from: 'now-6h', to: 'now' }
hubot_1 | [Thu Mar 08 2018 13:23:24 GMT+0000 (UTC)] DEBUG
hubot_1 | [Thu Mar 08 2018 13:23:24 GMT+0000 (UTC)] DEBUG []
hubot_1 | [Thu Mar 08 2018 13:23:24 GMT+0000 (UTC)] DEBUG false
hubot_1 | [Thu Mar 08 2018 13:23:24 GMT+0000 (UTC)] DEBUG false
hubot_1 | [Thu Mar 08 2018 13:23:24 GMT+0000 (UTC)] DEBUG false
hubot_1 | [Thu Mar 08 2018 13:23:24 GMT+0000 (UTC)] DEBUG { meta:
hubot_1 | { type: 'db',
hubot_1 | canSave: true,
hubot_1 | canEdit: true,
hubot_1 | canAdmin: false,
hubot_1 | canStar: true,
hubot_1 | slug: 'foo',
hubot_1 | url: '/d/CtkEB7gmz/foo',
hubot_1 | expires: '0001-01-01T00:00:00Z',
hubot_1 | created: '2018-03-08T13:22:22Z',
hubot_1 | updated: '2018-03-08T13:22:49Z',
hubot_1 | updatedBy: 'admin',
hubot_1 | createdBy: 'admin',
hubot_1 | version: 3,
hubot_1 | hasAcl: false,
hubot_1 | isFolder: false,
hubot_1 | folderId: 0,
hubot_1 | folderTitle: 'General',
hubot_1 | folderUrl: '' },
hubot_1 | dashboard:
hubot_1 | { annotations: { list: [Object] },
hubot_1 | editable: true,
hubot_1 | gnetId: null,
hubot_1 | graphTooltip: 0,
hubot_1 | id: 2,
hubot_1 | links: [],
hubot_1 | panels: [ [Object] ],
hubot_1 | schemaVersion: 16,
hubot_1 | style: 'dark',
hubot_1 | tags: [],
hubot_1 | templating: { list: [] },
hubot_1 | time: { from: 'now-6h', to: 'now' },
hubot_1 | timepicker: { refresh_intervals: [Object], time_options: [Object] },
hubot_1 | timezone: '',
hubot_1 | title: 'foo',
hubot_1 | uid: 'CtkEB7gmz',
hubot_1 | version: 3 } }
hubot_1 | [Thu Mar 08 2018 13:23:24 GMT+0000 (UTC)] DEBUG []

Fun Fact: The Grafana HTTP API doc has the rows property in all example dashboard objects, also for v5.0: http://docs.grafana.org/http_api/dashboard/#get-dashboard-by-uid (haven't debugged this further, don't what endpoint you're calling.

If you need help for debugging / testing, please let me know.

from hubot-grafana.

stephenyeargin avatar stephenyeargin commented on June 17, 2024

Looping in @torkelo to see if he has any insight into what might have changed in v5.0.

from hubot-grafana.

stephenyeargin avatar stephenyeargin commented on June 17, 2024

This change (under 5.0.0-beta1) may be related:

https://github.com/grafana/grafana/blob/master/CHANGELOG.md#http-api

from hubot-grafana.

mfilotto avatar mfilotto commented on June 17, 2024

Search by slug is deprecated and will be remove, search by uid should be used instead.
http://docs.grafana.org/http_api/dashboard/#deprecated-resources

Another impact : graf list displays dbs and folders, so the search should be filtered by type data-db
http://docs.grafana.org/http_api/folder_dashboard_search/

from hubot-grafana.

stephenyeargin avatar stephenyeargin commented on June 17, 2024

So the question will become how to maintain functionality for both<= v4 and v5.

from hubot-grafana.

mechko avatar mechko commented on June 17, 2024

Tested this, works for my Grafana 5 instance. Many thanks 👍

from hubot-grafana.

stephenyeargin avatar stephenyeargin commented on June 17, 2024

@mfilotto I've knocked out two of the items you've highlighted, but the deprecated bit can be tackled in a new Issue/PR since the current functionality isn't broken per se, but will be in the future. Going to send out a release this morning with #67 in it.

from hubot-grafana.

stephenyeargin avatar stephenyeargin commented on June 17, 2024

Released with v2.0.0.

from hubot-grafana.

mfilotto avatar mfilotto commented on June 17, 2024

It's working just fine 👍
Thanks @stephenyeargin

from hubot-grafana.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.