Closed barrettj12 closed 10 months ago
Commit ca0afa152e34537a9af1cf4be3067997033f56bb seems to have introduced a regression. Now, managerSuite.TestTimelyShutdown
is failing, because the LogManager.Stop()
call is timing out:
FAIL: manager_test.go:129: managerSuite.TestTimelyShutdown
manager_test.go:180:
c.Fatal("LogManager.Stop() took too long")
... Error: LogManager.Stop() took too long
EDIT: it seems to work fine with one gatherer, but as soon as you add a second, it fails. Something must be getting deadlocked somewhere.
This PR builds on the previous log forwarding PRs (#209, #252, #256, #267) by allowing the user to specify labels for logs forwarded from Pebble.
Labels will be defined in a new field
labels
inside the log target:Labels will support environment variable substitutions ($ENV_VAR), and these will be interpreted "dynamically" in the context of the relevant service.
Notes on the design
Labels can contain
$ENVIRONMENT_VARIABLES
, which will be substituted in the environment of the relevant service. However, the "service environment" could mean:environment
map as defined in the planWe decided to use (1) instead, as it is more explicit, can be "statically" evaluated just from the plan, and doesn't require extra data to be passed through from the service manager and cached.
Furthermore, anytime we change the labels, we first flush any logs currently in the buffer, so that these logs are sent with the correct (old) labels.
QA steps
Links
Jira card: JUJU-4643