mirror of https://github.com/grafana/grafana
Query Library: Interaction events for query library (#92159)
* interaction events for query library * track adding or editing description * Update to specify it's in explorepull/92342/head^2
parent
bef7139af0
commit
4015711133
@ -0,0 +1,50 @@ |
||||
import { reportInteraction } from '@grafana/runtime'; |
||||
|
||||
const QUERY_LIBRARY_EXPLORE_EVENT = 'query_library_explore_clicked'; |
||||
|
||||
export function queryLibraryTrackToggle(open: boolean) { |
||||
reportInteraction(QUERY_LIBRARY_EXPLORE_EVENT, { |
||||
item: 'query_library_toggle', |
||||
type: open ? 'open' : 'close', |
||||
}); |
||||
} |
||||
|
||||
export function queryLibraryTrackAddFromQueryHistory(datasourceType: string) { |
||||
reportInteraction(QUERY_LIBRARY_EXPLORE_EVENT, { |
||||
item: 'add_query_from_query_history', |
||||
type: datasourceType, |
||||
}); |
||||
} |
||||
|
||||
export function queryLibraryTrackAddFromQueryHistoryAddModalShown() { |
||||
reportInteraction(QUERY_LIBRARY_EXPLORE_EVENT, { |
||||
item: 'add_query_modal_from_query_history', |
||||
type: 'open', |
||||
}); |
||||
} |
||||
|
||||
export function queryLibraryTrackAddFromQueryRow(datasourceType: string) { |
||||
reportInteraction(QUERY_LIBRARY_EXPLORE_EVENT, { |
||||
item: 'add_query_from_query_row', |
||||
type: datasourceType, |
||||
}); |
||||
} |
||||
|
||||
export function queryLibaryTrackDeleteQuery() { |
||||
reportInteraction(QUERY_LIBRARY_EXPLORE_EVENT, { |
||||
item: 'delete_query', |
||||
}); |
||||
} |
||||
|
||||
export function queryLibraryTrackRunQuery(datasourceType: string) { |
||||
reportInteraction(QUERY_LIBRARY_EXPLORE_EVENT, { |
||||
item: 'run_query', |
||||
type: datasourceType, |
||||
}); |
||||
} |
||||
|
||||
export function queryLibraryTrackAddOrEditDescription() { |
||||
reportInteraction(QUERY_LIBRARY_EXPLORE_EVENT, { |
||||
item: 'add_or_edit_description', |
||||
}); |
||||
} |
Loading…
Reference in new issue