-
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
Unable to kafka receiver username config value to "$ConnectionString" with confmap.unifyEnvVarExpansion feature gate enabled #10713
Comments
You're right. This is happening because we're in a transition stage. Once the feature gate is removed you'll be able to do I need to investigate why expandconverter isn't handling escaping the $ like it should. |
Oh I see why this is happening. When we fixed #10560, the result is that when the feature gate is enabled, Again, this problem won't exist once the feature gate is made stable. For now I believe you have 2 options:
|
I believe $$someword is the most common use case. So #10560 doesn't seem like fixed the issue for the most users. @TylerHelmuth can we do it in the expand converter instead? |
@dmitryax i can experiment moving the $$ escaping to after the converters are run for now. |
Actually that would just bring the other big back. We need to think about this some more. This bug at least has a workaround while the other one didn't. |
What's the other bug? |
You couldn't do $${1} |
Why can't we do escaping for both cases? |
I don't get why this part is needed https://github.com/open-telemetry/opentelemetry-collector/blob/main/confmap/resolver.go#L177-L181. The expandconverter is doing exactly the same. So we currently do the unescaping/expansion twice. |
If I'm not missing anything, this PR should resolve the issues. As the next step, we probably need to move $$->$ from expand converter to the resolver. @TylerHelmuth PTAL |
Thank you for the quick fix! |
Describe the bug
We have some config to connect to azure event hubs using the kafka receiver this requires us to set the user name to "$ConnectionString" per azure documentation:
https://learn.microsoft.com/en-us/azure/event-hubs/azure-event-hubs-kafka-overview#shared-access-signature-sas
Prior to this feature gate enabled we were able to do this by configuring the receiver as follows:
With version 105 of the collector we get this error:
Steps to reproduce
Configure kafka receiver as shown above (no need to even add it to a pipeline)
What did you expect to see?
The config is loaded successfully
What did you see instead?
The collector crashes on boot
What version did you use?
v0.105.0
What config did you use?
Environment
Ubuntu 20.04 - go 1.21
Additional context
Does this regex need to be updated to allow for "$$" prefixed strings to be excluded? Or is there some other fix missing?
opentelemetry-collector/confmap/converter/expandconverter/expand.go
Line 94 in c239e73
Note that this PR proposes to fix this problem but I should have that fix since I'm using version 105:
#10560
The text was updated successfully, but these errors were encountered: