-
Notifications
You must be signed in to change notification settings - Fork 1
feat: support otelcol flags (config, set, feature-gates) in all sub commands #216
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
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.
Orca Security Scan Summary
Status | Check | Issues by priority | |
---|---|---|---|
![]() |
Infrastructure as Code | ![]() ![]() ![]() ![]() |
View in Orca |
![]() |
SAST | ![]() ![]() ![]() ![]() |
View in Orca |
![]() |
Secrets | ![]() ![]() ![]() ![]() |
View in Orca |
![]() |
Vulnerabilities | ![]() ![]() ![]() ![]() |
View in Orca |
725da6e
to
42bd381
Compare
) | ||
|
||
// TODO enable this test once the agent bundled configs don't depend on the host filesystem having the templates. | ||
func XTest_RenderOtelConfig(t *testing.T) { |
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.
maybe we should have some sort of unit test mode that looks for the templates somewhere relative to current path vs. somewhere specific on the FS. im fine with just looking at linux and not adding yet another copy of everything
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.
Updated! It was a pretty small change to the connections package. I had it use mac since that's how I do my dev work, but this is super easy to configure. I added a TODO to replace our snapshot tests with this new method; it will speed up the loop considerably.
var otelSets []string | ||
|
||
func AddConfigFlags(flags *pflag.FlagSet) { | ||
flags.StringSliceVar(&otelConfigs, configFlag, []string{}, configFlagDescription) |
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.
what does this actually do? does it just register these flags?
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.
Yes, it registers the flags and provides storage for their values somewhere accessible to this package. I couldn't add them in root without introducing a circular dependency, and I think it's also a pro to have them scoped only to here so they don't get referenced elsewhere.
42bd381
to
0ecb86e
Compare
…ime error happens in the otel collector
Description
OB-40550: Support otelcol flags (
config
,set
, andfeature-gates
) in all sub commands. Substitutes of the listed otel flags are now configured at the root command level on the observe-agent and are applied to all subcommands.