Name
Name
A span name is a string descriptive of what the span does. Span names should be statistically meaningful. Most tracing backend and analysis tools use span names to auto generate reports for the represented work.
Examples of span names:
- “cache.Get” represents the Get method of the cache service.
- ”/messages” represents the messages web page.
- ”/api/user/(\d+)” represents the user detail pages.
Names are usually created in the span’s constructor.
Source code sample
We’ll create a span with the Name “cache.Get”, below:
try (Scope ss = TRACER.spanBuilder("cache.Get").startScopedSpan()) {
}
ctx, span := trace.StartSpan(ctx, "cache.Get")
with tracer.span(name="cache.get") as span:
pass
opencensus::trace::Span span = opencensus::trace::Span::StartSpan(
"cache.Get", nullptr, {&sampler});
tracer.startRootSpan({name: 'cache.Get'}, rootSpan => {
});
Visuals
The span when visualized will look something like this:
References
Resource | URL |
---|---|
Name in datamodel reference | proto/v1/Span.Name |