Closed nicoche closed 3 years ago
https://github.com/grafana/agent/pull/976
I don't have a working setup to test the changes. Does the test suite cover this part of the code?
976
I don't have a working setup to test the changes. Does the test suite cover this part of the code?
Hello! Thanks for the contribution, nice catch.
Unfortunately, the test suite does not specifically cover this case. config_test.go does indeed test using a file for the password, but it's added to the file without a trailing new line. To test the change, it would be sufficient to add a new line in that line.
Hi!
I run a setup with metrics and logs activated, reporting a server protected by basic auth. I wanted to add traces but I could not get basic_auth to work, kept hitting HTTP 401. I realized that it is because I used the option
password_file
and that my file contained the password and a final\n
. It seems that prometheus and loki strip extra line feeds at the end of password files but traces module does not. I've attached a reproduction case below, if you are curious.Now, I think that it's strange that the final line feed is silently stripped for logs and metrics, but I believe that it's more important that all 3 modules work the same. wdyt?
Repro:
docker-compose:
config.yaml:
Launch with:
Then, in another terminal, try:
Loki will work, tempo won't: