Azure持久功能和数据保留 [英] Azure durable functions and retention of data

查看:50
本文介绍了Azure持久功能和数据保留的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以看到azure持久功能使用存储帐户来管理状态和检测.在具有大量数据表和队列的环境中运行持久功能时,将变得越来越大,并且相应地速度也会越来越慢.持久功能是否可以自我记录日志,还是您需要自己完成这项任务?

I can see azure durable functions uses a storage account for managing state and instrumentation. When running durable functions in an environment with a high amount of data tables and queues will get larger and larger, and properly slower and slower. Does durable function clean logs them self, or is this a task you need to do your self?

推荐答案

研究此问题之后,似乎应该由开发人员来实现自己的处理程序.我通读了github问题,并发布了可接受的答案,并且看起来函数团队仅实现了API所需的

After researching this, it appear that it's up to the developer to implement their own handler for this. I read through the github issue the accepted answer posted and it looks like the Functions team only implemented the API's needed, but no automated code.

Here's the example from the official docs - just adds a timer function that removes all history up to 30 days ago.

[FunctionName("PurgeInstanceHistory")]
public static Task Run(
    [DurableClient] IDurableOrchestrationClient client,
    [TimerTrigger("0 0 12 * * *")]TimerInfo myTimer)
{
    return client.PurgeInstanceHistoryAsync(
        DateTime.MinValue,
        DateTime.UtcNow.AddDays(-30),  
        new List<OrchestrationStatus> { OrchestrationStatus.Completed });
}

他们在文档中还注意到清除大量记录的速度可能很慢.他们不是在开玩笑.您可以在

Also in the docs they note that purging a large number of records may be...slow. They're not kidding. You can catch up the purge prior to automating it with an HTTP API call.

DELETE /runtime/webhooks/durabletask/instances
    ?taskHub={taskHub}
    &connection={connectionName}
    &code={systemKey}
    &createdTimeFrom={timestamp}
    &createdTimeTo={timestamp}
    &runtimeStatus={runtimeStatus1,runtimeStatus2,...}

这篇关于Azure持久功能和数据保留的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆