Advanced Metrics Support

The Rust core that the .NET SDK uses has always provided metrics and a way to export via OpenTelemetry or Prometheus. This release improves the exposure of these metrics in few ways:

First, a MetricMeter property has been added to TemporalRuntimeActivityExecutionContext, and Workflow for those wanting to record their own metrics using the core-based metrics (but it is often still more desirable to use one's own metrics implementation). The Workflow.MetricMeter has logic to ignore metrics recorded inside workflows.

Second, a Temporal runtime is the overall object created to power Temporal features (if not using the default) and its MetricOptions now have a CustomMetricMeter which accepts a ICustomMetricMeter implementation. If set, this interface will be used for all core-based metrics.

Finally a new extension project, Temporalio.Extensions.DiagnosticSource, has been created which contains an ICustomMetricMeter implementation that sends core metrics to an underlying System.Diagnostics.Metrics.Meter implementation. So with this extension, users can have all internal SDK metrics flow through traditional .NET metrics utilities, even though they originate in Temporal's Rust core.

Several Minor Additions

  • Added Workflow.CurrentHistoryLength, Workflow.CurrentHistorySize, and Workflow.ContinueAsNewSuggested to help developers understand history sizes and when to continue as new

  • Added WorkflowInfo.LastFailure and WorkflowInfo.LastResult for use by workflow retrying and schedules

  • Added TemporalConnectionOptions.KeepAlive to support client keep alive, and defaulted it to 30s interval with 15s timeout

  • Added WorkflowOptions.StartDelay to add a delay to the start of a workflow

  • Added experimental support for workflow update, which is only available in bleeding edge open source server environments


Only a couple of barely visible, rarely used things were changed this release:

  • Static methods on for creating activity definitions




    removed cache boolean parameter since caching of activity definitions is no longer that valuable (#118)

  • Removed




    property and associated class since this was only for advanced internal support for core tracing (i.e. not related to actual Temporal/workflow tracing)