Page MenuHomeElementl

Add an HTML metadata entry type, allow JSON and HTML to be inlined into logs

Authored by bengotow on Dec 16 2020, 6:39 AM.



This diff adds a new metadata entry type that provides a catch-all for users who want to display more interesting stuff in the log view. It was suggested in and seemed like it'd be useful, but I wouldn't object if we want to postpone this in favor of more codified graphing support later.

By default, HTML you provide is shown as [Show HTML] and the modal displays the content within a sandboxed iframe. If you pass inline=True, we trust you know what you're doing and allow the HTML to appear directly within the metadata entries table in the logs. This allows you to do cool stuff, but largely requires that your HTML snippet have a fully specified or immediately calculatable size and is fairly small. The screenshots below show it being used to embed an SVG with a bar chart, and a small image.


Screen Shot 2020-12-16 at 12.31.30 AM.png (2×3 px, 1 MB)


Screen Shot 2020-12-16 at 12.31.32 AM.png (2×3 px, 1 MB)

Screen Shot 2020-12-16 at 12.30.07 AM.png (2×3 px, 1 MB)

Test Plan

Run updated ManyEvents pipeline

Diff Detail

R1 dagster
Lint Passed
No Test Coverage

Event Timeline

bengotow edited the summary of this revision. (Show Details)

Apply constructor defaults for backwards compatibility with serialized data

Harbormaster returned this revision to the author for changes because remote builds failed.Dec 16 2020, 7:09 AM
Harbormaster failed remote builds in B22952: Diff 27915!
  • Fix missing documentation

The inline option makes me very nervous, not gonna lie.

Thinking about if we would ever support this with an elementl-hosted service, and I think probably no??

I have fairly grave concerns about this. I think we open ourselves to a lot of chicanery.

Sounds good! Yeah I agree doing this on hosted dagit would be bad. There are a few improvements in this diff separate from the actual HTML / JSON / inlining feature and I'll pull those into a separate tiny diff here in a bit.