-
Notifications
You must be signed in to change notification settings - Fork 1
fix: always re-add config values provided with --config after internal config values #164
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
Conversation
9f43d8b
to
86f7d5d
Compare
@@ -115,7 +115,7 @@ locals { | |||
|
|||
WINDOWS_SERVER_2022_BASE = { | |||
ami_instance_type = "t3.small" | |||
ami_id = "ami-00bedb8509ebcc120" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are these guys changing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// see: https://github.com/open-telemetry/opentelemetry-collector/blob/v0.118.0/otelcol/flags.go#L28-L30 | ||
// Trim the surrounding brackets, then split on ", " | ||
var originalConfigs []string | ||
if len(originalConfigStr) > 2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this part is sort of confusing/seems unfortunate to me. are the first 2 arguments special in some way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is referring to the string; two characters only means []
which means no args. This skips the string split when we don't need to do it basically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh and one more weird thing: calling Split on empty string does not return empty array but instead returns array of empty string.
https://go.dev/play/p/wZ3He29DP37
So this saves from filtering out empty string when looping over the configs below.
Description
After switching to the otelcol's internal
--config
flag, the bundled config files provided by theobserve-agent
now are processed after any configuration provided with--config
. This makes it so the bundled config values cannot be overwritten via the--config
flag (only via theotel_config_overrides
option). This fix makes the flag take precedence again.Ex:
Current 2.0.0:
^ note the
"Endpoint":"localhost:13133"
After this fix:
^ note the
"Endpoint":"0.0.0.0:13137"
Checklist