Mike Atlas
12/16/2022, 5:35 PMdagster.OpExecutionContext
to add a member to the context
without using a resource definition? I'm considering ways to implement some metrics and pretty much want the dependency to always be available just like the log
member is in the context.jamie
12/16/2022, 5:44 PMcontext
object for each op/asset and there isn’t a way to customize how that context is created. one thing you could consider is writing a custom decorator that wraps @op
or @asset
that always adds a required_resource_key
for the member you want to add. then that would be available to all of your ops and assetsMike Atlas
12/16/2022, 5:49 PMjamie
12/16/2022, 5:52 PMMike Atlas
12/16/2022, 5:53 PMlog
object and extend it with my own methods to log metrics?
@repository(default_logger_defs=MyMetricsEnhancedLogger)
jamie
12/16/2022, 6:06 PMMike Atlas
12/16/2022, 6:09 PMUser-defined custom log levels are not supported, and calls to, e.g.,hmm maybe not ahahaorcontext.log.trace
will result in hard exceptions at runtime.context.log.notice
.info
level (or any other level) I could then pipe in a json string of metrics, but that's grossjamie
12/16/2022, 6:40 PMMike Atlas
12/16/2022, 6:44 PM