Skip to content

Commit

Permalink
Add events to the flow run graph (#13875)
Browse files Browse the repository at this point in the history
  • Loading branch information
pleek91 committed Jun 7, 2024
1 parent 0233add commit bb1bcb7
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions ui/src/components/FlowRunGraphs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
v-model:fullscreen="fullscreen"
v-model:viewport="dateRange"
v-model:selected="selection"
:flow-run="flowRun"
:flow-run
:fetch-events
class="flow-run-graphs__flow-run"
/>
</div>
Expand Down Expand Up @@ -39,14 +40,19 @@
FlowRunGraphSelectionPanel,
FlowRunGraphArtifactDrawer,
FlowRunGraphArtifactsPopover,
FlowRunGraphStatePopover
FlowRunGraphStatePopover,
RunGraphFetchEventsContext,
RunGraphEvent,
WorkspaceEventsFilter,
useWorkspaceApi
} from '@prefecthq/prefect-ui-library'
import { computed, ref } from 'vue'
defineProps<{
flowRun: FlowRun,
}>()
const api = useWorkspaceApi()
const dateRange = ref<RunGraphViewportDateRange>()
const fullscreen = ref(false)
Expand All @@ -63,6 +69,25 @@
},
}
})
const fetchEvents = async ({ nodeId, since, until }: RunGraphFetchEventsContext): Promise<RunGraphEvent[]> => {
const filter: WorkspaceEventsFilter = {
anyResource: {
id: [`prefect.flow-run.${nodeId}`],
},
event: {
excludePrefix: ['prefect.log.write', 'prefect.task-run.'],
},
occurred: {
since,
until,
},
}
const { events } = await api.events.getEvents(filter)
return events
}
</script>
<style>
Expand Down

0 comments on commit bb1bcb7

Please sign in to comment.