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

[Logs UI] Register function(s) for homepage data retrieval #68531

Closed
jasonrhodes opened this issue Jun 8, 2020 · 2 comments · Fixed by #69999
Closed

[Logs UI] Register function(s) for homepage data retrieval #68531

jasonrhodes opened this issue Jun 8, 2020 · 2 comments · Fixed by #69999
Assignees
Labels
Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Milestone

Comments

@jasonrhodes
Copy link
Member

jasonrhodes commented Jun 8, 2020

To facilitate observability homepage data retrieval, each observability app must register a function or functions that will retrieve data in the correct format according to the registration contract provided by the observability app.

Design: #68176

AC:

  • On plugin start, we register a function using plugins.observability.dashboard.register() that retrieves the log rate data specified by the Logs Return type
    • stats should include the values and names of each event.dataset value in the returned log data
    • series should include the histogram data for log rate within the given time range (partioned by event.dataset), in the format expected by Elastic Charts for a stacked bar chart / histogram

Notes:

  • What will the chart show if there are more than 4 event.dataset values? Will the visualization scale? Will it use "top 4"?
  • We don't currently have a generic log rate query so we will need to create this, not based on ML, so that it's available to all users
@jasonrhodes jasonrhodes added this to the Logs UI 7.9 milestone Jun 8, 2020
@flash1293 flash1293 added the Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services label Jun 10, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

@cauemarcondes
Copy link
Contributor

@jasonrhodes here is an example of how you can register your function.

LogsFetchDataResponse: https://github.com/cauemarcondes/kibana/blob/obs-api/x-pack/plugins/observability/public/typings/data_handler/index.d.ts#L36

plugins.observability.dashboard.register({
  appName: 'infra_logs',
  fetchData: ({ startTime, endTime, bucketSize }) => {
    // TODO: fetch data.
    const logsData: LogsFetchDataResponse = {
      title: 'Logs',
      appLink: 'link to logs',
      stats: {
        nginx: {
          value: 100000,
        },
      },
      series: {
        nginx: {
          label: 'Nginx',
          coordinates: [{ x: 1, y: 2 }],
        },
      },
    };
    return Promise.resolve(logsData);
  },
  hasData: () => {
    // TODO: fetch has data.
    return Promise.resolve(true);
  },
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Projects
None yet
6 participants