Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unformatted trace logging for step telemetry in ExecutionContext #3581

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Unformatted trace logging for step telemetry in ExecutionContext
Don't apply JSON formatting during the trace logging for step telemetry.
By default `StringUtil.ConvertToJson` uses `Formatting.Indented` which
causes multi-line logs for this particular json object.

The data contained in this particular log line is useful for operators
of self-hosted runners who are looking to use log aggregates to
understand their overall usage and performance. Parsing multi-line data
in log aggregates is very hard to get right, if not outright impossible
depending on how logs are aggregated.
  • Loading branch information
carlosdagos committed Nov 19, 2024
commit 2389f03d2d44a9e164f37a65c7777d66e3fd010c
2 changes: 1 addition & 1 deletion src/Runner.Worker/ExecutionContext.cs
Original file line number Diff line number Diff line change
@@ -1145,7 +1145,7 @@ public void PublishStepTelemetry()
}
}

Trace.Info($"Publish step telemetry for current step {StringUtil.ConvertToJson(StepTelemetry)}.");
Trace.Info($"Publish step telemetry for current step {StringUtil.ConvertToJson(StepTelemetry, Formatting.None)}.");
Global.StepsTelemetry.Add(StepTelemetry);
_stepTelemetryPublished = true;
}