mirror of
https://github.com/hashicorp/vault.git
synced 2025-12-16 15:01:13 +01:00
Move telemetry metrics up to fix one possible race, but deeper problems in go-metrics can't be solved with this
This commit is contained in:
parent
a3e000ff7d
commit
88f05bec4d
@ -104,6 +104,14 @@ func (c *ServerCommand) Run(args []string) int {
|
||||
Writer: logGate,
|
||||
}, "", log.LstdFlags)
|
||||
|
||||
// Initialize telemetry; if this is done after the core is created,
|
||||
// because we are using a global telemetry object, it can be a data
|
||||
// race between writing metrics from core and the object being set
|
||||
if err := c.setupTelementry(config); err != nil {
|
||||
c.Ui.Error(fmt.Sprintf("Error initializing telemetry: %s", err))
|
||||
return 1
|
||||
}
|
||||
|
||||
// Initialize the backend
|
||||
backend, err := physical.NewBackend(
|
||||
config.Backend.Type, config.Backend.Config)
|
||||
@ -233,12 +241,6 @@ func (c *ServerCommand) Run(args []string) int {
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize the telemetry
|
||||
if err := c.setupTelementry(config); err != nil {
|
||||
c.Ui.Error(fmt.Sprintf("Error initializing telemetry: %s", err))
|
||||
return 1
|
||||
}
|
||||
|
||||
// Initialize the listeners
|
||||
lns := make([]net.Listener, 0, len(config.Listeners))
|
||||
for i, lnConfig := range config.Listeners {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user