Hello, I would like to add a metadata to all the a...
# ask-community
g
Hello, I would like to add a metadata to all the asset materialization: e.g. the time it took to materialize the asset. Is there a simple way to achieve that? I am a bit lost and don't know which tool to use: asset materialization sensors/events? I guess that I should be able to achieve what I want by surrounding each function with a
time.time()
and add the difference in an output metadata. But it feels dirty. Thanks!
o
g
well yeah this will be nice to extract statistics, but here I'd like to add the time it took for each asset materialization so I can see this in the UI metadata graph
m
Hi @Odette Harary I have the same question as Guillaume. Also somebody asked this question on stackoverflow. Is there a way to avoid the boilerplate code ? For example dagster-dbt adds this out of box for every dbt asset.
g
it is possible to have an even simpler test case: the https://github.com/dagster-io/dagster/blob/master/examples/deploy_docker/repo.py also provide the "Execution Time" metadata. But I cant find which part of the code is responsible for it.
Hey @Marek Vigaš, did you find a way to avoid boilerplate code?