<@ULVA73B9P> what is the max size for metadata on ...
# ask-marvin
f
@Marvin what is the max size for metadata on assets?
m
thought for 243.6 seconds
Short answer: there isn’t a per-key limit; the cap is on the total event size that carries your asset metadata. Details (Prefect 3.x): - Asset metadata is sent as the event payload when an asset is materialized or when you call
add_metadata
. - The entire serialized event (including your metadata payload, resource labels, related resources, etc.) has a default maximum size of 1.5 MB (1,500,000 bytes). - This is controlled by the
PREFECT_EVENTS_MAXIMUM_SIZE_BYTES
setting. If the event exceeds the limit, it’s rejected/dropped and the metadata won’t be recorded. - There’s no separate per-key or per-value limit for metadata—just the total event size. - Separate from runtime metadata, the static Asset description (in AssetProperties) is capped at 2,500 characters. Cloud vs OSS: - Same defaults and behavior are used; no documented Cloud-specific difference. In practice, Cloud could have additional gateway limits, but none are documented. Tips: - Keep metadata well under 1.5 MB to leave room for other event fields. - For large blobs (schemas, samples), store them externally and add a link in metadata. - On OSS, you can raise the limit by setting:
Copy code
export PREFECT_EVENTS_MAXIMUM_SIZE_BYTES=2000000
Are you hitting the limit today? If you share a snippet or the approximate size of your metadata, I can help right-size or suggest a pattern.