Hello “OpenCensus” trace events

Here's an example of creating a Span and record some trace annotations. Notice that recording the annotations is possible because we propagate scope. 3rd parties libraries like SLF4J can integrate the same way.

import io.opencensus.common.Scope;import io.opencensus.trace.Tracer;import io.opencensus.trace.Tracing;import io.opencensus.trace.samplers.Samplers;publicfinalclassMyClassWithTracing{privatestaticfinalTracer tracer =Tracing.getTracer();publicstaticvoid doWork(){// Create a child Span of the current Span. Always record events for this span and force it to// be sampled. This makes it easier to try out the example, but unless you have a clear use// case, you don't need to explicitly set record events or sampler.try(Scope ss =
tracer
.spanBuilder("MyChildWorkSpan").setRecordEvents(true).setSampler(Samplers.alwaysSample()).startScopedSpan()){
doInitialWork();
tracer.getCurrentSpan().addAnnotation("Finished initial work");
doFinalWork();}}privatestaticvoid doInitialWork(){// ...
tracer.getCurrentSpan().addAnnotation("Important.");// ...}privatestaticvoid doFinalWork(){// ...
tracer.getCurrentSpan().addAnnotation("More important.");// ...}}

How to setup debugging Z-Pages?

Versioning

GA: Libraries defined at a GA quality level are stable, and will not introduce backwards-incompatible changes in any minor or patch releases. We will address issues and requests with the highest priority. If we were to make a backwards-incompatible changes on an API, we will first mark the existing API as deprecated and keep it for 18 months before removing it.

Beta: Libraries defined at a Beta quality level are expected to be mostly stable and we're working towards their release candidate. We will address issues and requests with a higher priority. There may be backwards incompatible changes in a minor version release, though not in a patch release. If an element is part of an API that is only meant to be used by exporters or other opencensus libraries, then there is no deprecation period. Otherwise, we will deprecate it for 18 months before removing it, if possible.