mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Logs: add app to feature tracking in ad-hoc statistics (#56865)
* add app tracking to adhoc statistics * use the object property value shorthand
This commit is contained in:
parent
83aa006c98
commit
b8b25f7e31
@ -2,7 +2,7 @@ import { css, cx } from '@emotion/css';
|
||||
import memoizeOne from 'memoize-one';
|
||||
import React, { PureComponent } from 'react';
|
||||
|
||||
import { Field, LinkModel, LogRowModel, GrafanaTheme2 } from '@grafana/data';
|
||||
import { Field, LinkModel, LogRowModel, GrafanaTheme2, CoreApp } from '@grafana/data';
|
||||
import { withTheme2, Themeable2, Icon, Tooltip } from '@grafana/ui';
|
||||
|
||||
import { calculateFieldStats, calculateLogsLabelStats, calculateStats, getParser } from '../utils';
|
||||
@ -20,6 +20,7 @@ export interface Props extends Themeable2 {
|
||||
wrapLogMessage: boolean;
|
||||
className?: string;
|
||||
hasError?: boolean;
|
||||
app?: CoreApp;
|
||||
|
||||
onClickFilterLabel?: (key: string, value: string) => void;
|
||||
onClickFilterOutLabel?: (key: string, value: string) => void;
|
||||
@ -58,6 +59,7 @@ class UnThemedLogDetails extends PureComponent<Props> {
|
||||
|
||||
render() {
|
||||
const {
|
||||
app,
|
||||
row,
|
||||
theme,
|
||||
hasError,
|
||||
@ -110,6 +112,7 @@ class UnThemedLogDetails extends PureComponent<Props> {
|
||||
onClickFilterOutLabel={onClickFilterOutLabel}
|
||||
onClickFilterLabel={onClickFilterLabel}
|
||||
row={row}
|
||||
app={app}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
@ -148,6 +151,7 @@ class UnThemedLogDetails extends PureComponent<Props> {
|
||||
showDetectedFields={showDetectedFields}
|
||||
wrapLogMessage={wrapLogMessage}
|
||||
row={row}
|
||||
app={app}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { css, cx } from '@emotion/css';
|
||||
import React, { PureComponent } from 'react';
|
||||
|
||||
import { Field, LinkModel, LogLabelStatsModel, GrafanaTheme2, LogRowModel } from '@grafana/data';
|
||||
import { Field, LinkModel, LogLabelStatsModel, GrafanaTheme2, LogRowModel, CoreApp } from '@grafana/data';
|
||||
import { reportInteraction } from '@grafana/runtime';
|
||||
import { withTheme2, Themeable2, ClipboardButton, DataLinkButton, IconButton } from '@grafana/ui';
|
||||
|
||||
@ -23,6 +23,7 @@ export interface Props extends Themeable2 {
|
||||
onClickShowDetectedField?: (key: string) => void;
|
||||
onClickHideDetectedField?: (key: string) => void;
|
||||
row: LogRowModel;
|
||||
app?: CoreApp;
|
||||
}
|
||||
|
||||
interface State {
|
||||
@ -115,7 +116,7 @@ class UnThemedLogDetailsRow extends PureComponent<Props, State> {
|
||||
};
|
||||
|
||||
showStats = () => {
|
||||
const { getStats, isLabel, row } = this.props;
|
||||
const { getStats, isLabel, row, app } = this.props;
|
||||
const { showFieldsStats } = this.state;
|
||||
if (!showFieldsStats) {
|
||||
const fieldStats = getStats();
|
||||
@ -129,6 +130,7 @@ class UnThemedLogDetailsRow extends PureComponent<Props, State> {
|
||||
fieldType: isLabel ? 'label' : 'detectedField',
|
||||
type: showFieldsStats ? 'close' : 'open',
|
||||
logRowUid: row.uid,
|
||||
app,
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -250,6 +250,7 @@ class UnThemedLogRow extends PureComponent<Props, State> {
|
||||
wrapLogMessage={wrapLogMessage}
|
||||
hasError={hasError}
|
||||
showDetectedFields={showDetectedFields}
|
||||
app={app}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
|
Loading…
Reference in New Issue
Block a user