Closed Seraf closed 6 years ago
I think this would work, but I'm not 100% sure on how to best do this for the user as far as the syntax for the commands. I'm presuming &
would not be permitted in a particular panel's name?
@stephenyeargin It's actually not working. I was saying &
but as it's used in the url it may be a bad idea. I was thinking about an operator to do some filtering. Maybe use the comma as a separator for an AND operator, and consider that everything between the :
and the whitespace is a list of terms that should appear in the panel title ?
(Sorry, meant "could work" ... would definitely require some work to do it.)
I'm slightly against this, mostly because the syntax for Hubot just would get more and more difficult to parse and remember. Perhaps you instead could use the number of the graph on the dashboard to show the graph you want?
Spit-balling some thoughts:
So if I understand the goal, it is to return more than one graph panel in a particular dashboard matching on a string. I agree with @Tenzer that there's a need to keep the syntax as easy to follow as possible -- It's already a bit of a challenge to handle templating and panel declarations as it is.
Perhaps a compromise would be to have a command that could fuzzy search through the entirety of your Grafana install for a particular panel title. Ideally, this would be exposed via an API in Grafana (I don't believe any such thing exists yet). The search results would give you the dashboard and numeric key for normal lookup. From there, you could save it in with hubot-alias
for any graph you refer to frequently.
Hello, the goal is not to play wih multiple graf but allow to have more search option than a keyword. The goal is to be able to search something like "keyword1 AND keyword. I agree that it can be done on both side, on the api (and it probably will be better) and on frontend by filtering on all result.
Of course it should be able to return one or multiple graphs acccording the search
Le sam. 24 oct. 2015 06:38, Stephen Yeargin notifications@github.com a Γ©crit :
Spit-balling some thoughts:
So if I understand the goal, it is to return more than one graph panel in a particular dashboard matching on a string. I agree with @Tenzer https://github.com/Tenzer that there's a need to keep the syntax as easy to follow as possible -- It's already a bit of a challenge to handle templating and panel declarations as it is.
Perhaps a compromise would be to have a command that could fuzzy search through the entirety of your Grafana install for a particular panel title. Ideally, this would be exposed via an API in Grafana (I don't believe any such thing exists yet). The search results would give you the dashboard and numeric key for normal lookup. From there, you could save it in with hubot-alias for any graph you refer to frequently.
β Reply to this email directly or view it on GitHub https://github.com/stephenyeargin/hubot-grafana/issues/20#issuecomment-150753329 .
So there is this: http://docs.grafana.org/reference/http_api/#search-dashboards
We could implement a hubot graf search <term> [tag:<tag>]
endpoint that queries against the spec. That would allow any of the native search capability (within Grafana) to be leveraged.
GET /api/search/
query
β Search Querytags
β Tags to usestarred
β Flag indicating if only starred Dashboards should be returnedtagcloud
- Flag indicating if a tagcloud should be returned GET /api/search?query=MyDashboard&starred=true&tag=prod HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
HTTP/1.1 200
Content-Type: application/json
[
{
"id":1,
"title":"Production Overview",
"uri":"db/production-overview",
"type":"dash-db",
"tags":[],
"isStarred":false
}
]
That makes sense, but does it limit to dashboard only ?
It appears that it will only search the dashboard (for now). Perhaps in the future it will be able to match on more than the Dashboard title when the API supports it (returning individual panel indexes).
I've opened #22 that will leverage that endpoint a bit better.
We implemented a search feature not too long after this was opened. I believe we tackled the easier feature and left the more complex notation for searching individual panels out. Calling this closed, but can be filed as a new, specific request for how you would want to interact with the bot.
Hello,
hubot graf db graphite-carbon-metrics:cpu - Get only the panels containing "cpu" (case insensitive) in the title
A great improvement could be to search forcpu&memory
orcpu&<text>
My use case here, is that I have a row with a panel for each host. I would like to be able to display this panel but only for a host (as I don't use host var for this dashboard)
What do you think about this ?
Thanks