mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Logs: Add feature tracking for filters in log rows (#56808)
* Add feature tracking for log details filter clicks * use deconstructed prop values * use deconstructed prop values
This commit is contained in:
parent
b71e08ad59
commit
b0cb02568a
@ -89,33 +89,46 @@ class UnThemedLogDetailsRow extends PureComponent<Props, State> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
filterLabel = () => {
|
filterLabel = () => {
|
||||||
const { onClickFilterLabel, parsedKey, parsedValue } = this.props;
|
const { onClickFilterLabel, parsedKey, parsedValue, row } = this.props;
|
||||||
if (onClickFilterLabel) {
|
if (onClickFilterLabel) {
|
||||||
onClickFilterLabel(parsedKey, parsedValue);
|
onClickFilterLabel(parsedKey, parsedValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reportInteraction('grafana_explore_logs_log_details_filter_clicked', {
|
||||||
|
datasourceType: row.datasourceType,
|
||||||
|
filterType: 'include',
|
||||||
|
logRowUid: row.uid,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
filterOutLabel = () => {
|
filterOutLabel = () => {
|
||||||
const { onClickFilterOutLabel, parsedKey, parsedValue } = this.props;
|
const { onClickFilterOutLabel, parsedKey, parsedValue, row } = this.props;
|
||||||
if (onClickFilterOutLabel) {
|
if (onClickFilterOutLabel) {
|
||||||
onClickFilterOutLabel(parsedKey, parsedValue);
|
onClickFilterOutLabel(parsedKey, parsedValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reportInteraction('grafana_explore_logs_log_details_filter_clicked', {
|
||||||
|
datasourceType: row.datasourceType,
|
||||||
|
filterType: 'exclude',
|
||||||
|
logRowUid: row.uid,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
showStats = () => {
|
showStats = () => {
|
||||||
|
const { getStats, isLabel, row } = this.props;
|
||||||
const { showFieldsStats } = this.state;
|
const { showFieldsStats } = this.state;
|
||||||
if (!showFieldsStats) {
|
if (!showFieldsStats) {
|
||||||
const fieldStats = this.props.getStats();
|
const fieldStats = getStats();
|
||||||
const fieldCount = fieldStats ? fieldStats.reduce((sum, stat) => sum + stat.count, 0) : 0;
|
const fieldCount = fieldStats ? fieldStats.reduce((sum, stat) => sum + stat.count, 0) : 0;
|
||||||
this.setState({ fieldStats, fieldCount });
|
this.setState({ fieldStats, fieldCount });
|
||||||
}
|
}
|
||||||
this.toggleFieldsStats();
|
this.toggleFieldsStats();
|
||||||
|
|
||||||
reportInteraction('grafana_explore_logs_log_details_stats_clicked', {
|
reportInteraction('grafana_explore_logs_log_details_stats_clicked', {
|
||||||
dataSourceType: this.props.row.datasourceType,
|
dataSourceType: row.datasourceType,
|
||||||
fieldType: this.props.isLabel ? 'label' : 'detectedField',
|
fieldType: isLabel ? 'label' : 'detectedField',
|
||||||
type: showFieldsStats ? 'close' : 'open',
|
type: showFieldsStats ? 'close' : 'open',
|
||||||
logRowUid: this.props.row.uid,
|
logRowUid: row.uid,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user