Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/DurableTask.AzureStorage/AnalyticsEventSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public void PoisonMessageDetected(
ExtensionVersion);
}

[Event(EventIds.FetchedInstanceHistory, Level = EventLevel.Informational, Version = 4)]
[Event(EventIds.FetchedInstanceHistory, Level = EventLevel.Informational, Version = 5)]
public void FetchedInstanceHistory(
string Account,
string TaskHub,
Expand All @@ -318,6 +318,7 @@ public void FetchedInstanceHistory(
long LatencyMs,
string ETag,
DateTime LastCheckpointTime,
string LatestEvents,
string AppName,
string ExtensionVersion)
Comment thread
sophiatev marked this conversation as resolved.
Comment thread
sophiatev marked this conversation as resolved.
{
Expand All @@ -333,6 +334,7 @@ public void FetchedInstanceHistory(
LatencyMs,
ETag ?? string.Empty,
LastCheckpointTime,
LatestEvents,
Comment thread
sophiatev marked this conversation as resolved.
AppName,
ExtensionVersion);
}
Expand Down
8 changes: 7 additions & 1 deletion src/DurableTask.AzureStorage/Logging/LogEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,8 @@ public FetchedInstanceHistory(
int requestCount,
long latencyMs,
string eTag,
DateTime lastCheckpointTime)
DateTime lastCheckpointTime,
string latestEvents)
{
this.Account = account;
this.TaskHub = taskHub;
Expand All @@ -757,6 +758,7 @@ public FetchedInstanceHistory(
this.LatencyMs = latencyMs;
this.ETag = eTag;
this.LastCheckpointTime = lastCheckpointTime;
this.LatestEvents = latestEvents;
Comment thread
sophiatev marked this conversation as resolved.
}

[StructuredLogField]
Expand Down Expand Up @@ -789,6 +791,9 @@ public FetchedInstanceHistory(
[StructuredLogField]
public DateTime LastCheckpointTime { get; }

[StructuredLogField]
public string LatestEvents { get; }

public override EventId EventId => new EventId(
EventIds.FetchedInstanceHistory,
nameof(EventIds.FetchedInstanceHistory));
Expand All @@ -811,6 +816,7 @@ void IEventSourceEvent.WriteEventSource() => AnalyticsEventSource.Log.FetchedIns
this.LatencyMs,
this.ETag,
this.LastCheckpointTime,
this.LatestEvents,
Utils.AppName,
Utils.ExtensionVersion);
}
Expand Down
6 changes: 4 additions & 2 deletions src/DurableTask.AzureStorage/Logging/LogHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ internal void FetchedInstanceHistory(
int requestCount,
long latencyMs,
string eTag,
DateTime lastCheckpointTime)
DateTime lastCheckpointTime,
string latestEvents)
{
var logEvent = new LogEvents.FetchedInstanceHistory(
account,
Expand All @@ -273,7 +274,8 @@ internal void FetchedInstanceHistory(
requestCount,
latencyMs,
eTag,
lastCheckpointTime);
lastCheckpointTime,
latestEvents);
this.WriteStructuredLog(logEvent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
namespace DurableTask.AzureStorage.Tracking
{
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
Expand Down Expand Up @@ -226,7 +225,8 @@ public override async Task<OrchestrationHistory> GetHistoryEventsAsync(string in
results.RequestCount,
results.ElapsedMilliseconds,
eTagValue?.ToString(),
checkpointCompletionTime);
checkpointCompletionTime,
string.Join(",", historyEvents.Skip(Math.Max(0, historyEvents.Count - 10)).Select(e => e.EventType.ToString())));

return new OrchestrationHistory(historyEvents, checkpointCompletionTime, eTagValue, trackingStoreContext);
}
Expand Down Expand Up @@ -264,7 +264,8 @@ async Task<IReadOnlyList<TableEntity>> QueryHistoryAsync(string filter, string i
results.RequestCount,
results.ElapsedMilliseconds,
eTag: string.Empty,
DateTime.MinValue);
DateTime.MinValue,
string.Join(",", entities.Skip(Math.Max(0, entities.Count - 10)).Select(e => e.GetString(nameof(HistoryEvent.EventType)))));

return entities;
}
Expand Down
Loading