Skip to content

Improve Seq.Syntax templating compatibility with trace spans#30

Merged
nblumhardt merged 4 commits intodatalust:devfrom
nblumhardt:tracing-functions
Sep 30, 2025
Merged

Improve Seq.Syntax templating compatibility with trace spans#30
nblumhardt merged 4 commits intodatalust:devfrom
nblumhardt:tracing-functions

Conversation

@nblumhardt
Copy link
Copy Markdown
Member

See: datalust/seq-tickets#2486

  • Introduces IsSpan(), IsRootSpan(), FromUnixEpoch(), and TotalMilliseconds()
  • Adds @SpanKind/@sk support
  • Changes @Start/@st to internally use DateTimeOffset representation, so that operations on it are identical to the matching @Timestamp/@t property

We hadn't done anything to nail down ToString() representations for datetime types, so I've switched them to ISO-8601 since the default .NET formatting is nondeterministic. Format string placeholders can be used to override this.

Booleans now render as true and false rather than True and False.

I don't think these changes warrant a major version bump, so I've gone with a minor.

…nds(), while bringing tracing properties into line with default LogEvent properties. Updates default formatting for bool and DateTime/DateTimeOffset values

public static LogEventPropertyValue? IsRootSpan(LogEvent logEvent)
{
return new ScalarValue(logEvent is { TraceId: not null, SpanId: not null } &&
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

IsSpan(logEvent) && ...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Annoyingly, IsSpan() is not a Boolean method, and the return value requires allocation, so probably best like this for now.

@nblumhardt nblumhardt merged commit 1560831 into datalust:dev Sep 30, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants