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

Support a configurable default agent configuration to be implemented by OpAMP supervisor #32598

Closed
pabloem opened this issue Apr 22, 2024 · 8 comments

Comments

@pabloem
Copy link
Contributor

pabloem commented Apr 22, 2024

Component(s)

cmd/opampsupervisor

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

I am implementing the OpAMP protocol across our fleet, and I find that I want agents to implement a default configuration if the supervisor is unable to reach the OpAMP server.

  • Why?

We want most hosts to have a simple default config: Receive OTLP logs in a given port and forward them to our log-processing infrastructure. I want to be sure that this configuration will be enabled even in restricted environments (e.g. environments managing sensitive data - thus blocked by firewalls, etc).

Happy to discuss further.

Describe the solution you'd like

I propose a new parameter agent.base_config in the supervisor that points to a base configuration file that is enabled if we can't get another one. Basic implementation is here:

#32192

Another feature of the PR above is that it avoids overwriting the effective.yaml config to be sure we don't overwrite a config that might have worked in the past.

Describe alternatives you've considered

No response

Additional context

No response

@pabloem pabloem added enhancement New feature or request needs triage New item requiring triage labels Apr 22, 2024
Copy link
Contributor

Pinging code owners:

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

@tigrannajaryan
Copy link
Member

I propose a new parameter agent.base_config in the supervisor that points to a base configuration file that is enabled if we can't get another one.

This seems very similar to collector.config_file setting defined here https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/cmd/opampsupervisor/specification#supervisor-configuration

Would collector.config_file work for you?

@pabloem
Copy link
Contributor Author

pabloem commented Apr 30, 2024

yes looks like that should work.

@evan-bradley evan-bradley removed the needs triage New item requiring triage label Apr 30, 2024
@evan-bradley
Copy link
Contributor

Just to clarify: do we expect collector.config_file will be used even if the Supervisor cannot connect to the OpAMP server? The description says it will be merged with the remote config.

I would expect that a "fallback" config that is used in the case the server is unreachable would be different from a config file that is layered on top of the remote config. @pabloem how do you want this to work in your use case?

@tigrannajaryan
Copy link
Member

Just to clarify: do we expect collector.config_file will be used even if the Supervisor cannot connect to the OpAMP server? The description says it will be merged with the remote config.

Perhaps we make this the "fallback" config? Does it need to be different?

@evan-bradley
Copy link
Contributor

I think the two use cases are different. My understanding of the intent of the current option is based on the description:

Path to optional local Collector config file to be merged with the config provided by the OpAMP server.

Based on this, my expectation is that this file would supplement/overwrite config provided by the server. I would expect the "fallback" and "extra config" cases to be different. For example in the fallback scenario I may have a specific backend I want to send to.

I would be fine just making this a fallback option and only providing a file that is merged with the config from the server if we have user requests for it. I think inlining config from local files inside the server config (e.g. ${file:extra_config.yaml}) should be sufficient for now.

Copy link
Contributor

github-actions bot commented Jul 1, 2024

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 Jul 1, 2024
Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2024
evan-bradley pushed a commit that referenced this issue Oct 2, 2024
…ded (#35430)

**Description:** <Describe what has changed.>
If an empty config map is received, the supervisor does not run the
agent.

~The current logic here works fine, but I'm considering adding an option
to only do this if the user opts into it. I'm not sure if there's a
reason why a user might want to run the collector with the noop config
though (maybe for the agent's self-telemetry?)~

I've thought about it some more, and I don't think we need a config
option here. If users want the collector to use a noop config, they can
send a basic noop config.

I think we should also implement #32598 (closed as stale, we'll want to
re-open this or open a new issue for it), which would allow users to
configure a backup config to use when no config is provided by the
server, if they would like.

**Link to tracking Issue:** Closes #33680

**Testing:**
e2e test added
Manually tested with a modified OpAMP server to send an empty config map

**Documentation:**
Update spec where it seemed applicable to call out this behavior.
jriguera pushed a commit to springernature/opentelemetry-collector-contrib that referenced this issue Oct 4, 2024
…ded (open-telemetry#35430)

**Description:** <Describe what has changed.>
If an empty config map is received, the supervisor does not run the
agent.

~The current logic here works fine, but I'm considering adding an option
to only do this if the user opts into it. I'm not sure if there's a
reason why a user might want to run the collector with the noop config
though (maybe for the agent's self-telemetry?)~

I've thought about it some more, and I don't think we need a config
option here. If users want the collector to use a noop config, they can
send a basic noop config.

I think we should also implement open-telemetry#32598 (closed as stale, we'll want to
re-open this or open a new issue for it), which would allow users to
configure a backup config to use when no config is provided by the
server, if they would like.

**Link to tracking Issue:** Closes open-telemetry#33680

**Testing:**
e2e test added
Manually tested with a modified OpAMP server to send an empty config map

**Documentation:**
Update spec where it seemed applicable to call out this behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants