This commit is contained in:
Sebastian Burckhardt 2021-01-04 15:32:15 -08:00
Родитель bc7ac309cc
Коммит 4d403032b7
4 изменённых файлов: 19 добавлений и 18 удалений

Просмотреть файл

@ -521,7 +521,8 @@ namespace DurableTask.Netherite
WorkItemTraceHelper.WorkItemType.Orchestration,
nextOrchestrationWorkItem.MessageBatch.WorkItemId,
nextOrchestrationWorkItem.MessageBatch.InstanceId,
nextOrchestrationWorkItem.Type.ToString());
nextOrchestrationWorkItem.Type.ToString(),
WorkItemTraceHelper.FormatMessageIdList(nextOrchestrationWorkItem.MessageBatch.TracedMessages));
}
return nextOrchestrationWorkItem;
@ -710,7 +711,8 @@ namespace DurableTask.Netherite
WorkItemTraceHelper.WorkItemType.Activity,
nextActivityWorkItem.WorkItemId,
nextActivityWorkItem.TaskMessage.OrchestrationInstance.InstanceId,
nextActivityWorkItem.ExecutionType);
nextActivityWorkItem.ExecutionType,
WorkItemTraceHelper.FormatMessageId(nextActivityWorkItem.TaskMessage, nextActivityWorkItem.OriginWorkItem));
}
return nextActivityWorkItem;

Просмотреть файл

@ -175,7 +175,7 @@ namespace DurableTask.Netherite
/// </summary>
/// <remarks>This level applies to both ETW events and ILogger events.</remarks>
[JsonConverter(typeof(StringEnumConverter))]
public LogLevel EventLogLevelLimit { get; set; } = LogLevel.Warning;
public LogLevel EventLogLevelLimit { get; set; } = LogLevel.Information;
/// <summary>
/// A lower limit on the severity level of work item trace events emitted.

Просмотреть файл

@ -141,14 +141,14 @@ namespace DurableTask.Netherite
this.WriteEvent(223, Account, TaskHub, PartitionId, WorkItemType, WorkItemId, InstanceId, ExecutionType, ConsumedMessageIds, ExtensionVersion);
}
[Event(224, Level = EventLevel.Verbose, Version = 1)]
public void WorkItemStarted(string Account, string TaskHub, int PartitionId, string WorkItemType, string WorkItemId, string InstanceId, string ExecutionType, string ExtensionVersion)
[Event(224, Level = EventLevel.Informational, Version = 1)]
public void WorkItemStarted(string Account, string TaskHub, int PartitionId, string WorkItemType, string WorkItemId, string InstanceId, string ExecutionType, string ConsumedMessageIds, string ExtensionVersion)
{
SetCurrentThreadActivityId(serviceInstanceId);
this.WriteEvent(224, Account, TaskHub, PartitionId, WorkItemType, WorkItemId, InstanceId, ExecutionType, ExtensionVersion);
this.WriteEvent(224, Account, TaskHub, PartitionId, WorkItemType, WorkItemId, InstanceId, ExecutionType, ConsumedMessageIds, ExtensionVersion);
}
[Event(225, Level = EventLevel.Verbose, Version = 1)]
[Event(225, Level = EventLevel.Informational, Version = 1)]
public void WorkItemCompleted(string Account, string TaskHub, int PartitionId, string WorkItemType, string WorkItemId, string InstanceId, string Status, string ProducedMessageIds, string ExtensionVersion)
{
SetCurrentThreadActivityId(serviceInstanceId);

Просмотреть файл

@ -74,17 +74,17 @@ namespace DurableTask.Netherite
}
}
public void TraceWorkItemStarted(uint partitionId, WorkItemType workItemType, string workItemId, string instanceId, string executionType)
public void TraceWorkItemStarted(uint partitionId, WorkItemType workItemType, string workItemId, string instanceId, string executionType, string consumedMessageIds)
{
if (this.logLevelLimit <= LogLevel.Debug)
if (this.logLevelLimit <= LogLevel.Information)
{
if (this.logger.IsEnabled(LogLevel.Debug))
if (this.logger.IsEnabled(LogLevel.Information))
{
this.logger.LogDebug("Part{partition:D2} started {workItemType}WorkItem {workItemId} instanceId={instanceId} executionType={executionType}",
partitionId, workItemType, workItemId, instanceId, executionType);
this.logger.LogDebug("Part{partition:D2} started {workItemType}WorkItem {workItemId} instanceId={instanceId} executionType={executionType} consumedMessageIds={consumedMessageIds}",
partitionId, workItemType, workItemId, instanceId, executionType, consumedMessageIds);
}
this.etw?.WorkItemStarted(this.account, this.taskHub, (int)partitionId, workItemType.ToString(), workItemId, instanceId, executionType, TraceUtils.ExtensionVersion);
this.etw?.WorkItemStarted(this.account, this.taskHub, (int)partitionId, workItemType.ToString(), workItemId, instanceId, executionType, consumedMessageIds, TraceUtils.ExtensionVersion);
}
}
@ -105,12 +105,11 @@ namespace DurableTask.Netherite
}
}
public void TraceWorkItemCompleted(uint partitionId, WorkItemType workItemType, string workItemId, string instanceId, object status, string producedMessageIds)
{
if (this.logLevelLimit <= LogLevel.Debug)
if (this.logLevelLimit <= LogLevel.Information)
{
if (this.logger.IsEnabled(LogLevel.Debug))
if (this.logger.IsEnabled(LogLevel.Information))
{
this.logger.LogDebug("Part{partition:D2} completed {workItemType}WorkItem {workItemId} instanceId={instanceId} status={status} producedMessageIds={producedMessageIds}",
partitionId, workItemType, workItemId, instanceId, status, producedMessageIds);
@ -122,7 +121,7 @@ namespace DurableTask.Netherite
public void TraceTaskMessageReceived(uint partitionId, TaskMessage message, string workItemId, string queuePosition)
{
if (this.logLevelLimit <= LogLevel.Trace)
if (this.logLevelLimit <= LogLevel.Debug)
{
(long commitLogPosition, string eventId) = EventTraceContext.Current;
string messageId = FormatMessageId(message, workItemId);
@ -140,7 +139,7 @@ namespace DurableTask.Netherite
public void TraceTaskMessageSent(uint partitionId, TaskMessage message, string workItemId, string sentEventId)
{
if (this.logLevelLimit <= LogLevel.Trace)
if (this.logLevelLimit <= LogLevel.Debug)
{
string messageId = FormatMessageId(message, workItemId);