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

Panel ID is not the same as the Grafana panel ID #26

Closed
klynch opened this issue Nov 11, 2015 · 7 comments
Closed

Panel ID is not the same as the Grafana panel ID #26

klynch opened this issue Nov 11, 2015 · 7 comments
Assignees

Comments

@klynch
Copy link
Collaborator

klynch commented Nov 11, 2015

Hubot Grafana supports the concept of panel ID, where a query like hubot graf db graphite-carbon-metrics:3 returns the third panel of a particular dashboardby iterating through each panel until it finds the Nth one.

This is a little unintuitive. I would expect this value to match the panel ID in Grafana which is used to construct the URL (panelId=#{panel.id}). Using position rather than ID is actually a little inflexible, especially when referencing large overview dashboards that are being tweaked over time. This can lead to saved aliases from becoming broken at inconvenient times.

Since I don't want to necessarily break backwards compatibility, I am not sure how both formats can be supported. Perhaps something along the lines of graph db systems-overview:id34 to represent the panel id?

@stephenyeargin
Copy link
Owner

Shares a lot in common with the frustrations voiced in #20. We may need @torkelo to weigh in on what may be the best way to get a particular panel out of the returned result set from the API with a unique identifier that doesn't "move" once created.

/cc @Tenzer

Relevant code: https://github.com/stephenyeargin/hubot-grafana/blob/master/src/grafana.coffee#L120-L130

@torkelo
Copy link
Collaborator

torkelo commented Nov 12, 2015

I thought hubot grafana used the panel id

@Tenzer
Copy link
Collaborator

Tenzer commented Nov 12, 2015

@torkelo It used to do that, but that was changed in #17 in order to make it easier to find the specific panel you want.

I find the current way of working to be most intuitive, but it may depend on how you normally use the feature. For me/us we don't post the same graph regularly, it's basically only something we do when we want to show our colleagues some specific finding in a specific graph, and in those cases I find it to be easier to either use the name or the number (not ID) of the graph.
It may of course also depend on the amount of graphs which is on each dashboard.

If we want to add support for specifying either the ID or the number of the graph, then it's going to tie into the parsing of panel number and search term which is here: https://github.com/stephenyeargin/hubot-grafana/blob/master/src/grafana.coffee#L60-L67.

@stephenyeargin
Copy link
Owner

So I suppose it will come down to a few things:

  • panelId isn't exposed in the interface (that I'm aware of, short of in the URL), so we would need to include it in the output of a dashboard somehow in case they want to commit it to memory
  • Should we change the default <dashboard>:<integer> behavior to use panelID, or opt for <dashboard>:panel-<integer> for the canonical identifier and the integer format as the "optical" panel identifier.

@stephenyeargin
Copy link
Owner

For what it's worth, I've updated the README in #29 to reflect the current optical identification. I can still see a use for having another processing fork for retrieving by the panelID as well.

@ShonM
Copy link

ShonM commented Dec 27, 2015

Any kind of switch or option to choose between real and visual ID would be hugely appreciated!

@stephenyeargin
Copy link
Owner

Fixed with v1.4.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants