-
Notifications
You must be signed in to change notification settings - Fork 1
feat: rename config flag to observe-config, use default otel command for our start command #146
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
0432d62
to
c937854
Compare
inService, err := svc.IsWindowsService() | ||
if err != nil { | ||
// If we're not running as a service, we run normally. | ||
if inService, err := svc.IsWindowsService(); err != nil { |
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.
I reorganized this method so it now looks more like the default OCB method. The diff for this condition is just code motion.
if err != nil { | ||
return err | ||
} | ||
colSettings := observecol.GenerateCollectorSettingsWithConfigFiles(configFilePaths) |
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.
NB: Generating the settings this way instead of using the otel command means it won't work with --config
. That's fine though, since we have a hard assert that the windows service is only ever run with two args and we have never supported --config
this way.
if err != nil { | ||
return err | ||
} | ||
if cleanup != nil { | ||
defer cleanup() | ||
configFlag := otleCmd.Flags().Lookup("config") |
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.
The flags for the otel collector are hidden behind private implementations of interfaces, args passed by value, and function scope locals. It's really not possible to access and set them directly if you aren't passing args to the cmd flags. Because of this, I think using the otelcol command itself for our start
subcommand is the best way to go.
@@ -14,15 +14,7 @@ import ( | |||
"go.opentelemetry.io/collector/otelcol" | |||
) | |||
|
|||
func makeMapProvidersMap(providers ...confmap.Provider) map[string]confmap.Provider { |
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 was unused.
if err != nil { | ||
return false, nil, err | ||
} | ||
colSettings := observecol.GenerateCollectorSettingsWithConfigFiles(configFilePaths) |
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.
Diagnose won't run against otel config overrides, but we never supported this:
$ observe-agent diagnose --otel-config ./tmp.config
Error: unknown flag: --otel-config
Usage:
observe-agent diagnose [flags]
Flags:
-h, --help help for diagnose
Global Flags:
--config string config file path
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.
can you make a ticket to support the new --observe-config
flag in diagnose
?
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.
c937854
to
52df743
Compare
7882d2a
to
b0fbd03
Compare
52df743
to
9d1d33e
Compare
…for our start command
9d1d33e
to
6cdec3a
Compare
…for our start command (#146) ### Description OB-38651 Rename `--config` flag to `--observe-config` and use the default OTel collector command for our start command. This adds all `otelcol` flags to our `start` command and gives us full functionality for the new `--config` flag (which specifies OTel configs). ### Checklist - [ ] Created tests which fail without the change (if possible) - [ ] Extended the README / documentation, if necessary
…for our start command (#146) ### Description OB-38651 Rename `--config` flag to `--observe-config` and use the default OTel collector command for our start command. This adds all `otelcol` flags to our `start` command and gives us full functionality for the new `--config` flag (which specifies OTel configs). ### Checklist - [ ] Created tests which fail without the change (if possible) - [ ] Extended the README / documentation, if necessary
…for our start command (#146) ### Description OB-38651 Rename `--config` flag to `--observe-config` and use the default OTel collector command for our start command. This adds all `otelcol` flags to our `start` command and gives us full functionality for the new `--config` flag (which specifies OTel configs). ### Checklist - [ ] Created tests which fail without the change (if possible) - [ ] Extended the README / documentation, if necessary
…for our start command (#146) ### Description OB-38651 Rename `--config` flag to `--observe-config` and use the default OTel collector command for our start command. This adds all `otelcol` flags to our `start` command and gives us full functionality for the new `--config` flag (which specifies OTel configs). ### Checklist - [ ] Created tests which fail without the change (if possible) - [ ] Extended the README / documentation, if necessary
… for our start command (#146) OB-38651 Rename `--config` flag to `--observe-config` and use the default OTel collector command for our start command. This adds all `otelcol` flags to our `start` command and gives us full functionality for the new `--config` flag (which specifies OTel configs). - [ ] Created tests which fail without the change (if possible) - [ ] Extended the README / documentation, if necessary
Description
OB-38651 Rename
--config
flag to--observe-config
and use the default OTel collector command for our start command. This adds allotelcol
flags to ourstart
command and gives us full functionality for the new--config
flag (which specifies OTel configs).Checklist