-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(docker_logs source): fix docker logs host key #6552
fix(docker_logs source): fix docker logs host key #6552
Conversation
Signed-off-by: drunkirishcoder <[email protected]>
6a87957
to
a9bc115
Compare
@drunkirishcoder aha, thanks for the explanation! It seems like we do this in a few other places as well:
Should we update them as well? I can see this would be an easy mistake to make too. Maybe we could guard against it somehow? |
@jszwedko yep you are right, they all have the same problem of not getting the overridden |
There is a more general solution for this of deserializing the config once on startup to set all the globals, and then deserializing it again like usual. That way we could avoid this problem completely and not relay on us knowing/remembering that this problem exists. Implementation shouldn't be too complex, we just need to deserialize from the same bytes to avoid a bunch of corner cases. |
Ok I will hold off on making change to humio and splunk sinks then and wait for a more generalized solution to fix them. I'mnot familiar enough with the config loading process. don't want to try and mess everything up somehow. note, those sinks still all have a problem with not reading from the overridden value.
instead should be reading from
|
Ok, I'll make the change, and also look into if we can avoid |
👍 thanks both. I like the idea of deserializing just the globals first. That should avoid inadvertently hitting this sort of issue. |
Closing in favor of #6581 |
fixes #6394 for real this time.
The problem with the last attempted fix #6395 was when
serde
deserializes the configuration fordocker_logs
, the lazy staticLOGSCHEMA
hasn't been constructed yet because that also relies on reading from the same configuration file to get the proper values. Basically it's an order of operations problem.This time, we delay retrieving
log_schema().host_key()
till much later, when the lazy static had the chance to be initialized. Tested with a local build and this works. (I'm 99.99% sure I think 😄 )