Activity.SetParentId 方法
定义
重载
| SetParentId(ActivityTraceId, ActivitySpanId, ActivityTraceFlags) |
使用 TraceId 和 SpanId 的 W3C 约定设置父 ID。Sets the parent ID using the W3C convention of a TraceId and a SpanId. |
| SetParentId(String) |
更新此 Activity,以指示 ID 为 |
SetParentId(ActivityTraceId, ActivitySpanId, ActivityTraceFlags)
使用 TraceId 和 SpanId 的 W3C 约定设置父 ID。Sets the parent ID using the W3C convention of a TraceId and a SpanId.
public System.Diagnostics.Activity SetParentId (System.Diagnostics.ActivityTraceId traceId, System.Diagnostics.ActivitySpanId spanId, System.Diagnostics.ActivityTraceFlags activityTraceFlags = System.Diagnostics.ActivityTraceFlags.None);
member this.SetParentId : System.Diagnostics.ActivityTraceId * System.Diagnostics.ActivitySpanId * System.Diagnostics.ActivityTraceFlags -> System.Diagnostics.Activity
Public Function SetParentId (traceId As ActivityTraceId, spanId As ActivitySpanId, Optional activityTraceFlags As ActivityTraceFlags = System.Diagnostics.ActivityTraceFlags.None) As Activity
参数
- traceId
- ActivityTraceId
父活动的 TraceId。The parent activity's TraceId.
- spanId
- ActivitySpanId
父活动的 SpanId。The parent activity's SpanId.
- activityTraceFlags
- ActivityTraceFlags
其中一个枚举值,该值指定由 W3C 标准定义的与活动关联的标志。One of the enumeration values that specifies flags defined by the W3C standard that are associated with an activity.
返回
便于链接的 this。this for convenient chaining.
注解
此方法的优点是,无需进行字符串操作即可设置 ID。This method has the advantage that no string manipulation is needed to set the ID.
适用于
SetParentId(String)
public:
System::Diagnostics::Activity ^ SetParentId(System::String ^ parentId);
public System.Diagnostics.Activity SetParentId (string parentId);
member this.SetParentId : string -> System.Diagnostics.Activity
Public Function SetParentId (parentId As String) As Activity
参数
- parentId
- String
父级操作的 ID。The ID of the parent operation.
返回
便于链接的 this。this for convenient chaining.
注解
此属性应仅用于 "边界" 方案,其中 Activity 来自其他进程的逻辑启动此 Activity 。This property should only be used in 'boundary' scenarios where an Activity from another process logically started this Activity. 将 parentId 打开 (以及 Tags ParentId 属性) ,可用于重新构造因果树。The parentId brings up the Tags (as well as the ParentId property) and can be used to reconstruct the causal tree.