OpenTracing and OpenTelemetry for Temporal

We are currently using OpenTracing but The OpenTracing project is deprecated in favor of the OpenTelemetry project. Is Temporal compatible with the OpenTelemetry project if we needed to rollover to use OpenTelemetry?

Absolutely. Today you’d use OpenTracing by adding opentracing package - go.temporal.io/sdk/contrib/opentracing - Go Packages to your go.mod and adding the result of opentracing.NewInterceptor to client.Options.Interceptors. When you move to OpenTelemetry, you’d add opentelemetry package - go.temporal.io/sdk/contrib/opentelemetry - Go Packages to your go.mod and add the result of opentelemetry.NewTracingInterceptor to client.Options.Interceptors.

1 Like

Regarding this, from what i see in the go sdk
opentelemetry only used to configure for interceptor
can we configure opentelemetry in the metrics handler ?
Currently from what i see the NewMetricHandler only accept scope as the input, is it possible to use open telemetry in here, or telemetry usage in interceptor


picture from temporal server git

We have no built-in support for OpenTelemetry metrics (we have built-in support for Otel tracing, but Otel metrics haven’t been stable for long, but we probably will build in support soon). But client package - go.temporal.io/sdk/client - Go Packages (i.e. metrics package - go.temporal.io/sdk/internal/common/metrics - Go Packages) is a really easy interface to implement for whatever metric system you would like.

1 Like

Similar to OP’s scenario, we are currently still on OpenCensus, is temporal compatible with OpenCensus or we have to migrate to use OpenTelemetry?

OpenCensus has become OpenTelemetry and OpenCensus is being sunset (they are still delivering security patches though). This can be seen at the top of https://opencensus.io/, from the blog post at Merging OpenTracing and OpenCensus: A Roadmap to Convergence | by Ted Young | OpenTracing | Medium, and in many other places.

While we are probably not going to have explicit support for GitHub - census-instrumentation/opencensus-go: A stats collection and distributed tracing framework (hasn’t had a release in over a year), you can make your own implementation of a tracer interceptor if you must use OpenCensus. See the OpenTracing and OpenTelemetry packages for how the code might look.