marmotdata/prefect
Discover flows, tasks and run history from Prefect Cloud or a self-hosted Prefect server
The Prefect plugin discovers flows, their tasks and their recent runs from Prefect Cloud or a self-hosted Prefect server. It targets the Prefect 3 REST API.
Each flow becomes a Pipeline asset carrying its deployments, schedules and tags. Each distinct task of the flow's most recent run becomes a Task asset named after the task with the MRN mrn://asset/task/prefect/<flow>.<task>, linked to its flow by a CONTAINS edge and to the tasks it consumed by DEPENDS_ON edges. Recent flow runs are recorded as run history.
Authentication
Prefect Cloud uses api_key, sent as a bearer token. A self-hosted server that has authentication enabled uses auth_string, a user:password pair sent as basic auth. A self-hosted server with no authentication needs neither.
The host field takes the API URL. Prefect serves its API under /api, which is added when the configured URL leaves it off. For Prefect Cloud, use the workspace URL: https://api.prefect.cloud/api/accounts/<account>/workspaces/<workspace>.
Set zone when you catalogue more than one Prefect server. It becomes part of every MRN, for example mrn://asset/pipeline/prefect@prod/nightly-etl.
Table lineage
Prefect's Assets API reports the tables and buckets a flow run read and wrote, which the plugin turns into FEEDS and PRODUCES edges to the assets other plugins own. That API exists on Prefect Cloud only; a self-hosted server has no equivalent, so only the flow's own structure is discovered there.
Tables are named as their own plugin names them, for example <database>.<schema>.<table> for PostgreSQL and <database>.<table> for MySQL. When the asset key names a PostgreSQL, MySQL, MariaDB or ClickHouse server, the edge carries that host as a hint so Marmot can pick the right zone.
In the UI
Point and click, no config file needed.
- Open Runs and choose Create pipeline.
- Pick Prefect from the plugin list.
- Fill in the settings, set a schedule and save.
With the CLI
Save a YAML config, then run marmot ingest.
Not using plugins? Other ways to populate Marmot
Configuration
Fields marked Required must be set.
tagsList of textTags to apply to discovered assets
external_linksList of groupsExternal links to show on all assets
nameTextDisplay name for the link
iconTextIcon identifier for the link
urlTextURL to the external resource
filterGroup of settingsFilter discovered assets by name (regex)
includeList of textInclude patterns for resource names (regex)
excludeList of textExclude patterns for resource names (regex)
zoneTextTells this system apart from others of the same technology and becomes part of every asset's MRN
hostText RequiredPrefect API URL, for example http://localhost:4200/api
api_keySecretPrefect Cloud API key
auth_stringSecretSelf-hosted server credentials, as user:password
verify_sslYes or noCheck the server's TLS certificate
include_tasksYes or noDiscover the tasks of each flow's most recent run
include_deploymentsYes or noRead deployments for schedules, tags and descriptions
include_run_historyYes or noRecord recent flow runs as run history
run_history_limitNumberHow many recent runs to read per flow
Assets emitted
Metadata this plugin attaches to each discovered asset.
Pipeline
The metadata fields the Prefect plugin emits for a flow (Pipeline) asset.
Task
The metadata fields for a Task asset.
Run Facet
The facets attached to each run-history event of a Pipeline asset.