mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-13 02:57:03 +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,
|
SearchBarExploreAllClickEvent,
|
||||||
SearchResultsExploreAllClickEvent,
|
SearchResultsExploreAllClickEvent,
|
||||||
SearchAcrossLineageEvent,
|
SearchAcrossLineageEvent,
|
||||||
|
VisualLineageViewEvent,
|
||||||
|
VisualLineageExpandGraphEvent,
|
||||||
SearchAcrossLineageResultsViewEvent,
|
SearchAcrossLineageResultsViewEvent,
|
||||||
DownloadAsCsvEvent,
|
DownloadAsCsvEvent,
|
||||||
SignUpEvent,
|
SignUpEvent,
|
||||||
@ -340,12 +342,23 @@ export interface HomePageRecommendationClickEvent extends BaseEvent {
|
|||||||
index?: number;
|
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 {
|
export interface SearchAcrossLineageEvent extends BaseEvent {
|
||||||
type: EventType.SearchAcrossLineageEvent;
|
type: EventType.SearchAcrossLineageEvent;
|
||||||
query: string;
|
query: string;
|
||||||
entityTypeFilter?: EntityType;
|
entityTypeFilter?: EntityType;
|
||||||
pageNumber: number;
|
pageNumber: number;
|
||||||
originPath: string;
|
originPath: string;
|
||||||
|
maxDegree?: string;
|
||||||
}
|
}
|
||||||
export interface SearchAcrossLineageResultsViewEvent extends BaseEvent {
|
export interface SearchAcrossLineageResultsViewEvent extends BaseEvent {
|
||||||
type: EventType.SearchAcrossLineageResultsViewEvent;
|
type: EventType.SearchAcrossLineageResultsViewEvent;
|
||||||
@ -353,6 +366,7 @@ export interface SearchAcrossLineageResultsViewEvent extends BaseEvent {
|
|||||||
entityTypeFilter?: EntityType;
|
entityTypeFilter?: EntityType;
|
||||||
page?: number;
|
page?: number;
|
||||||
total: number;
|
total: number;
|
||||||
|
maxDegree?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DownloadAsCsvEvent extends BaseEvent {
|
export interface DownloadAsCsvEvent extends BaseEvent {
|
||||||
@ -641,6 +655,8 @@ export type Event =
|
|||||||
| RecommendationImpressionEvent
|
| RecommendationImpressionEvent
|
||||||
| SearchAcrossLineageEvent
|
| SearchAcrossLineageEvent
|
||||||
| SearchAcrossLineageResultsViewEvent
|
| SearchAcrossLineageResultsViewEvent
|
||||||
|
| VisualLineageViewEvent
|
||||||
|
| VisualLineageExpandGraphEvent
|
||||||
| DownloadAsCsvEvent
|
| DownloadAsCsvEvent
|
||||||
| RecommendationClickEvent
|
| RecommendationClickEvent
|
||||||
| HomePageRecommendationClickEvent
|
| HomePageRecommendationClickEvent
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import {
|
|||||||
FacetMetadata,
|
FacetMetadata,
|
||||||
SearchAcrossEntitiesInput,
|
SearchAcrossEntitiesInput,
|
||||||
} from '../../../../../../types.generated';
|
} from '../../../../../../types.generated';
|
||||||
import { UnionType } from '../../../../../search/utils/constants';
|
import { DEGREE_FILTER_NAME, UnionType } from '../../../../../search/utils/constants';
|
||||||
import { SearchCfg } from '../../../../../../conf';
|
import { SearchCfg } from '../../../../../../conf';
|
||||||
import { EmbeddedListSearchResults } from './EmbeddedListSearchResults';
|
import { EmbeddedListSearchResults } from './EmbeddedListSearchResults';
|
||||||
import EmbeddedListSearchHeader from './EmbeddedListSearchHeader';
|
import EmbeddedListSearchHeader from './EmbeddedListSearchHeader';
|
||||||
@ -27,6 +27,7 @@ import {
|
|||||||
import { useEntityContext } from '../../../EntityContext';
|
import { useEntityContext } from '../../../EntityContext';
|
||||||
import { EntityActionProps } from './EntitySearchResults';
|
import { EntityActionProps } from './EntitySearchResults';
|
||||||
import { useUserContext } from '../../../../../context/useUserContext';
|
import { useUserContext } from '../../../../../context/useUserContext';
|
||||||
|
import analytics, { EventType } from '../../../../../analytics';
|
||||||
|
|
||||||
const Container = styled.div`
|
const Container = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -266,6 +267,20 @@ export const EmbeddedListSearch = ({
|
|||||||
const finalFacets =
|
const finalFacets =
|
||||||
(fixedFilters && removeFixedFiltersFromFacets(fixedFilters, data?.facets || [])) || data?.facets;
|
(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 (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
{error && <Message type="error" content="Failed to load results! An unexpected error occurred." />}
|
{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 { ErrorSection } from '../shared/error/ErrorSection';
|
||||||
import usePrevious from '../shared/usePrevious';
|
import usePrevious from '../shared/usePrevious';
|
||||||
import { useGetLineageTimeParams } from './utils/useGetLineageTimeParams';
|
import { useGetLineageTimeParams } from './utils/useGetLineageTimeParams';
|
||||||
|
import analytics, { EventType } from '../analytics';
|
||||||
|
|
||||||
const DEFAULT_DISTANCE_FROM_TOP = 106;
|
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.
|
// they should be added to the dependency array below.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setAsyncEntities({});
|
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(() => {
|
useEffect(() => {
|
||||||
if (showColumns) {
|
if (showColumns) {
|
||||||
@ -183,6 +190,10 @@ export default function LineageExplorer({ urn, type }: Props) {
|
|||||||
onLineageExpand={(asyncData: EntityAndType) => {
|
onLineageExpand={(asyncData: EntityAndType) => {
|
||||||
resetAsyncEntity(asyncData.entity.urn);
|
resetAsyncEntity(asyncData.entity.urn);
|
||||||
maybeAddAsyncLoadedEntity(asyncData);
|
maybeAddAsyncLoadedEntity(asyncData);
|
||||||
|
analytics.event({
|
||||||
|
type: EventType.VisualLineageExpandGraphEvent,
|
||||||
|
targetEntityType: asyncData?.type,
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
refetchCenterNode={() => {
|
refetchCenterNode={() => {
|
||||||
refetch().then(() => {
|
refetch().then(() => {
|
||||||
|
|||||||
@ -67,6 +67,8 @@ public enum DataHubUsageEventType {
|
|||||||
MANUALLY_DELETE_LINEAGE_EVENT("ManuallyDeleteLineageEvent"),
|
MANUALLY_DELETE_LINEAGE_EVENT("ManuallyDeleteLineageEvent"),
|
||||||
LINEAGE_GRAPH_TIME_RANGE_SELECTION_EVENT("LineageGraphTimeRangeSelectionEvent"),
|
LINEAGE_GRAPH_TIME_RANGE_SELECTION_EVENT("LineageGraphTimeRangeSelectionEvent"),
|
||||||
LINEAGE_TAB_TIME_RANGE_SELECTION_EVENT("LineageTabTimeRangeSelectionEvent"),
|
LINEAGE_TAB_TIME_RANGE_SELECTION_EVENT("LineageTabTimeRangeSelectionEvent"),
|
||||||
|
VISUAL_LINEAGE_EXPAND_GRAPH_EVENT("VisualLineageExpandGraphEvent"),
|
||||||
|
VISUAL_LINEAGE_VIEW_EVENT("VisualLineageViewEvent"),
|
||||||
CREATE_QUERY_EVENT("CreateQueryEvent"),
|
CREATE_QUERY_EVENT("CreateQueryEvent"),
|
||||||
DELETE_QUERY_EVENT("DeleteQueryEvent"),
|
DELETE_QUERY_EVENT("DeleteQueryEvent"),
|
||||||
UPDATE_QUERY_EVENT("UpdateQueryEvent"),
|
UPDATE_QUERY_EVENT("UpdateQueryEvent"),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user