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

[Monitoring] Fix improper lodash syntax #77105

Merged
merged 2 commits into from
Sep 10, 2020

Conversation

chrisronline
Copy link
Contributor

@chrisronline chrisronline commented Sep 9, 2020

Resolves #73298

#69868 introduced a new major version of lodash which had an unexpected effect on a piece of our code that formats our raw data for use in our visualizations.

The code in question is:

get(series, '.metric.format', '0,0.0');

and

get(series, '.metric.units', '');

This works in lodash@3: https://codepen.io/chrisronline/pen/xxVWVBB?editors=1111

However, it does not work in lodash@4: https://codepen.io/chrisronline/pen/WNwzwgj?editors=1111

This PR fixes the usage to proper lodash usage.

@elasticmachine
Copy link
Contributor

Pinging @elastic/stack-monitoring (Team:Monitoring)

Copy link
Contributor

@igoristic igoristic left a comment

Choose a reason for hiding this comment

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

Looking good 👍

ps: Was also wondering if this: https://github.com/chrisronline/kibana/blob/monitoring/lodash_lol/x-pack/plugins/monitoring/server/lib/cluster/__tests__/get_clusters_state.js#L58 is also affected. But, I guess we'll now depending if the tests pass or fail

@chrisronline
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

async chunks size

id value diff baseline
monitoring 1.1MB -2.0B 1.1MB

History

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

@chrisronline chrisronline merged commit eacd602 into elastic:master Sep 10, 2020
@chrisronline chrisronline deleted the monitoring/lodash_lol branch September 10, 2020 17:50
chrisronline added a commit to chrisronline/kibana that referenced this pull request Sep 10, 2020
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
chrisronline added a commit to chrisronline/kibana that referenced this pull request Sep 10, 2020
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
chrisronline added a commit that referenced this pull request Sep 10, 2020
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
chrisronline added a commit that referenced this pull request Sep 10, 2020
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@chrisronline
Copy link
Contributor Author

Backport:

7.x: a998279
7.9: 6592734

jloleysens added a commit to jloleysens/kibana that referenced this pull request Sep 14, 2020
…s-for-710

* 'master' of github.com:elastic/kibana: (65 commits)
  Separate url forwarding logic and legacy services (elastic#76892)
  Bump yargs-parser to v13.1.2+ (elastic#77009)
  [Ingest Manager] Shared Fleet agent policy action (elastic#76013)
  [Search] Re-add support for aborting when a connection is closed (elastic#76470)
  [Search] Remove long-running query pop-up (elastic#75385)
  [Monitoring] Fix UI error when alerting is not available (elastic#77179)
  do not log plugin id format warning in dist mode (elastic#77134)
  [ML] Improving client side error handling (elastic#76743)
  [Alerting][Connectors] Refactor IBM Resilient: Generic Implementation (phase one) (elastic#74357)
  [Docs] some basic searchsource api docs (elastic#77038)
  add  cGroupOverrides to the legacy config (elastic#77180)
  Change saved object bulkUpdate to work across multiple namespaces (elastic#75478)
  [Security Solution][Resolver] Replace Selectable popover with badges (elastic#76997)
  Removing ml-state index from archive (elastic#77143)
  [Security Solution] Add unit tests for histograms (elastic#77081)
  [Lens] Filters aggregation  (elastic#75635)
  [Enterprise Search] Update WS Overview logic to use new config data (elastic#77122)
  Cleanup type output before building new types (elastic#77211)
  [Security Solution] Use safe type in resolver backend (elastic#76969)
  Use proper lodash syntax (elastic#77105)
  ...

# Conflicts:
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/node_allocation.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stack monitoring: Unit mismatch in memory graphs
4 participants