ancient-wolf-19325
06/26/2024, 2:55 PMflytekit.ExecutionParameters class. This object is available in every @task method and can be accessed using flytekit.current_context(). The ExecutionParameters object includes a stats attribute, which is a handle to a special statsd object for emitting custom metrics.
from flytekit import current_context
@task
def my_task():
context = current_context()
stats = context.stats
# Emit custom stats
stats.timer("custom_metric").start()
# Your task logic here
stats.timer("custom_metric").stop()
For more details, refer to the flytekit.ExecutionParameters documentation.
Would you like more detail on how to use this in your workflows?
Sources:
- flytekit.ExecutionParameters
- Flyte Monitoring
Slack Link
https://flyte-org.slack.com/archives/CP2HDHKE1/p1719413695.426299 π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.