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

Kibana: Define variables for Dashboards and Embeddables #33927

Closed
0asp0 opened this issue Mar 27, 2019 · 5 comments
Closed

Kibana: Define variables for Dashboards and Embeddables #33927

0asp0 opened this issue Mar 27, 2019 · 5 comments
Labels
Feature:Dashboard Dashboard related features Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) Feature:Lens Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@0asp0
Copy link

0asp0 commented Mar 27, 2019

Describe the feature:
Timelion and Time Series Builder have an amazing feature: to display one or more curves of different times (using offset) in one panel, which is great for comparing specific KPIs from multiple times.
Unfortunately the offset is currently statically set within the visualization.

We need the offset to be defined / overwritten on dashboard level, because it is impossible to fix foresee the needed offset on visualization level and we don't want to need to change the main visualization all the time we need a different offset.

So we need some kind of variable control element (maybe like a control visualization) where we can set the following:

  • edit field: variable name -> set variable name here
  • radio button method chooser:
    • static Value
      • opens an edit field to set a specific static
      • shows a dropdown to select type of variable (String, number, date, etc.)
      • you should be able to set offset directly like "-1w" or other variables for later use like "ThisIsMyTestrunIdentifier"
    • timestamps
      • opens a window to select 2 timestamps like this one
        image
      • calculates the offset in seconds and adds the unit "s" at the and. So that it is accepted by offset syntax of timelion and Time Series Builder
    • advanced query input
      • show two edit fields, one for each timestamp for defining a query (e.g. in timelion style) to query the timestamps needed.
        • (e.g. "metric=min:@timestamp,q="logType:loadtest AND testrun.iteration: 1").
        • It should be possible to reference to variables already defined in the query like:
          metric=min:@timestamp,q="logType:loadtest AND testrun.iteration: {{testrunBaseline}} -> which references previously variable testrunBaseline
    • respect global filters
      • 2 radio buttons or dropdown list to select option to respect / ignore global dashboard filters
    • updateType
      • 2 radio buttons or dropdown list to choose between automatic and manual.
      • manual: variables are only updated when clicking update button of the element
        • for me thats the most important option
      • auto: variables are always updated during dashboard reloading / applying filters, etc.
        • I don't really know, if there is a usecase for auto. So this one is optional, maybe someone likes it.
    • Update-Button
      • by pressing the update button the variables / offsets are updated / queries for calculating the offsets are processed. Dashboard will reload respecting the new calculation of the variables.
  • the data entered in the variable control element needs to be edited on dashboard level.
  • the data entered in the variable control element should be saved as dashboard level like dashboard filters are working.

The above describes the possibilities for one variable. The element should have the possibility to handle multiple variables. So give the element the possibility to add / remove the variables.

I imagine following workflows:

  • as precondition add the variable element described above to dashboard (assuming that this will be realized as some control visualization)

  • timelion / VTSB has defined offset, referencing to {{myOffset}}

  • simple workflow:

    • goto variable control element
    • click add
    • set variable name myOffset
    • choose timepicker
    • select 1st and 2nd timestamp
    • hit update button.
    • dashboard is reloaded
  • advanced workflow

    • choose a big time interval which contains all testruns (contender and baseline)
    • goto variable control element
    • click add
      • choose static value and set baseline=testrun1
    • click add
      • choose static value and set contender=testrun25
    • choose advanced quer input
    • query 1: metric=min:@testrun.time.start,q="logType:testruns AND testrun.name: {{baseline}}"
    • query 2: metric=min:@testrun.time.start,q="logType:testruns AND testrun.name: {{contender}}"
    • hit update
    • select the timestamp of contender in dashboard to see contender and baseline as overlay in the same dashboard

As workaround we currently created an html page for entering timestamps to calculate the offset. Then we used a lot of logic to build timelion dashboards via a very very very ... long url.
image

This is the result in kibana (red line showing no / contender, gray line is showing baseline (offset))
image

Describe a specific use case for the feature:

  • testing
    • compare KPIs of baseline and contender(s)
  • production
    • compare today (damn we have an incident today) with yesterday at the same time (there everything was fine)
    • compare KPIs of this month with 3 month ago for capacity management
@chrisdavies chrisdavies added Feature:Timelion Timelion app and visualization triage_needed labels Mar 28, 2019
@timroes timroes added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Mar 11, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@timroes timroes added Feature:Dashboard Dashboard related features Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas and removed triage_needed labels Mar 18, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@ghudgins
Copy link
Contributor

ghudgins commented Mar 4, 2022

Use case: A user wants to bind a variable to a data view (index pattern) so they can offer their users the ability to apply the same visualizations to different data views (with the same schema) without having to offer multiple dashboards

@flash1293
Copy link
Contributor

@ghudgins This is a valid use case - a workaround right now is to use a data view which matches all of the targeted indices, then adding a filter on the _index field to narrow it down.

@ghudgins ghudgins changed the title Kibana: Define variables, e.g. for offset for timelion and Visual Timeseries Builder via GUI Kibana: Define variables for Dashboards and Embeddables Jun 21, 2022
@ThomThomson
Copy link
Contributor

Closing this in favour of #134706 which is a more generic system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Dashboard Dashboard related features Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) Feature:Lens Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

8 participants