-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Closes #13471 - Change split behavior of gauges and metrics vis #13583
Closes #13471 - Change split behavior of gauges and metrics vis #13583
Conversation
Jenkins test this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! works really well.
This is not a bug fix IMHO, more of an enhancement, and I would remove 6.0 label, leaving this as a 6.1 enhancement.
@ppisljar do you want to take second look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
export function visWithSplits(WrappedComponent) { | ||
function SplitVisComponent(props) { | ||
const { model, visData } = props; | ||
if (visData[model.id].series.every(s => s.id.split(':').length === 1)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@simianhacker I think that this change introduced a bug.
Before this PR, the .series
property was being defaulted to []
here, and now its not.
Maybe do something like this:
import { get, last, findIndex, first } from 'lodash';
function SplitVisComponent(props) {
const { model, visData } = props;
const series = get(visData, `${model.id}.series`, []);
// ...
and erase all visData[model.id].
This PR closes #13471 by changing the behavior of gauges and metrics visualizations. Before this PR when you split a series by a terms (or filters) aggregation they would just show up in the primary (and secondary) metric positions for the visualizations. With this PR it will create a gauge for each split.