Skip to content

Commit

Permalink
client: stats need latest allocdir (#14204)
Browse files Browse the repository at this point in the history
In #14139 this code was changed to use the original copy of the config,
but Config.AllocDir is updated in the `Client.init()` method for dev
agents.

This uses the latest version of the alloc dir (which cannot change
further at runtime without a client restart which would reinitialize
the stats collector as well).
  • Loading branch information
schmichael authored Aug 22, 2022
1 parent 3940864 commit 90c143f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ func NewClient(cfg *config.Config, consulCatalog consul.CatalogAPI, consulProxie
go c.heartbeatStop.watch()

// Add the stats collector
statsCollector := stats.NewHostStatsCollector(c.logger, cfg.AllocDir, c.devicemanager.AllStats)
statsCollector := stats.NewHostStatsCollector(c.logger, c.GetConfig().AllocDir, c.devicemanager.AllStats)
c.hostStatsCollector = statsCollector

// Add the garbage collector
Expand Down

0 comments on commit 90c143f

Please sign in to comment.