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

[opampsupervisor] don't merge multiple received agent config files #34608

Open
Asarew opened this issue Aug 12, 2024 · 4 comments
Open

[opampsupervisor] don't merge multiple received agent config files #34608

Asarew opened this issue Aug 12, 2024 · 4 comments
Labels

Comments

@Asarew
Copy link

Asarew commented Aug 12, 2024

Component(s)

cmd/opampsupervisor

Is your feature request related to a problem? Please describe.

Right now the supervisor merges the received config files meaning that pipeline names need to be unique in across all files the config-map. if this is not done the supervisor silently "deletes" config pipelines and no errors are thrown anywhere and proper execution can (and will) be assumed by the collector and the end-user.

const nop1Config = `
receivers:
  nop:
exporters:
  nop:

service:
  pipelines:
    metrics/2:
      receivers: [nop, nop]
      exporters: [nop]
`

const nop2Config = `
receivers:
  nop:
exporters:
  nop:

service:
  pipelines:
    traces/3:
      receivers: [nop]
      exporters: [nop]
    metrics/2:
      receivers: [nop]
      exporters: [nop]
`

agentConfig := &protobufs.AgentConfigMap{
    ConfigMap: map[string]*protobufs.AgentConfigFile{
		"file1.yaml": {
			ContentType: "text/yaml",
			Body:        []byte(nop1Config),
		},
		"file2.yaml": {
			ContentType: "text/yaml",
			Body:        []byte(nop2Config),
		},
	},
}

Will result in this effective.yaml

exporters:
    nop: null
extensions:
    health_check:
        endpoint: localhost:45843
    opamp:
        instance_uid: 01914658-9d6d-7f2f-8f98-be5e80c1ed3e
        ppid: 1
        ppid_poll_interval: 5s
        server:
            ws:
                endpoint: ws://localhost:35835/v1/opamp
                tls:
                    insecure: true
receivers:
    nop: null
service:
    extensions:
        - health_check
        - opamp
    pipelines:
        metrics/2:
            exporters:
                - nop
            receivers:
                - nop
                - nop
        traces/3:
            exporters:
                - nop
            receivers:
                - nop
    telemetry:
        logs:
            encoding: json
        resource:
            foo: bar
            host.arch: arm64
            host.name: b6c93dcf7b8c
            os.type: linux
            service.instance.id: 01914658-9d6d-7f2f-8f98-be5e80c1ed3e
            service.name: otelcol-custom
            service.version: 1.0.0

Describe the solution you'd like

Save each received AgentConfigFile as a seperate file and give each to the collector --config cli param as it support multiple files.

Describe alternatives you've considered

No response

Additional context

No response

@Asarew Asarew added enhancement New feature or request needs triage New item requiring triage labels Aug 12, 2024
Copy link
Contributor

Pinging code owners:

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

@Asarew Asarew changed the title [opampsupervisor] don't merge multiple receiver config files [opampsupervisor] don't merge multiple received agent config files Aug 12, 2024
@BinaryFissionGames
Copy link
Contributor

BinaryFissionGames commented Aug 12, 2024

We had discussed this in the past, and I think we agreed this would be the best way to do it -- we need open-telemetry/opentelemetry-collector#8754 to do this though, in order to support this type of merging (which we require for the opamp extension to be configured).

@crobert-1
Copy link
Member

Removing needs triage based on code owner's response and the information included in the linked issue.

@crobert-1 crobert-1 removed the needs triage New item requiring triage label Aug 12, 2024
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

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

@github-actions github-actions bot added the Stale label Oct 14, 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

3 participants