Skip to content
Open
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
2 changes: 2 additions & 0 deletions src/SeqCli/Output/OutputFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public void WriteEntity(Entity entity)

var writer = new LoggerConfiguration()
.Destructure.With<JsonNetDestructuringPolicy>()
.Destructure.ToMaximumDepth(10000)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nobody will ever need an object nested to 10,000 levels

.Enrich.With<StripStructureTypeEnricher>()
.WriteTo.Console(TextFormatters.Plain(TemplateTheme, "{@m}" + Environment.NewLine))
.CreateLogger();
Expand Down Expand Up @@ -200,6 +201,7 @@ public void WriteObject(object value)

var writer = new LoggerConfiguration()
.Destructure.With<JsonNetDestructuringPolicy>()
.Destructure.ToMaximumDepth(10000)
.Enrich.With<StripStructureTypeEnricher>()
.WriteTo.Console(TextFormatters.Plain(TemplateTheme, "{@m}" + Environment.NewLine))
.CreateLogger();
Expand Down
4 changes: 4 additions & 0 deletions test/SeqCli.EndToEnd/Data/trace-tree.clef
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
{"@t":"2023-12-20T00:50:00.2Z","@l":"Warning","@tr":"7d4dedcc73b18e449e0e4ea08cbe346d","@sp":"2222222222222222","@mt":"{RowCount} rows retrieved","RowCount":42,"@x":"System.TimeoutException: The query timeout was reached"}
{"@t":"2023-12-20T00:50:00.9Z","@st":"2023-12-20T00:50:00.5Z","@tr":"7d4dedcc73b18e449e0e4ea08cbe346d","@sp":"4444444444444444","@ps":"1111111111111111","@m":"Render response"}
{"@t":"2023-12-20T00:50:00.95Z","@tr":"7d4dedcc73b18e449e0e4ea08cbe346d","@sp":"9999999999999999","@m":"Orphan log"}
{"@t":"2023-12-20T00:50:00.85Z","@st":"2023-12-20T00:50:00.55Z","@tr":"7d4dedcc73b18e449e0e4ea08cbe346d","@sp":"5555555555555555","@ps":"4444444444444444","@m":"Serialize model"}
{"@t":"2023-12-20T00:50:00.8Z","@st":"2023-12-20T00:50:00.6Z","@tr":"7d4dedcc73b18e449e0e4ea08cbe346d","@sp":"6666666666666666","@ps":"5555555555555555","@m":"Serialize order"}
{"@t":"2023-12-20T00:50:00.75Z","@st":"2023-12-20T00:50:00.65Z","@tr":"7d4dedcc73b18e449e0e4ea08cbe346d","@sp":"7777777777777777","@ps":"6666666666666666","@m":"Format currency"}
{"@t":"2023-12-20T00:50:00.72Z","@st":"2023-12-20T00:50:00.7Z","@tr":"7d4dedcc73b18e449e0e4ea08cbe346d","@sp":"8888888888888888","@ps":"7777777777777777","@m":"Lookup locale"}
2 changes: 1 addition & 1 deletion test/SeqCli.EndToEnd/Mcp/McpTraceTestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected override async Task ExecuteAsync(SeqConnection connection, ILogger log
});

var text = AssertTextResult(loaded);
Assert.Contains("Loaded 4 span(s)", text);
Assert.Contains("Loaded 8 span(s)", text);

var document = AssertStructuredObjectResult(loaded);
Assert.Equal(TraceId, document.GetProperty("traceId").GetString());
Expand Down
10 changes: 10 additions & 0 deletions test/SeqCli.EndToEnd/Traces/TraceShowTestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ public Task ExecuteAsync(
["SELECT * FROM orders", "42 rows retrieved"],
((JArray)query["children"]!).Select(c => (string)c["message"]!).ToArray());

var node = root;
foreach (var message in new[] {"Render response", "Serialize model", "Serialize order", "Format currency", "Lookup locale"})
{
var children = Assert.IsType<JArray>(node["children"]);
node = Assert.IsType<JObject>(Assert.Single(children, c => (string?)c["message"] == message));
}

Assert.Equal("8888888888888888", (string?)node["spanId"]);
Assert.Null(node["children"]);

var orphan = (JObject)Assert.Single((JArray)document["orphans"]!);
Assert.Equal("log", (string?)orphan["type"]);
Assert.Equal("Orphan log", (string?)orphan["message"]);
Expand Down