mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-12 18:47:45 +00:00
logging(lineage): adding some lineage explorer and impact analysis logging (#8849)
This commit is contained in:
parent
67af68284f
commit
47b7e2984c
@ -35,6 +35,8 @@ export enum EventType {
|
||||
SearchBarExploreAllClickEvent,
|
||||
SearchResultsExploreAllClickEvent,
|
||||
SearchAcrossLineageEvent,
|
||||
VisualLineageViewEvent,
|
||||
VisualLineageExpandGraphEvent,
|
||||
SearchAcrossLineageResultsViewEvent,
|
||||
DownloadAsCsvEvent,
|
||||
SignUpEvent,
|
||||
@ -340,12 +342,23 @@ export interface HomePageRecommendationClickEvent extends BaseEvent {
|
||||
index?: number;
|
||||
}
|
||||
|
||||
export interface VisualLineageViewEvent extends BaseEvent {
|
||||
type: EventType.VisualLineageViewEvent;
|
||||
entityType?: EntityType;
|
||||
}
|
||||
|
||||
export interface VisualLineageExpandGraphEvent extends BaseEvent {
|
||||
type: EventType.VisualLineageExpandGraphEvent;
|
||||
targetEntityType?: EntityType;
|
||||
}
|
||||
|
||||
export interface SearchAcrossLineageEvent extends BaseEvent {
|
||||
type: EventType.SearchAcrossLineageEvent;
|
||||
query: string;
|
||||
entityTypeFilter?: EntityType;
|
||||
pageNumber: number;
|
||||
originPath: string;
|
||||
maxDegree?: string;
|
||||
}
|
||||
export interface SearchAcrossLineageResultsViewEvent extends BaseEvent {
|
||||
type: EventType.SearchAcrossLineageResultsViewEvent;
|
||||
@ -353,6 +366,7 @@ export interface SearchAcrossLineageResultsViewEvent extends BaseEvent {
|
||||
entityTypeFilter?: EntityType;
|
||||
page?: number;
|
||||
total: number;
|
||||
maxDegree?: string;
|
||||
}
|
||||
|
||||
export interface DownloadAsCsvEvent extends BaseEvent {
|
||||
@ -641,6 +655,8 @@ export type Event =
|
||||
| RecommendationImpressionEvent
|
||||
| SearchAcrossLineageEvent
|
||||
| SearchAcrossLineageResultsViewEvent
|
||||
| VisualLineageViewEvent
|
||||
| VisualLineageExpandGraphEvent
|
||||
| DownloadAsCsvEvent
|
||||
| RecommendationClickEvent
|
||||
| HomePageRecommendationClickEvent
|
||||
|
||||
@ -7,7 +7,7 @@ import {
|
||||
FacetMetadata,
|
||||
SearchAcrossEntitiesInput,
|
||||
} from '../../../../../../types.generated';
|
||||
import { UnionType } from '../../../../../search/utils/constants';
|
||||
import { DEGREE_FILTER_NAME, UnionType } from '../../../../../search/utils/constants';
|
||||
import { SearchCfg } from '../../../../../../conf';
|
||||
import { EmbeddedListSearchResults } from './EmbeddedListSearchResults';
|
||||
import EmbeddedListSearchHeader from './EmbeddedListSearchHeader';
|
||||
@ -27,6 +27,7 @@ import {
|
||||
import { useEntityContext } from '../../../EntityContext';
|
||||
import { EntityActionProps } from './EntitySearchResults';
|
||||
import { useUserContext } from '../../../../../context/useUserContext';
|
||||
import analytics, { EventType } from '../../../../../analytics';
|
||||
|
||||
const Container = styled.div`
|
||||
display: flex;
|
||||
@ -266,6 +267,20 @@ export const EmbeddedListSearch = ({
|
||||
const finalFacets =
|
||||
(fixedFilters && removeFixedFiltersFromFacets(fixedFilters, data?.facets || [])) || data?.facets;
|
||||
|
||||
// used for logging impact anlaysis events
|
||||
const degreeFilter = filters.find((filter) => filter.field === DEGREE_FILTER_NAME);
|
||||
|
||||
// we already have some lineage logging through Tab events, but this adds additional context, particularly degree
|
||||
if (!loading && (degreeFilter?.values?.length || 0) > 0) {
|
||||
analytics.event({
|
||||
type: EventType.SearchAcrossLineageResultsViewEvent,
|
||||
query,
|
||||
page,
|
||||
total: data?.total || 0,
|
||||
maxDegree: degreeFilter?.values?.sort()?.reverse()[0] || '1',
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<Container>
|
||||
{error && <Message type="error" content="Failed to load results! An unexpected error occurred." />}
|
||||
|
||||
@ -17,6 +17,7 @@ import { SHOW_COLUMNS_URL_PARAMS, useIsShowColumnsMode } from './utils/useIsShow
|
||||
import { ErrorSection } from '../shared/error/ErrorSection';
|
||||
import usePrevious from '../shared/usePrevious';
|
||||
import { useGetLineageTimeParams } from './utils/useGetLineageTimeParams';
|
||||
import analytics, { EventType } from '../analytics';
|
||||
|
||||
const DEFAULT_DISTANCE_FROM_TOP = 106;
|
||||
|
||||
@ -85,7 +86,13 @@ export default function LineageExplorer({ urn, type }: Props) {
|
||||
// they should be added to the dependency array below.
|
||||
useEffect(() => {
|
||||
setAsyncEntities({});
|
||||
}, [isHideSiblingMode, startTimeMillis, endTimeMillis]);
|
||||
// this can also be our hook for emitting the tracking event
|
||||
|
||||
analytics.event({
|
||||
type: EventType.VisualLineageViewEvent,
|
||||
entityType: entityData?.type,
|
||||
});
|
||||
}, [isHideSiblingMode, startTimeMillis, endTimeMillis, entityData?.type]);
|
||||
|
||||
useEffect(() => {
|
||||
if (showColumns) {
|
||||
@ -183,6 +190,10 @@ export default function LineageExplorer({ urn, type }: Props) {
|
||||
onLineageExpand={(asyncData: EntityAndType) => {
|
||||
resetAsyncEntity(asyncData.entity.urn);
|
||||
maybeAddAsyncLoadedEntity(asyncData);
|
||||
analytics.event({
|
||||
type: EventType.VisualLineageExpandGraphEvent,
|
||||
targetEntityType: asyncData?.type,
|
||||
});
|
||||
}}
|
||||
refetchCenterNode={() => {
|
||||
refetch().then(() => {
|
||||
|
||||
@ -67,6 +67,8 @@ public enum DataHubUsageEventType {
|
||||
MANUALLY_DELETE_LINEAGE_EVENT("ManuallyDeleteLineageEvent"),
|
||||
LINEAGE_GRAPH_TIME_RANGE_SELECTION_EVENT("LineageGraphTimeRangeSelectionEvent"),
|
||||
LINEAGE_TAB_TIME_RANGE_SELECTION_EVENT("LineageTabTimeRangeSelectionEvent"),
|
||||
VISUAL_LINEAGE_EXPAND_GRAPH_EVENT("VisualLineageExpandGraphEvent"),
|
||||
VISUAL_LINEAGE_VIEW_EVENT("VisualLineageViewEvent"),
|
||||
CREATE_QUERY_EVENT("CreateQueryEvent"),
|
||||
DELETE_QUERY_EVENT("DeleteQueryEvent"),
|
||||
UPDATE_QUERY_EVENT("UpdateQueryEvent"),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user