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

[expressions] inspector alerting adapter #78277

Closed
Tracked by #71560
ppisljar opened this issue Sep 23, 2020 · 3 comments · Fixed by #106514
Closed
Tracked by #71560

[expressions] inspector alerting adapter #78277

ppisljar opened this issue Sep 23, 2020 · 3 comments · Fixed by #106514
Labels
Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) Feature:Inspector Inspector infrastructure and implementations impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort

Comments

@ppisljar
Copy link
Member

In order to support alerting on expressions a new adapter should be added to inspector, to which every function producing a render output type should log the received datatable decorated with information about dimensions.

Alerting requires a predictable data structure it can generate alerts on. As every function that outputs render type can output anything we cannot use that directly. One of the options discussed was dropping that last function from expression to get the raw data before it was pre-processed by the chart function, however that has certain limitations for example chart might be receiving the actual data as one of the arguments instead on the input context.

Also, to make it easier for user to configure the alert it would be beneficial if we would know more than just the actual data but dimension information with it, like column 1 is X axis value and column 2 is Y axis value.

All of this information is only available to the chart function that outputs the render context type, so this function should log this data to this new inspector adapter.

Proposed structure on the alerting inspector adapter:

interface AlertingColumn {
  id: string,
  name: string,
  dimension: string,
  field?: string,
}

interface AlertingTable {
  columns: AlertingColumn[]
  rows: DatatableRows,
}
```
@ppisljar ppisljar added Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) Feature:Inspector Inspector infrastructure and implementations impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort Team:AppArch labels Sep 23, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@ppisljar
Copy link
Member Author

Possibly we don't need to introduce a new adapter as the datatable adapter behaves pretty much the way we want it. Currently its responsibility of every chart function to log datatable to inspector using handlers.inspectorAdapters.logDatatable. The only missing information at this point is the dimension information, which could be added to the same datatable.

  1. we could just use column.name. If column names would be semantic that could give us the information we need. For example imagine xy chart with two metrics, which has a table with 3 columns, the first's name is x-axis, the seconds y-axis Sum of Bytes and the third y-axis Count

chart function could be responsible for providing correct names to the columns before the datatable is sent to inspector.

  1. introduce a new meta property on the columns, something like column.meta.dimensionName

@flash1293
Copy link
Contributor

I would prefer the column.meta.dimensionName approach because we can enforce allowed values via types. Using the names feels ad-hoc and we would have to make sure to not modify the table that's passed along because Lens shows column names to the user.

@exalate-issue-sync exalate-issue-sync bot added loe:large Large Level of Effort and removed loe:medium Medium Level of Effort labels Apr 20, 2021
@exalate-issue-sync exalate-issue-sync bot added loe:medium Medium Level of Effort and removed loe:large Large Level of Effort labels Apr 29, 2021
@petrklapka petrklapka added 1 and removed 1 labels May 10, 2021
@exalate-issue-sync exalate-issue-sync bot changed the title inspector alerting adapter [expressions] inspector alerting adapter Jul 12, 2021
kibana-app-arch automation moved this from To triage to Done in current release Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) Feature:Inspector Inspector infrastructure and implementations impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort
Projects
kibana-app-arch
  
Done in current release
Development

Successfully merging a pull request may close this issue.

4 participants