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

Reporting: ability to create a report from any Kibana URL #55622

Closed
stacey-gammon opened this issue Jan 22, 2020 · 6 comments
Closed

Reporting: ability to create a report from any Kibana URL #55622

stacey-gammon opened this issue Jan 22, 2020 · 6 comments
Labels
(Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead enhancement New value added to drive a business result Feature:Reporting:Framework Reporting issues pertaining to the overall framework impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. needs-team Issues missing a team label

Comments

@stacey-gammon
Copy link
Contributor

In order to implement the feature request of creating images server side as part of alerts and actions, we will need this kind of service. It happens to be a goal of the reporting team anyway, since this will create a clear line of responsibilities - apps manage there URLs, reporting just takes a URL and creates an image from it (perhaps with some optional extra info like title, pdf or png, etc).

This feature, along with #25247, would allow for threshold alerts to create a preview of the embeddable it was generated from to do something like:

createThresholdAlert(sourceEmbeddable, alertParameters, alertAction) {
  const previewUrl = directAccessLinkPlugin.getLinkGenerator('embeddableReportingViewer').createLink(sourceEmbeddable.getInput());
  alertAction.attachImageUrl(previewUrl);
}

and if had a chat ops service, it could use this like so:

route.add('api/chatops', (params) => {
  const { command, ...args } = parse(params);
  if (command === 'dashboard') {
    const { dashboardId, filters, query, timeRange } = args;

    // Use the direct access link generator to create a link for the dashboard but in preview mode.
    const previewUrl = directAccessLinkPlugin.getLinkGenerator('dashboardReportPreview').createLink({
      dashboardId, filters, query, timeRange
    });
    const png = await ReportingPlugin.generatePng(previewUrl);

    // Use the direct access link generator to create a link for the main dashboard app page.
    const mainUrl = directAccessLinkPlugin.getLinkGenerator('dashboardApp').createLink({
      dashboardId, filters, query, timeRange
    });

    return { message, image: png, link: mainUrl};
  
  }
}); 
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-reporting-services (Team:Reporting Services)

@tsullivan
Copy link
Member

Reporting Services team will provide a way for plugins to generate reports by distributing the load of multiple Kibana instances (aka queueing an immediate task with Task Manager, also used to schedule reports). That should be helpful for environments where Kibana is already distributed to handle large workloads: generating a screenshot is the biggest load you can put onto the Kibana server as far as I know.

There will also be direct access to the function that returns an observable to the screenshot result(s), which developers would be able to access when they aren't concerned with distributing the workload and want the screenshot to just run on the local instance. That might be a better way to go for alerts, when you need the result ASAP.

These ideas have just been slowly guiding the way we've worked on Reporting since we knew we are going to move to using Task Manager and eventually launch Scheduled Reports. I feel like our implementations of PNG and multi-page PDF export have gotten more general, which led to the having functions in our libraries that could be wired out for a public contract exposed by the Reporting plugin.

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServices)

@tsullivan tsullivan added (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead and removed Team:Reporting Services labels Dec 17, 2020
@tsullivan tsullivan added Team:Reporting Services enhancement New value added to drive a business result labels Feb 25, 2021
@tsullivan
Copy link
Member

tsullivan commented May 11, 2021

Hi @stacey-gammon can you talk about this issue in a more current context? How important is this for Alerting, or anyone else? Is it blocking anything?

I'm thinking off kicking off refactoring that would break out the screenshot modules in Reporting into a separate plugin that Reporting would depend on. When an alert triggers the need to generate a screenshot, I think it's appropriate to make a screenshot directly, instead of going through the Reporting "queue" where a job is picked up and stores the screenshot in a report. We just need to make sure that Kibana is only running a single headless browser child process at a time, regardless if it called from Alerting or Reporting.

cc @jloleysens @dokmic

@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels May 13, 2021
@tsullivan
Copy link
Member

`const png = await ReportingPlugin.generatePng(previewUrl);`

I don't think we would write it this way, since the png variable isn't a report, it's an actual image. We should allow plugins to programmatically create reports, but that would mean queueing a job that can be downloaded later.

What this sounds like is the need to move the screenshot code and the layout definitions out of Reporting into a new plugin, and have multiple plugins get the ability to create screenshot images.

@exalate-issue-sync exalate-issue-sync bot added 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 loe:weeks and removed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort loe:medium Medium Level of Effort labels May 13, 2021
@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. and removed impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. labels Jun 1, 2021
@exalate-issue-sync exalate-issue-sync bot added impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. and removed impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. labels Oct 27, 2021
@tsullivan
Copy link
Member

Closing for #116503

@sophiec20 sophiec20 added Feature:Reporting:Framework Reporting issues pertaining to the overall framework and removed (Deprecated) Team:Reporting Services labels Aug 21, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
(Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead enhancement New value added to drive a business result Feature:Reporting:Framework Reporting issues pertaining to the overall framework impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. needs-team Issues missing a team label
Projects
None yet
Development

No branches or pull requests

5 participants