mirror of
https://github.com/hashicorp/vault.git
synced 2025-12-17 07:21:18 +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,
|
Writer: logGate,
|
||||||
}, "", log.LstdFlags)
|
}, "", 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
|
// Initialize the backend
|
||||||
backend, err := physical.NewBackend(
|
backend, err := physical.NewBackend(
|
||||||
config.Backend.Type, config.Backend.Config)
|
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
|
// Initialize the listeners
|
||||||
lns := make([]net.Listener, 0, len(config.Listeners))
|
lns := make([]net.Listener, 0, len(config.Listeners))
|
||||||
for i, lnConfig := range config.Listeners {
|
for i, lnConfig := range config.Listeners {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user