Skip to content
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

Remove opamp remote config dir readable validation #1385

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

portertech
Copy link
Contributor

@portertech portertech commented Dec 12, 2023

The opamp extension configuration was added to sumologic.yaml as part of #1343. The extension is not enabled by default. This initial configuration is intended to aid in the reliability and formatting of setting up remote management via the installation script (install.sh). Unfortunately, the extension validation currently ensures the remote_configuration_directory is readable, causing regular installations to fail, for example:

Dec 12 14:06:40 ip-172-31-27-232 otelcol-sumo[1449]: Error: invalid configuration: extensions::opamp: opamp remote_configuration_directory /etc/otelcol-sumo/opamp.d must be readable: stat /etc/otelcol-sumo/opamp.d: no such file or directory
Dec 12 14:06:40 ip-172-31-27-232 otelcol-sumo[1449]: 2023/12/12 14:06:40 collector server run finished with error: invalid configuration: extensions::opamp: opamp remote_configuration_directory /etc/otelcol-sumo/opamp.d must be readable: stat /etc…such file or directory

This pull-request removes this validation, as the extension does this as part of effective configuration loading, see:

func (o *opampAgent) loadEffectiveConfig(dir string) error {
if _, err := os.Stat(dir); err != nil {
return err
}

We will need to do a release after merging this pull-request (if accepted) in order to fix standard collector installation.

Alternatively, we can remove opamp extension configuration from sumologic.yaml, however, we still need a release and we lose the extra reliability and formatting of setting up remote management via the installation script.

@portertech portertech requested a review from a team as a code owner December 12, 2023 22:31
Signed-off-by: Sean Porter <[email protected]>
Copy link
Collaborator

@echlebek echlebek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@andrzej-stencel
Copy link
Contributor

andrzej-stencel commented Dec 13, 2023

Right, I was able to reproduce this issue by running otelcol-sumo v0.89.0-sumo-2 with the following configuration:

exporters:
  logging:
extensions:
  opamp:
    remote_configuration_directory: ./non-existent-dir
receivers:
  hostmetrics:
    scrapers:
      memory:
service:
  pipelines:
    metrics:
      exporters:
        - logging
      receivers:
        - hostmetrics
$ otelcol-sumo-0.89.0-sumo-2-linux_amd64 --config config.yaml
Error: invalid configuration: extensions::opamp: opamp remote_configuration_directory ./non-existent-dir must be readable: stat ./non-existent-dir: no such file or directory
2023/12/13 11:29:48 collector server run finished with error: invalid configuration: extensions::opamp: opamp remote_configuration_directory ./non-existent-dir must be readable: stat ./non-existent-dir: no such file or directory

@portertech portertech merged commit 8d723b4 into main Dec 13, 2023
29 checks passed
@portertech portertech deleted the hotfix/opamp-ext-validation branch December 13, 2023 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants