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 = () => {
|
||||
const { onClickFilterLabel, parsedKey, parsedValue } = this.props;
|
||||
const { onClickFilterLabel, parsedKey, parsedValue, row } = this.props;
|
||||
if (onClickFilterLabel) {
|
||||
onClickFilterLabel(parsedKey, parsedValue);
|
||||
}
|
||||
|
||||
reportInteraction('grafana_explore_logs_log_details_filter_clicked', {
|
||||
datasourceType: row.datasourceType,
|
||||
filterType: 'include',
|
||||
logRowUid: row.uid,
|
||||
});
|
||||
};
|
||||
|
||||
filterOutLabel = () => {
|
||||
const { onClickFilterOutLabel, parsedKey, parsedValue } = this.props;
|
||||
const { onClickFilterOutLabel, parsedKey, parsedValue, row } = this.props;
|
||||
if (onClickFilterOutLabel) {
|
||||
onClickFilterOutLabel(parsedKey, parsedValue);
|
||||
}
|
||||
|
||||
reportInteraction('grafana_explore_logs_log_details_filter_clicked', {
|
||||
datasourceType: row.datasourceType,
|
||||
filterType: 'exclude',
|
||||
logRowUid: row.uid,
|
||||
});
|
||||
};
|
||||
|
||||
showStats = () => {
|
||||
const { getStats, isLabel, row } = this.props;
|
||||
const { showFieldsStats } = this.state;
|
||||
if (!showFieldsStats) {
|
||||
const fieldStats = this.props.getStats();
|
||||
const fieldStats = getStats();
|
||||
const fieldCount = fieldStats ? fieldStats.reduce((sum, stat) => sum + stat.count, 0) : 0;
|
||||
this.setState({ fieldStats, fieldCount });
|
||||
}
|
||||
this.toggleFieldsStats();
|
||||
|
||||
reportInteraction('grafana_explore_logs_log_details_stats_clicked', {
|
||||
dataSourceType: this.props.row.datasourceType,
|
||||
fieldType: this.props.isLabel ? 'label' : 'detectedField',
|
||||
dataSourceType: row.datasourceType,
|
||||
fieldType: isLabel ? 'label' : 'detectedField',
|
||||
type: showFieldsStats ? 'close' : 'open',
|
||||
logRowUid: this.props.row.uid,
|
||||
logRowUid: row.uid,
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user