mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Prometheus: report metrics browser toggle click interaction (#54546)
* report metrics browser toggle click interaction Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
This commit is contained in:
parent
dd38ff7cc8
commit
d19a125ada
@ -2,15 +2,16 @@ import { LanguageMap, languages as prismLanguages } from 'prismjs';
|
|||||||
import React, { ReactNode } from 'react';
|
import React, { ReactNode } from 'react';
|
||||||
import { Plugin } from 'slate';
|
import { Plugin } from 'slate';
|
||||||
|
|
||||||
import { QueryEditorProps, QueryHint, isDataFrame, toLegacyResponseData, TimeRange, CoreApp } from '@grafana/data';
|
import { CoreApp, isDataFrame, QueryEditorProps, QueryHint, TimeRange, toLegacyResponseData } from '@grafana/data';
|
||||||
|
import { reportInteraction } from '@grafana/runtime/src';
|
||||||
import {
|
import {
|
||||||
SlatePrism,
|
|
||||||
TypeaheadInput,
|
|
||||||
TypeaheadOutput,
|
|
||||||
BracesPlugin,
|
BracesPlugin,
|
||||||
DOMUtil,
|
DOMUtil,
|
||||||
SuggestionsState,
|
|
||||||
Icon,
|
Icon,
|
||||||
|
SlatePrism,
|
||||||
|
SuggestionsState,
|
||||||
|
TypeaheadInput,
|
||||||
|
TypeaheadOutput,
|
||||||
} from '@grafana/ui';
|
} from '@grafana/ui';
|
||||||
import { LocalStorageValueProvider } from 'app/core/components/LocalStorageValueProvider';
|
import { LocalStorageValueProvider } from 'app/core/components/LocalStorageValueProvider';
|
||||||
import {
|
import {
|
||||||
@ -21,7 +22,7 @@ import {
|
|||||||
|
|
||||||
import { PrometheusDatasource } from '../datasource';
|
import { PrometheusDatasource } from '../datasource';
|
||||||
import { roundMsToMin } from '../language_utils';
|
import { roundMsToMin } from '../language_utils';
|
||||||
import { PromQuery, PromOptions } from '../types';
|
import { PromOptions, PromQuery } from '../types';
|
||||||
|
|
||||||
import { PrometheusMetricsBrowser } from './PrometheusMetricsBrowser';
|
import { PrometheusMetricsBrowser } from './PrometheusMetricsBrowser';
|
||||||
import { MonacoQueryFieldWrapper } from './monaco-query-field/MonacoQueryFieldWrapper';
|
import { MonacoQueryFieldWrapper } from './monaco-query-field/MonacoQueryFieldWrapper';
|
||||||
@ -219,6 +220,11 @@ class PromQueryField extends React.PureComponent<PromQueryFieldProps, PromQueryF
|
|||||||
|
|
||||||
onClickChooserButton = () => {
|
onClickChooserButton = () => {
|
||||||
this.setState((state) => ({ labelBrowserVisible: !state.labelBrowserVisible }));
|
this.setState((state) => ({ labelBrowserVisible: !state.labelBrowserVisible }));
|
||||||
|
|
||||||
|
reportInteraction('user_grafana_prometheus_metrics_browser_clicked', {
|
||||||
|
editorMode: this.state.labelBrowserVisible ? 'metricViewClosed' : 'metricViewOpen',
|
||||||
|
app: this.props?.app ?? '',
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onClickHintFix = () => {
|
onClickHintFix = () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user