Joshua Massover
07/14/2022, 10:38 PMdef patch_task():
method = getattr(CloudTaskRunner, "run")
def patched(self, *args, **kwargs):
name = self.task.name
with tracer.trace(f"task", resource=name):
result = method(self, *args, **kwargs)
tracer.flush()
return result
setattr(CloudTaskRunner, "run", patched)
def patch_flow():
method = getattr(CloudFlowRunner, "run")
def patched(self, *args, **kwargs):
name = self.flow.name
with tracer.trace(f"flow", resource=name):
result = method(self, *args, **kwargs)
tracer.flush()
return result
setattr(CloudFlowRunner, "run", patched)
Anna Geller
07/15/2022, 1:25 AMJoshua Massover
07/15/2022, 12:21 PMAnna Geller
07/15/2022, 12:43 PMJoshua Massover
07/15/2022, 3:41 PMif you want to, I could open a feature request for sending logs to DatadogNo need for this, thank you though.
and for tracing, we do that already in Cloud 2.0 using https://github.com/trallnag/prometheus-fastapi-instrumentatorI don't understand the intent of this comment. Specifically I'm not sure what this library would do in regards to a prefect end user that's interested in setting up tracing around their flows and tasks.