Skip to content

v1.12.0

Compare
Choose a tag to compare
@cretz cretz released this 08 Dec 16:24
· 504 commits to master since this release
dff25ea

Highlights

πŸ’₯ There are breaking changes in this release for interceptors, tracing, and metrics. See below for more details.

Interceptor Redesign

The entire package of interceptors has changed to interceptor and now includes many more forms of interceptors beyond just the workflow ones before. The workflow interceptor has also been reworked to match other SDKs.

A new option has been added for client.Options.Interceptors that accepts client-level and worker-level interceptors.

The worker.Options.WorkflowInterceptorChainFactories option has been removed and replaced with Interceptors that accepts worker-level interceptors.

Tracing

In previous versions, OpenTracing was configured via client.Options.Tracer. This option has been removed and tracing is now implemented for both OpenTracing and OpenTelemetry via interceptors in separate modules in go.temporal.io/sdk/contrib/opentracing and go.temporal.io/sdk/contrib/opentelemetry respectively.

If you had previously done:

client.Options.Tracer = myOpenTracingTracer

You would now go get go.temporal.io/sdk/contrib/opentracing and:

tracingInterceptor, err := opentracing.NewInterceptor(opentracing.TracerOptions{Tracer: myOpenTracingTracer})
if err != nil {
  return err
}
client.Options.Interceptors = append(client.Options.Interceptors, tracingInterceptor)

A similar approach is taken with OpenTelemetry. This allows use of your choice of tracing implementation without requiring the primary SDK module to have a dependency on OpenTracing or OpenTelemetry.

Metrics

In previous versions, Tally was configurable directly in client.Options.MetricsScope, available for use inside workflows via workflow.GetMetricsScope, and available for use inside activities via activity.GetMetricsScope.

Now, metrics have been abstracted into a client.MetricsHandler and the client options and calls for obtaining it have changed. Tally has been moved to a separate module at go.temporal.io/sdk/contrib/tally with implementation of client.MetricsHandler.

If you had previously done:

client.Options.MetricsScope = myTallyScope

You would now go get go.temporal.io/sdk/contrib/tally and:

client.Options.MetricsHandler = tally.NewMetricsHandler(myTallyScope)

Also, if you had previously used the Temporal metrics scope to record your own metrics using workflow.GetMetricsScope and/or activity.GetMetricsScope, now you would use workflow.GetMetricsHandler and/or activity.GetMetricsHandler respectively.

Note, the new client.MetricsHandler interface does not abstract histograms as Tally does. If you must still use Temporal-based metrics scope inside of workflows/activities and use histograms, the scope can be re-obtained via tally.ScopeFromHandler. However, for workflows it does not properly skip recording metrics during replay like the previous Tally implementation did. You will need to check for replay before recording the histogram. See tally.ScopeFromHandler documentation for more details.

This abstraction allows use of your choice of metrics implementations without requiring the primary SDK module to have a dependency on Tally.

gRPC Exposure

client.Client now exposes the raw gRPC workflow service via WorkflowService(). Also, client.Options.ConnectionOptions.DialOptions accept gRPC dial options for advanced use cases.

Previously, gRPC was a hidden implementation detail. To match other SDKs, gRPC has been made visible so developers can do advanced gRPC-specific things.

Specific Changes

2021-11-15 - 00a6c49 - Document ambiguous ID and test for mismatch on signal start (#612)
2021-11-15 - 059ec4f - Interceptor Redesign/Rewrite and OpenTelemetry/Opentracing Implementation (#610)
2021-11-16 - 39861e4 - Add a request ID to cancel and signal calls (#633)
2021-11-18 - 4e224d6 - Fix issue for zero-values of pointer arguments in workflows. (#640)
2021-11-19 - be507a3 - Add ability to not wait on child workflows in test suite. (#632)
2021-11-23 - 3eee985 - Update Tally (#652)
2021-11-23 - 651c63c - Add task pool slots remaining metric (#637)
2021-11-23 - 7aac310 - Add mmcshane to CODEOWNERS (#649)
2021-11-23 - 9424898 - Fixed worker.New docs. (#634)
2021-12-01 - f9d61f2 - Add debug log for all errors received from RecordActivityHeartbeat (#657)
2021-12-02 - 6c694d5 - Add GetLogger method to Tracer interface (#655)
2021-12-02 - 960d3e9 - Fix invalid command ID expectation on child workflow cancel (#647)
2021-12-02 - a707cbc - Expose gRPC (#651)
2021-12-03 - 7125db9 - Add a little detail on when heartbeat is seen from the activity side (#650)
2021-12-07 - c453756 - Metrics/tracing dependency abstraction and multi-module repository (#653)