Couchbase .NET SDK __CB_SDK_VERSION__

Show / Hide Table of Contents

Interface IRequestSpan

A wrapper interface for all spans flowing through the SDK.

Inherited Members
IDisposable.Dispose()
Namespace: Couchbase.Core.Diagnostics.Tracing
Assembly: Couchbase.NetClient.dll
Syntax
public interface IRequestSpan : IDisposable

Properties

View Source

CanWrite

If true IRequestSpan attributes will be written for this tag. In cases such as the NoopRequestSpan it should be false as no attributes/tags are collected.

Declaration
bool CanWrite { get; }
Property Value
Type Description
bool
View Source

Duration

The duration of the span set after Dispose() or End() is called.

Declaration
uint? Duration { get; }
Property Value
Type Description
uint?
View Source

Id

The id, possibly from the underlying activity, of the span.

Declaration
string? Id { get; }
Property Value
Type Description
string
View Source

Parent

The optional parent span.

Declaration
IRequestSpan? Parent { get; set; }
Property Value
Type Description
IRequestSpan

Methods

View Source

AddEvent(string, DateTimeOffset?)

Sets an event on the span which translates to the corresponding implementation.

Declaration
IRequestSpan AddEvent(string name, DateTimeOffset? timestamp = null)
Parameters
Type Name Description
string name

The name of the event.

DateTimeOffset? timestamp

The timestamp when it happened.

Returns
Type Description
IRequestSpan
Remarks

Depending upon the implementation the event might be ignored (NOOP) for example.

View Source

ChildSpan(string)

Creates a child span from this span.

Declaration
IRequestSpan ChildSpan(string name)
Parameters
Type Name Description
string name

The name of the span.

Returns
Type Description
IRequestSpan

A child span with references to the parent span.

View Source

End()

Completes the span.

Declaration
void End()
View Source

SetAttribute(string, bool)

Sets an attribute on the span which is translated to a corresponding implementation specific tag.

Declaration
IRequestSpan SetAttribute(string key, bool value)
Parameters
Type Name Description
string key

The key of attribute.

bool value

The boolean value of the attribute.

Returns
Type Description
IRequestSpan
Remarks

Depending upon the implementation the attribute might be ignored (NOOP) for example.

View Source

SetAttribute(string, string)

Sets an attribute on the span which is translated to a corresponding implementation specific tag.

Declaration
IRequestSpan SetAttribute(string key, string value)
Parameters
Type Name Description
string key

The key of attribute.

string value

The string value of the attribute.

Returns
Type Description
IRequestSpan
Remarks

Depending upon the implementation the attribute might be ignored (NOOP) for example.

View Source

SetAttribute(string, uint)

Sets an attribute on the span which is translated to a corresponding implementation specific tag.

Declaration
IRequestSpan SetAttribute(string key, uint value)
Parameters
Type Name Description
string key

The key of attribute.

uint value

The uint value of the attribute.

Returns
Type Description
IRequestSpan
Remarks

Depending upon the implementation the attribute might be ignored (NOOP) for example.

View Source

SetStatus(RequestSpanStatusCode)

Sets the status code of the span.

Declaration
IRequestSpan SetStatus(RequestSpanStatusCode code)
Parameters
Type Name Description
RequestSpanStatusCode code

The status code to set.

Returns
Type Description
IRequestSpan
Remarks

Should only be set on the outer request span: Ok on success, Error on failure. Implementations that don't support status (e.g. NoopRequestSpan) silently ignore this call.

Extension Methods

RequestSpanExtensions.LogOrphaned(IRequestSpan)
RequestSpanExtensions.WithCommonTags(IRequestSpan)
  • View Source
In this article
Back to top Copyright © 2020 Couchbase, Inc. All rights reserved.