Skip to content

Consolidate GC logs on boot into ContainerLoadStats event#26748

Open
markfields wants to merge 4 commits intomicrosoft:mainfrom
markfields:gc/boot-log
Open

Consolidate GC logs on boot into ContainerLoadStats event#26748
markfields wants to merge 4 commits intomicrosoft:mainfrom
markfields:gc/boot-log

Conversation

@markfields
Copy link
Member

Description

We're trying to reduce logging overhead/noise from high event volume for consumers. These two events occur on boot and the info can be consolidated into the canonical boot event "ContainerLoadStats":

  • "GCFeatureMatrix"
  • "GarbageCollectorLoaded"

(and get rid of redundant logging props - it's all covered by gcConfig and options)

private readonly configs: IGarbageCollectorConfigs;

public readonly serializedConfigs: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be simpler to expose the configs and have it serialized at logging time in Container Runtime? That way we don't have to track the same config twice here.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's to prevent tampering with the configs. I didn't like exposing the config object directly

Copy link
Member Author

@markfields markfields Mar 16, 2026

Choose a reason for hiding this comment

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

I guess downside of this is there's a bit of persistent memory bloat. Maybe not worth it, I guess I don't see someone having a reason to modify it or accidentally doing it. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Make it a getter and readonly?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah all the props are already readonly - it's pedantic but there's some nested objects in there which could be mucked with.

How about I switch serializedConfig to a getter that does the JSON.stringify, rather than storing the string. Since we know it's only called once.

Copilot AI review requested due to automatic review settings March 16, 2026 23:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR reduces boot-time telemetry event volume by removing GC-specific boot events and folding their data into the existing ContainerLoadStats event.

Changes:

  • Added IGarbageCollector.serializedConfigs for emitting GC config telemetry without re-serializing at each call site.
  • Removed the GarbageCollectorLoaded and GCFeatureMatrix telemetry events.
  • Added gcConfigs to the ContainerLoadStats telemetry payload.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/runtime/container-runtime/src/gc/gcDefinitions.ts Extends IGarbageCollector with a serialized GC-configs telemetry accessor.
packages/runtime/container-runtime/src/gc/garbageCollection.ts Implements serializedConfigs and removes the GarbageCollectorLoaded boot event.
packages/runtime/container-runtime/src/containerRuntime.ts Removes GCFeatureMatrix event and adds gcConfigs to ContainerLoadStats.

You can also share your feedback on Copilot code review. Take the survey.

@markfields markfields enabled auto-merge (squash) March 17, 2026 01:00
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.

3 participants