microsoft / microsoft/durabletask-dotnet
[Feature] Consider Adding API to DurableTaskClient for Fetching Task Hub Metadata
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 193
- Forks
- 60
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 4
Description
My team runs two applications: a function app that uses durable functions as well as a web app. From that web app, clients can trigger asynchronous operations that submit orchestrations to the Task Hub via a DurableTaskClient. However, we run in K8s and so we have a number of health checks that run periodically. Can the web app communicate with its Azure Storage account? Its Azure SQL Server DB? Similarly, we have written a custom one for DTFx.
A simple one could be invoke a read-only method like GetAllInstancesAsync, but for the Azure Storage backend, this only checks the connection Azure Table Storage and not necessarily its Queue or Blob connection. Furthermore, there may be scenarios in which client's want to query information about backend-specific metadata.
I could imagine an API like the following:
public abstract class DurableTaskClient : IOrchestrationSubmitter, IAsyncDisposable
{
public abstract Task<TaskHubInfo> GetTaskHubInfoAsync(CancellationToken cancellationToken = default);
}
public class TaskHubInfo
{
public string Name { get; }
public DateTimeOffset Created { get; }
public int RunningOrchestrationCount { get; }
public int RunningActivityCount { get; }
}
Different backends could contribute their own metadata, like the following for Azure Storage:
public class AzureStorageTaskHubInfo : TaskHubInfo
{
public int PartitionCount { get; }
public int WorkerQueueMessageCount { get; }
public IReadOnlyList<int> ControlQueueMessageCounts { get; }
}
For users that know what backend they're operating with, they can leverage this additional information:
using CancellationTokenSource cts = new();
TaskHubInfo info = await _durableTaskClient.GetTaskHubInfo(cts.Token);
if (info is AzureStorageTaskHubInfo storageInfo)
{
// Process
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the DurableTaskClient API and the Azure Storage backend entry points; the issue names no specific files or tests. Compare the proposed common TaskHubInfo contract with backend-specific metadata needs, and consider what a complete design would require across supported backends.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- api, backend, cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100