Table of Contents

Struct Status

Namespace
OpenTelemetry.Trace
Assembly
OpenTelemetry.Api.dll

Span execution status.

public readonly struct Status : IEquatable<Status>
Implements
Inherited Members

Fields

Error

The operation contains an error.

public static readonly Status Error

Field Value

Status

Ok

The operation completed successfully.

public static readonly Status Ok

Field Value

Status

Unset

The default status.

public static readonly Status Unset

Field Value

Status

Properties

Description

Gets the status description.

public string Description { get; }

Property Value

string

StatusCode

Gets the canonical code from this status.

public StatusCode StatusCode { get; }

Property Value

StatusCode

Methods

Equals(Status)

public bool Equals(Status other)

Parameters

other Status

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

WithDescription(string)

Returns a new instance of a status with the description populated.

public Status WithDescription(string description)

Parameters

description string

Description of the status.

Returns

Status

New instance of the status class with the description populated.

Remarks

Note: Status Description is only valid for Error Status and will be ignored for all other StatusCode values. See the Status API for details.

Operators

operator ==(Status, Status)

Compare two Status for equality.

public static bool operator ==(Status status1, Status status2)

Parameters

status1 Status

First Status to compare.

status2 Status

Second Status to compare.

Returns

bool

operator !=(Status, Status)

Compare two Status for not equality.

public static bool operator !=(Status status1, Status status2)

Parameters

status1 Status

First Status to compare.

status2 Status

Second Status to compare.

Returns

bool