Skip to content

Commit

Permalink
Add code comments on 'Add anonymous usage reporting' topic (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
josmperez authored Nov 14, 2023
1 parent ccf38bd commit 69ac098
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ import type { EditorProps } from './types';

export function QueryEditor(props: EditorProps): ReactElement {
const { datasource, query, onChange, onRunQuery } = props;
const report = usePluginInteractionReporter();

const report = usePluginInteractionReporter(); // get the report function

const queryType = { value: query.value ?? 'timeseries' };
const queryTypes = [
Expand Down Expand Up @@ -123,6 +124,7 @@ export function QueryEditor(props: EditorProps): ReactElement {
rawQuery: type,
});

// send this report with two arguments
report('grafana_plugin_executed_query', {
query_type: queryType.value,
});
Expand Down

0 comments on commit 69ac098

Please sign in to comment.