Skip to content

Commit acbb878

Browse files
[cmd/opampsupervisor] Support runtime config rollback (#47853)
Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com> Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
1 parent e4b1bac commit acbb878

9 files changed

Lines changed: 1000 additions & 38 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. receiver/filelog)
7+
component: cmd/opampsupervisor
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Add support for restoring the last working remote configuration when an
11+
incoming remote configuration fails to apply
12+
13+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
14+
issues: [47192]
15+
16+
# (Optional) One or more lines of additional information to render under the primary note.
17+
# These lines will be padded with 2 spaces and then inserted directly into the document.
18+
# Use pipe (|) for multiline entries.
19+
subtext: |
20+
This behavior is controlled under the configuration option `agent.automatic_config_rollback`.
21+
When an old remote configuration is restored, the agent will report an "applied" status again
22+
for this configuraiton.
23+
24+
# If your change doesn't affect end users or the exported elements of any package,
25+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
26+
# Optional: The change log or logs in which this entry should be included.
27+
# e.g. '[user]' or '[user, api]'
28+
# Include 'user' if the change is relevant to end users.
29+
# Include 'api' if there is a change to a library API.
30+
# Default: '[user]'
31+
change_logs: [user]

cmd/opampsupervisor/README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The design is still undergoing changes, and as such this implementation may chan
1616

1717
Binary and container images for the Supervisor are available under tags starting with `cmd/opampsupervisor` [here](https://github.com/open-telemetry/opentelemetry-collector-releases/tags).
1818

19-
## More information.
19+
## More information
2020

2121
If you'd like to learn more about OpAMP, see the
2222
[OpAMP specification](https://github.com/open-telemetry/opamp-spec/blob/main/specification.md#open-agent-management-protocol).
@@ -121,6 +121,7 @@ agent:
121121
## Persistent data storage
122122

123123
The supervisor persists some data to disk in order to mantain state between restarts. The directory where this data is stored may be specified via the supervisor configuration:
124+
124125
```yaml
125126
storage:
126127
directory: "/path/to/storage/dir"
@@ -180,6 +181,24 @@ agent:
180181

181182
See [examples/supervisor_fallback.yaml](./examples/supervisor_fallback.yaml) for a complete example configuration with fallback enabled.
182183

184+
## Automatic Remote Configuration Rollback
185+
186+
The Supervisor supports automatic rollback when a remote configuration received from
187+
the OpAMP backend causes the Collector to fail to start correctly. This feature is
188+
**disabled by default** and can be enabled in the Supervisor configuration file:
189+
190+
```yaml
191+
agent:
192+
automatic_config_rollback: true
193+
```
194+
195+
When enabled, the Supervisor will watch the health of the Collector after applying remote
196+
configurations received from the OpAMP backend and it will cache the last working one in
197+
disk, besides the last received. If a remote configurations causes the Collector
198+
to fail to start correctly, the Supervisor will automatically swap to the last working one
199+
and restart the Collector. During this process, a new "APPLIED" status will be reported for
200+
the last working configuration.
201+
183202
## Status
184203

185204
The OpenTelemetry OpAMP Supervisor is intended to be the reference

0 commit comments

Comments
 (0)