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

Local configuration is overwritten #32048

Open
mike9421 opened this issue Mar 31, 2024 · 2 comments
Open

Local configuration is overwritten #32048

mike9421 opened this issue Mar 31, 2024 · 2 comments
Labels

Comments

@mike9421
Copy link

mike9421 commented Mar 31, 2024

Component(s)

cmd/opampsupervisor

What happened?

Description

When I run opampsupervisor(the backend program is OpAMP's sample server), I noticed that EffectivConfig gets cleared, leaving only the contents of ownMetricsCfg and ExtraLocalConfig.

Steps to Reproduce

  1. Fill in the correct configuration to ensure that the opampsupervisor can connect to the backend normally
  2. Start the backend OpAMP sample server
  3. Fill in the effective configuration in local effective.yaml
  4. Start opampsupervisor
  5. Check the otel configuration displayed by the OpAMP UI or view the local file named effective.yaml.

Expected Result

The content I filled in to the local configuration file named effective.yaml will not be cleared after the connection is established.

Actual Result

The configuration content I filled in was cleared

Collector version

all

Environment information

Environment

OS: Darwin
Compiler: go 1.21

OpenTelemetry Collector configuration

receivers:
  prometheus:
    config:
      scrape_configs:
        - job_name: otel-collector
          scrape_interval: 10s
          static_configs:
            - targets:
              - 0.0.0.0:55149
exporters:
  otlphttp:
    endpoint: http://localhost:4318/v1/metrics
service:
  pipelines:
    metrics:
      exporters:
        - otlphttp
      receivers:
        - prometheus

Log output

No response

Additional context

I know the reason is that the backend server returns an empty remote configuration. However, I believe that the opampsupervisor needs to handle such situations to avoid the issue where configurations get overwritten due to logic errors in the backend.

@mike9421 mike9421 added bug Something isn't working needs triage New item requiring triage labels Mar 31, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@evan-bradley
Copy link
Contributor

The reason for this behavior is that the effective.yaml file is only intended to be written by the Supervisor. Can you explain more about your use case? The Supervisor specification allows for the possibility of using local Collector config along with remote config, would this work for you?

@evan-bradley evan-bradley added enhancement New feature or request priority:p2 Medium and removed bug Something isn't working needs triage New item requiring triage labels Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants