-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Use Docker Secrets for Configuration Values #10759
Comments
@JaronrH what version of the collector are you using? |
/cc @mx-psi |
I'm using otelcol-contrib 0.105.0 |
@JaronrH could you try with 0.106.0? |
I upgraded to 0.106.0 and tried it again. Here are my findings:
|
@JaronrH Thanks!!
So to be clear about this, the following config works for you in v0.106.0 but does not work in v0.105.0?
With this you mean the
🤔 I think this part is likely not an issue of the Collector itself but some misconfiguration in the |
It "works" in that I did not get an error starting up. It does not seem to load the value from Docker Secrets as I'm getting the 401 error.
That is correct!
It very well could be! In the example from your documentation, which is loading a file for Exports, you're loading a yaml file that is used for the exports. In this case, the Docker Secrets file contains JUST the username (Ex: User) or JUST the password (Ex: Password123) and not a [partial] yaml file. This is why I was wondering if there was a better way for me to be handling this in Docker OR if Docker Secrets support could be added? For Example:
dockersecret: handler looks for a file in /run/secrets/ named RABBITMQ_USER and loads the files contents as the value to be inserted. |
I am able to reproduce with a password like The approach we are following since #10618 is to delay unmarshaling until we know the target field type. The problem here is that, even if we don't use the YAML output, we require the input to be parseable as YAML. We can fix that by also delaying the parsing, I can file a PR for that. |
I am going to mark this as a release blocker. This has happened for a long time with the |
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description <!-- Issue number if applicable --> If YAML parsing fails, assume the user wanted to pass the value as a string. This has the downside that the error messages are less informative: it will tell you it expected something other than a string instead of the YAML parser error. A future improvement could be to pass these errors down as extra metadata up until the unmarshaling stage. #### Link to tracking issue Fixes #10759 <!--Describe what testing was performed and which tests were added.--> #### Testing <!--Describe the documentation added.--> Added test case for this.
Discussed in #10706
Originally posted by JaronrH July 23, 2024
I currently use Docker Swarm with Docker Secrets to store configuration information. I would like to load information from Secrets into my configuration. For example:
Docker Secrets are exposed as files in /run/secrets. The problem (as far as I can tell - I'm not a Go dev) is that the ${file:} processor is trying to load those secrets as yaml files instead of values! So, I'm getting errors like this as a result:
Is there a better way to do this? Maybe some way to tell opentelemetry-collector-contrib to load everything in /run/secrets into env variables so I can use ${env:*}?
Thanks!
The text was updated successfully, but these errors were encountered: