Skip to content

Commit 0a2570e

Browse files
committed
fix(template-build): use fcInfo to auto-detect FreePageReporting in orchestrator
HasFreePageReporting() was added to fcversion.Info but had zero callers in the production path. Mirror the HasHugePages() pattern: let the orchestrator derive the value from the FC version (authoritative), gated by the FreePageReportingFlag LaunchDarkly flag (default false). Also emit an env.free_page_reporting span attribute alongside the existing env.huge_pages one.
1 parent d472bdf commit 0a2570e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/orchestrator/pkg/template/server/create_template.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ func (s *ServerStore) TemplateCreate(ctx context.Context, templateRequest *templ
6565
return nil, fmt.Errorf("invalid resolved firecracker version %q: %w", firecrackerVersion, err)
6666
}
6767
hugePages := fcInfo.HasHugePages()
68+
freePageReporting := fcInfo.HasFreePageReporting() && s.featureFlags.BoolFlag(ctx, featureflags.FreePageReportingFlag)
6869

6970
childSpan.SetAttributes(
7071
telemetry.WithTemplateID(cfg.GetTemplateID()),
@@ -75,6 +76,7 @@ func (s *ServerStore) TemplateCreate(ctx context.Context, templateRequest *templ
7576
attribute.Int64("env.memory_mb", int64(cfg.GetMemoryMB())),
7677
attribute.Int64("env.vcpu_count", int64(cfg.GetVCpuCount())),
7778
attribute.Bool("env.huge_pages", hugePages),
79+
attribute.Bool("env.free_page_reporting", freePageReporting),
7880
)
7981

8082
template := config.TemplateConfig{
@@ -88,7 +90,7 @@ func (s *ServerStore) TemplateCreate(ctx context.Context, templateRequest *templ
8890
ReadyCmd: cfg.GetReadyCommand(),
8991
DiskSizeMB: int64(cfg.GetDiskSizeMB()),
9092
HugePages: hugePages,
91-
FreePageReporting: cfg.GetFreePageReporting(),
93+
FreePageReporting: freePageReporting,
9294
FromImage: cfg.GetFromImage(),
9395
FromTemplate: cfg.GetFromTemplate(),
9496
RegistryAuthProvider: authProvider,

0 commit comments

Comments
 (0)