Prometheus: instant results ux improvements rudderstack events (#60990)

* add rudderstack events for new interactive elements
This commit is contained in:
Galen Kistler 2023-01-05 12:52:59 -06:00 committed by GitHub
parent 0f3b4e02a0
commit db369fc5b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import { useWindowSize } from 'react-use';
import { VariableSizeList as List } from 'react-window';
import { DataFrame, Field as DataFrameField } from '@grafana/data/';
import { reportInteraction } from '@grafana/runtime/src';
import { Field, Switch } from '@grafana/ui/';
import {
@ -73,6 +74,10 @@ const RawListContainer = (props: RawListContainerProps) => {
const onContentClick = () => {
setIsExpandedView(!isExpandedView);
const props = {
isExpanded: !isExpandedView,
};
reportInteraction('grafana_explore_prometheus_instant_query_ui_raw_toggle_expand', props);
};
useEffect(() => {

View File

@ -3,6 +3,7 @@ import React from 'react';
import { useCopyToClipboard } from 'react-use';
import { Field, GrafanaTheme2 } from '@grafana/data/';
import { reportInteraction } from '@grafana/runtime/src';
import { IconButton, useStyles2 } from '@grafana/ui/';
import { ItemLabels } from './ItemLabels';
@ -128,7 +129,14 @@ const RawListItem = ({ listItemData, listKey, totalNumberOfValues, valueLabels,
)}
<div key={listKey} className={styles.rowWrapper}>
<span className={styles.copyToClipboardWrapper}>
<IconButton tooltip="Copy to clipboard" onClick={() => copyToClipboard(stringRep)} name="copy" />
<IconButton
tooltip="Copy to clipboard"
onClick={() => {
reportInteraction('grafana_explore_prometheus_instant_query_ui_raw_toggle_expand');
copyToClipboard(stringRep);
}}
name="copy"
/>
</span>
<span role={'cell'} className={styles.rowLabelWrapWrap}>
<div className={styles.rowLabelWrap}>

View File

@ -3,6 +3,7 @@ import React, { PureComponent } from 'react';
import { connect, ConnectedProps } from 'react-redux';
import { applyFieldOverrides, DataFrame, SelectableValue, SplitOpen, TimeZone, ValueLinkConfig } from '@grafana/data';
import { reportInteraction } from '@grafana/runtime/src';
import { Collapse, RadioButtonGroup, Table } from '@grafana/ui';
import { FilterItem } from '@grafana/ui/src/components/Table/types';
import { config } from 'app/core/config';
@ -90,6 +91,15 @@ export class RawPrometheusContainer extends PureComponent<Props, PrometheusConta
<div className={spacing}>
{this.state.resultsStyle === TABLE_RESULTS_STYLE.raw ? 'Raw' : 'Table'}
<RadioButtonGroup
onClick={() => {
const props = {
state:
this.state.resultsStyle === TABLE_RESULTS_STYLE.table
? TABLE_RESULTS_STYLE.raw
: TABLE_RESULTS_STYLE.table,
};
reportInteraction('grafana_explore_prometheus_instant_query_ui_toggle_clicked', props);
}}
size="sm"
options={ALL_GRAPH_STYLE_OPTIONS}
value={this.state?.resultsStyle}