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] Use fields api in log stream #76919

Merged
merged 4 commits into from
Sep 9, 2020

Conversation

afgomez
Copy link
Contributor

@afgomez afgomez commented Sep 8, 2020

Summary

Closes #76506

Use the fields API in the logs stream to fetch the column values and log item details. This enables using special fields like aliases and runtime fields in the log stream.

Perf

I have used drill to measure the performance impact. All benchmarks are run locally in development mode, with a ES snapshot, with the following setup

drill.yml
base: 'http://USER:PASSWORD@localhost:5601'
concurrency: 5
iterations: 1000

plan:
  - name: 'URL prefix'
    assign:
      key: prefix
      value: '' # development proxy prefix

  - name: '/entries'
    request:
      url: /{{ prefix }}/api/log_entries/entries
      method: POST
      body: '{"sourceId":"default","startTimestamp":1599474418756,"endTimestamp":1599560820261,"query":null,"after":{"time":1599560802000,"tiebreaker":2477}}'
      headers:
        User-Agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:81.0) Gecko/20100101 Firefox/81.0"
        Accept: '*/*'
        Accept-Language: "en-GB,en;q=0.8,es-ES;q=0.5,es;q=0.3"
        Accept-Encoding: "gzip, deflate"
        Content-Type: "application/json"
        kbn-version: "8.0.0"

  - name: '/item'
    request:
      url: /{{ prefix }}/api/log_entries/item
      method: POST
      body: '{"sourceId":"default","id":"{{ item }}"}'
      headers:
        User-Agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:81.0) Gecko/20100101 Firefox/81.0"
        Accept: '*/*'
        Accept-Language: "en-GB,en;q=0.8,es-ES;q=0.5,es;q=0.3"
        Accept-Encoding: "gzip, deflate"
        Content-Type: "application/json"
        kbn-version: "8.0.0"
    with_items:
      - "enM_bXQBgxm20xYC_gj9"
      - "R3M_bXQBgxm20xYCJAgm"
      - "3XM9bXQBgxm20xYCxAf7"
      - "3HM9bXQBgxm20xYCxAf7"
      - "_nM-bXQBgxm20xYCRQdo"
  • /entries before
Time taken for tests      14.0 seconds
Total requests            1000
Successful requests       1000
Failed requests           0
Requests per second       71.55 [#/sec]
Median time per request   69ms
Average time per request  70ms
Sample standard deviation 7ms
  • /entries after
Time taken for tests      13.7 seconds
Total requests            1000
Successful requests       1000
Failed requests           0
Requests per second       73.01 [#/sec]
Median time per request   68ms
Average time per request  68ms
Sample standard deviation 7ms
  • /item before
Time taken for tests      34.5 seconds
Total requests            5000
Successful requests       5000
Failed requests           0
Requests per second       144.74 [#/sec]
Median time per request   29ms
Average time per request  34ms
Sample standard deviation 18ms
  • /item after
Time taken for tests      32.7 seconds
Total requests            5000
Successful requests       5000
Failed requests           0
Requests per second       153.07 [#/sec]
Median time per request   29ms
Average time per request  33ms
Sample standard deviation 17ms

Checklist

Delete any items that are not applicable to this PR.

@afgomez afgomez added v8.0.0 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 release_note:skip Skip the PR/issue when compiling release notes v7.10.0 labels Sep 8, 2020
@afgomez afgomez added this to the Logs UI 7.10 milestone Sep 8, 2020
@afgomez afgomez requested a review from a team as a code owner September 8, 2020 11:05
@elasticmachine
Copy link
Contributor

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

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@Kerry350 Kerry350 self-requested a review September 8, 2020 13:16
Copy link
Contributor

@Kerry350 Kerry350 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

Thanks for the performance benchmarks, nice to see a little boost.

@afgomez afgomez merged commit d89e6d3 into elastic:master Sep 9, 2020
@afgomez afgomez deleted the 76506-fields-api-in-logs branch September 9, 2020 10:58
gmmorris added a commit to gmmorris/kibana that referenced this pull request Sep 9, 2020
* master: (68 commits)
  a11y tests on spaces home page including feature control  (elastic#76515)
  [ML] Transforms list: persist pagination through refresh interval (elastic#76786)
  [ML] Replace all use of date_histogram interval with fixed_interval (elastic#76876)
  [Timelion] Update timelion deprecation links (elastic#77008)
  [Security Solution] Refactor Network Details to use Search Strategy (elastic#76928)
  Upgrade elastic charts to 21.1.2 (elastic#76939)
  [Alerting][Connectors] Refactor Jira: Generic Implementation (phase one) (elastic#73778)
  [Snapshot & Restore] fix pre existing policy with no existing repository (elastic#76861)
  Update saved object management UI text (elastic#76826)
  [Form lib] Add validations prop to UseArray and expose "moveItem" handler (elastic#76949)
  [Logs UI] Use fields api in log stream (elastic#76919)
  [UI Metrics] Support multi-colon keys (elastic#76913)
  [APM] Script for creating functional test archive (elastic#76926)
  [ENDPOINT] First version of the trusted apps list. (elastic#76304)
  Correct field for rum page url (elastic#76916)
  [Security Solution] Fix redirect properly old SIEM App routes (elastic#76868)
  Bump http-proxy from 1.17.0 to 1.18.1 (elastic#76924)
  [RUM Dashboard] Visitor breakdown usability (elastic#76834)
  [Search] Add a new advanced setting searchTimeout (elastic#75728)
  [DOCS] Adds timelion deprecation to new visualize docs structure (elastic#76959)
  ...
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 release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Logs UI] Retrieve log entry field values via the unified fields API
4 participants