Giter Site home page Giter Site logo

Comments (10)

stephenyeargin avatar stephenyeargin commented on June 21, 2024

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?

from hubot-grafana.

Seraf avatar Seraf commented on June 21, 2024

@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 ?

from hubot-grafana.

stephenyeargin avatar stephenyeargin commented on June 21, 2024

(Sorry, meant "could work" ... would definitely require some work to do it.)

from hubot-grafana.

Tenzer avatar Tenzer commented on June 21, 2024

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?

from hubot-grafana.

stephenyeargin avatar stephenyeargin commented on June 21, 2024

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.

from hubot-grafana.

Seraf avatar Seraf commented on June 21, 2024

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 [email protected] 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
#20 (comment)
.

from hubot-grafana.

stephenyeargin avatar stephenyeargin commented on June 21, 2024

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.


Search Dashboards

GET /api/search/

Status Codes:

  • query – Search Query
  • tags – Tags to use
  • starred – Flag indicating if only starred Dashboards should be returned
  • tagcloud - Flag indicating if a tagcloud should be returned

Example Request:

    GET /api/search?query=MyDashboard&starred=true&tag=prod HTTP/1.1
    Accept: application/json
    Content-Type: application/json
    Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

Example Response:

    HTTP/1.1 200
    Content-Type: application/json

    [
        {
            "id":1,
            "title":"Production Overview",
            "uri":"db/production-overview",
            "type":"dash-db",
            "tags":[],
            "isStarred":false
        }
    ]

from hubot-grafana.

Seraf avatar Seraf commented on June 21, 2024

That makes sense, but does it limit to dashboard only ?

from hubot-grafana.

stephenyeargin avatar stephenyeargin commented on June 21, 2024

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.

from hubot-grafana.

stephenyeargin avatar stephenyeargin commented on June 21, 2024

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.

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.