diff --git a/packages/jaeger-ui-components/src/TracePageHeader/TracePageSearchBar.tsx b/packages/jaeger-ui-components/src/TracePageHeader/TracePageSearchBar.tsx index 186e0d2b074..7f6c96ec4fa 100644 --- a/packages/jaeger-ui-components/src/TracePageHeader/TracePageSearchBar.tsx +++ b/packages/jaeger-ui-components/src/TracePageHeader/TracePageSearchBar.tsx @@ -17,7 +17,7 @@ import cx from 'classnames'; import React, { memo, Dispatch, SetStateAction } from 'react'; import { GrafanaTheme2 } from '@grafana/data'; -import { reportInteraction } from '@grafana/runtime'; +import { config, reportInteraction } from '@grafana/runtime'; import { Button, useStyles2 } from '@grafana/ui'; import UiFindInput from '../common/UiFindInput'; @@ -117,6 +117,7 @@ export default memo(function TracePageSearchBar(props: TracePageSearchBarProps) const nextResult = () => { reportInteraction('grafana_traces_trace_view_find_next_prev_clicked', { datasourceType: datasourceType, + grafana_version: config.buildInfo.version, direction: 'next', }); @@ -140,6 +141,7 @@ export default memo(function TracePageSearchBar(props: TracePageSearchBarProps) const prevResult = () => { reportInteraction('grafana_traces_trace_view_find_next_prev_clicked', { datasourceType: datasourceType, + grafana_version: config.buildInfo.version, direction: 'prev', }); diff --git a/packages/jaeger-ui-components/src/TraceTimelineViewer/SpanDetail/index.tsx b/packages/jaeger-ui-components/src/TraceTimelineViewer/SpanDetail/index.tsx index 7cfee033a13..7842adf0929 100644 --- a/packages/jaeger-ui-components/src/TraceTimelineViewer/SpanDetail/index.tsx +++ b/packages/jaeger-ui-components/src/TraceTimelineViewer/SpanDetail/index.tsx @@ -18,7 +18,7 @@ import React from 'react'; import IoLink from 'react-icons/lib/io/link'; import { dateTimeFormat, GrafanaTheme2, LinkModel, TimeZone } from '@grafana/data'; -import { reportInteraction } from '@grafana/runtime'; +import { config, reportInteraction } from '@grafana/runtime'; import { Button, DataLinkButton, TextArea, useStyles2 } from '@grafana/ui'; import { autoColor } from '../../Theme'; @@ -209,6 +209,7 @@ export default function SpanDetail(props: SpanDetailProps) { onClick: (event: React.MouseEvent) => { reportInteraction('grafana_traces_trace_view_span_link_clicked', { datasourceType: datasourceType, + grafana_version: config.buildInfo.version, type: 'log', location: 'spanDetails', }); diff --git a/packages/jaeger-ui-components/src/TraceTimelineViewer/SpanLinks.tsx b/packages/jaeger-ui-components/src/TraceTimelineViewer/SpanLinks.tsx index 0380157ce7e..666470f1242 100644 --- a/packages/jaeger-ui-components/src/TraceTimelineViewer/SpanLinks.tsx +++ b/packages/jaeger-ui-components/src/TraceTimelineViewer/SpanLinks.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/css'; import React, { useState } from 'react'; -import { reportInteraction } from '@grafana/runtime'; +import { config, reportInteraction } from '@grafana/runtime'; import { useStyles2, MenuGroup, MenuItem, Icon, ContextMenu } from '@grafana/ui'; import { SpanLinks } from '../types/links'; @@ -30,6 +30,7 @@ const renderMenuItems = ( ? (event) => { reportInteraction('grafana_traces_trace_view_span_link_clicked', { datasourceType: datasourceType, + grafana_version: config.buildInfo.version, type: 'log', location: 'menu', }); @@ -56,6 +57,7 @@ const renderMenuItems = ( ? (event) => { reportInteraction('grafana_traces_trace_view_span_link_clicked', { datasourceType: datasourceType, + grafana_version: config.buildInfo.version, type: 'metric', location: 'menu', }); @@ -82,6 +84,7 @@ const renderMenuItems = ( ? (event) => { reportInteraction('grafana_traces_trace_view_span_link_clicked', { datasourceType: datasourceType, + grafana_version: config.buildInfo.version, type: 'trace', location: 'menu', }); diff --git a/packages/jaeger-ui-components/src/TraceTimelineViewer/VirtualizedTraceView.tsx b/packages/jaeger-ui-components/src/TraceTimelineViewer/VirtualizedTraceView.tsx index b789298dae8..e98caf6460a 100644 --- a/packages/jaeger-ui-components/src/TraceTimelineViewer/VirtualizedTraceView.tsx +++ b/packages/jaeger-ui-components/src/TraceTimelineViewer/VirtualizedTraceView.tsx @@ -19,7 +19,7 @@ import * as React from 'react'; import { createRef, RefObject } from 'react'; import { GrafanaTheme2, LinkModel, TimeZone } from '@grafana/data'; -import { reportInteraction } from '@grafana/runtime'; +import { config, reportInteraction } from '@grafana/runtime'; import { stylesFactory, withTheme2, ToolbarButton } from '@grafana/ui'; import { Accessors } from '../ScrollManager'; @@ -541,6 +541,7 @@ export class UnthemedVirtualizedTraceView extends React.Component { }; exportTracesAsJson = () => { - const { data, panel } = this.props; + const { data, panel, app } = this.props; + if (!data) { return; } @@ -123,16 +124,19 @@ export class InspectDataTab extends PureComponent { if (df.meta?.preferredVisualisationType !== 'trace') { continue; } + let traceFormat = 'otlp'; switch (df.meta?.custom?.traceFormat) { case 'jaeger': { let res = transformToJaeger(new MutableDataFrame(df)); downloadAsJson(res, (panel ? panel.getDisplayTitle() : 'Explore') + '-traces'); + traceFormat = 'jaeger'; break; } case 'zipkin': { let res = transformToZipkin(new MutableDataFrame(df)); downloadAsJson(res, (panel ? panel.getDisplayTitle() : 'Explore') + '-traces'); + traceFormat = 'zipkin'; break; } case 'otlp': @@ -142,11 +146,24 @@ export class InspectDataTab extends PureComponent { break; } } + + reportInteraction('grafana_traces_download_traces_clicked', { + app, + grafana_version: config.buildInfo.version, + trace_format: traceFormat, + location: 'inspector', + }); } }; exportServiceGraph = () => { - const { data, panel } = this.props; + const { data, panel, app } = this.props; + reportInteraction('grafana_traces_download_service_graph_clicked', { + app, + grafana_version: config.buildInfo.version, + location: 'inspector', + }); + if (!data) { return; } diff --git a/public/app/plugins/datasource/tempo/CheatSheet.tsx b/public/app/plugins/datasource/tempo/CheatSheet.tsx index 2095a13d4a1..40afaf9cfff 100644 --- a/public/app/plugins/datasource/tempo/CheatSheet.tsx +++ b/public/app/plugins/datasource/tempo/CheatSheet.tsx @@ -1,10 +1,11 @@ import React from 'react'; -import { reportInteraction } from '@grafana/runtime'; +import { config, reportInteraction } from '@grafana/runtime'; export default function CheatSheet() { reportInteraction('grafana_traces_cheatsheet_clicked', { datasourceType: 'tempo', + grafana_version: config.buildInfo.version, }); return ( diff --git a/public/app/plugins/datasource/tempo/QueryEditor/QueryField.tsx b/public/app/plugins/datasource/tempo/QueryEditor/QueryField.tsx index 1648378760e..5597d05e5a5 100644 --- a/public/app/plugins/datasource/tempo/QueryEditor/QueryField.tsx +++ b/public/app/plugins/datasource/tempo/QueryEditor/QueryField.tsx @@ -3,7 +3,7 @@ import React from 'react'; import useAsync from 'react-use/lib/useAsync'; import { QueryEditorProps, SelectableValue } from '@grafana/data'; -import { reportInteraction } from '@grafana/runtime'; +import { config, reportInteraction } from '@grafana/runtime'; import { FileDropzone, InlineField, @@ -107,6 +107,7 @@ class TempoQueryFieldComponent extends React.PureComponent { reportInteraction('grafana_traces_query_type_changed', { datasourceType: 'tempo', app: app ?? '', + grafana_version: config.buildInfo.version, newQueryType: v, previousQueryType: query.queryType ?? '', }); diff --git a/public/app/plugins/datasource/tempo/datasource.ts b/public/app/plugins/datasource/tempo/datasource.ts index 4bad7bb23ec..f79c9ed3fa1 100644 --- a/public/app/plugins/datasource/tempo/datasource.ts +++ b/public/app/plugins/datasource/tempo/datasource.ts @@ -108,7 +108,9 @@ export class TempoDatasource extends DataSourceWithBackend, datasourceUid: s reportInteraction('grafana_traces_service_graph_size', { datasourceType: 'tempo', + grafana_version: config.buildInfo.version, nodeLength, edgeLength, });