ActivityContext 结构

定义

符合 W3C TraceContext 规范的表示形式。A representation that conforms to the W3C TraceContext specification. 它包含两个标识符:一个 TraceId 和一个 SpanId,以及一组常见的 TraceFlag 和特定于系统的 TraceState 值。It contains two identifiers: a TraceId and a SpanId, along with a set of common TraceFlags and system-specific TraceState values.

public value class ActivityContext : IEquatable<System::Diagnostics::ActivityContext>
public struct ActivityContext : IEquatable<System.Diagnostics.ActivityContext>
type ActivityContext = struct
Public Structure ActivityContext
Implements IEquatable(Of ActivityContext)
继承
ActivityContext
实现

注解

ActivityContext 包含属性 IsRemote ,该属性不是 W3C 的组成部分。ActivityContext contains the property IsRemote, which is not part of W3C. IsRemote 指示上下文是否从远程父项传播。IsRemote is indicating if the context is propagated from a remote parent.

构造函数

ActivityContext(ActivityTraceId, ActivitySpanId, ActivityTraceFlags, String, Boolean)

使用指定的参数构造新的活动上下文实例。Construct a new activity context instance using the specified arguments.

属性

IsRemote

指示活动上下文是否从远程父项传播。Indicates if the activity context was propagated from a remote parent.

SpanId

调用方已知的请求 ID。The Id of the request as known by the caller.

TraceFlags

由 W3C 标准定义的标志以及活动 ID。The flags defined by the W3C standard along with the ID for the activity.

TraceId

跟踪标识符。The trace identifier.

TraceState

保存 W3C“tracestate”标头。Holds the W3C 'tracestate' header.

方法

Equals(ActivityContext)

指示当前对象是否等于同一类型的另一个对象。Indicates whether the current object is equal to another object of the same type.

Equals(Object)

确定此实例是否与指定的 ActivityContext 对象具有相同的值。Determines whether this instance and a specified ActivityContext object have the same value.

GetHashCode()

提供当前 ActivityContext 的哈希函数,适合用于哈希算法和数据结构(如哈希表)。Provides a hash function for the current ActivityContext that's suitable for hashing algorithms and data structures, such as hash tables.

Parse(String, String)

将 W3C 跟踪上下文标头分析为 ActivityContext 对象。Parses a W3C trace context headers to an ActivityContext object.

TryParse(String, String, ActivityContext)

尝试将 W3C 跟踪上下文标头分析为 ActivityContext 对象。Tries to parse the W3C trace context headers to an ActivityContext object.

运算符

Equality(ActivityContext, ActivityContext)

确定两个指定的 ActivityContext 值是否相等。Determines whether two specified ActivityContext values are equal.

Inequality(ActivityContext, ActivityContext)

确定两个指定的 ActivityContext 值是否不相等。Determines whether two specified ActivityContext values are not equal.

适用于