-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[cmd/opampsupervisor] Make configuration merge more customizable through special config files #40295
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
Merged
evan-bradley
merged 36 commits into
open-telemetry:main
from
douglascamata:supervisor-config-file-revamp
Jul 7, 2025
Merged
[cmd/opampsupervisor] Make configuration merge more customizable through special config files #40295
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
8815078
Rename `loadRemoteConfig` to `loadLastRecvdRemoteConfig`
douglascamata 51f1749
Fix typo in logs
douglascamata e985290
Create variable only in the scope where it is used
douglascamata b7655ca
Implement magic config files for internal config
douglascamata 0a98cf6
Add changelog entry
douglascamata e0f247b
go fmt
douglascamata ea6bbbd
Avoid shadowing err
douglascamata 5a8f5af
Fix and improve specification docs on configuration
douglascamata 3df002c
Fix formatting
douglascamata 5f6bae8
Update example and remove repeated statement
douglascamata 3ca60a8
Address PR review feedback
douglascamata 5c9fe5b
Update changelog
douglascamata e92e09b
Fix typo
douglascamata b913316
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
douglascamata 69c2823
Merge branch 'main' into supervisor-config-file-revamp
douglascamata 2ea3933
Fix conflict resolution
douglascamata 3a383d3
Apply suggestions from code review for comments
douglascamata d3b4383
Remove default config file enforcmeent from config validation
douglascamata e55c4f7
Simplify logic to add special config files
douglascamata e9b5276
Add test case for special config file validation
douglascamata ce6b08a
Add a few test cases for `Supervisor.addSpecialConfigFiles()`
douglascamata 343812f
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
douglascamata e3eefa6
Retrigger build due to weird failure
douglascamata 393759e
Add extra changelog entry for breaking change in agent config files b…
douglascamata d239fb8
Fix typo (`OWN_METRICS` -> `OWN_TELEMETRY`)
douglascamata 59a69f8
Add more tests for special config file handling
douglascamata cd9e581
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
douglascamata 7596730
Fix comment in special config file loading
douglascamata a40349d
Fix changelog for breaking change
douglascamata c33d92f
Rename changelog file
douglascamata bfd4eb4
Merge `OWN_TELEMETRY_CONFIG` into `BUILTIN_CONFIG`
douglascamata d0b4864
Rename built-in special config file
douglascamata 07d6db3
Renames for consistency (`extra config` -> `extra telemetry config`, …
douglascamata ceca3ef
Delete old `extraconfig.yaml` file
douglascamata 56078a1
Rename `konf` to `conf`
douglascamata d34f600
Merge branch 'main' of github.com:open-telemetry/opentelemetry-collec…
douglascamata File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Use this changelog template to create an entry for release notes. | ||
|
|
||
| # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
| change_type: breaking | ||
|
|
||
| # The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
| component: cmd/opampsupervisor | ||
|
|
||
| # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
| note: Remote configuration by default now merges on top of user-provided config files. | ||
|
|
||
| # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
| issues: [39963] | ||
|
|
||
| # (Optional) One or more lines of additional information to render under the primary note. | ||
| # These lines will be padded with 2 spaces and then inserted directly into the document. | ||
| # Use pipe (|) for multiline entries. | ||
| subtext: | | ||
| Previous, by default, user-provided config files were merged on top of all | ||
| other configuration. This is not the case anymore. | ||
|
|
||
| The new default order configuration merging is as follows (from lowest to highest precedence): | ||
|
|
||
| - `$OWN_TELEMETRY_CONFIG` | ||
| - <USER_PROVIDED_CONFIG_FILES> | ||
| - `$OPAMP_EXTENSION_CONFIG` | ||
| - `$REMOTE_CONFIG` | ||
| # If your change doesn't affect end users or the exported elements of any package, | ||
| # you should instead start your pull request title with [chore] or use the "Skip Changelog" label. | ||
| # Optional: The change log or logs in which this entry should be included. | ||
| # e.g. '[user]' or '[user, api]' | ||
| # Include 'user' if the change is relevant to end users. | ||
| # Include 'api' if there is a change to a library API. | ||
| # Default: '[user]' | ||
| change_logs: [user] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Use this changelog template to create an entry for release notes. | ||
|
|
||
| # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
| change_type: enhancement | ||
|
|
||
| # The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
| component: cmd/opampsupervisor | ||
|
|
||
| # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
| note: Add support for total control of configuration merging through special configuration files | ||
|
|
||
| # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
| issues: [39963] | ||
|
|
||
| # (Optional) One or more lines of additional information to render under the primary note. | ||
| # These lines will be padded with 2 spaces and then inserted directly into the document. | ||
| # Use pipe (|) for multiline entries. | ||
| subtext: | | ||
| The special configuration files can be used through the `agent::config_files` option to control the order | ||
| in which configuration is merged. This allows greater customization of this feature, so that it can adapt | ||
| many use cases without requiring code changes. | ||
|
|
||
| Configuration is merged from the top of the list to the bottom, in order. This means that the first configuration | ||
| files will get overwritten by the later ones. | ||
|
|
||
| Here's a list of the available special configuration options and what they represent: | ||
|
|
||
| - "$OWN_TELEMETRY_CONFIG": configuration to set up the agent's own telemetry (resource, identifying and non-identifying attributes, etc.). | ||
| - "$OPAMP_EXTENSION_CONFIG": configuration for the agent's OpAMP extension to connect to the Supervisor. | ||
| - "$REMOTE_CONFIG": remote configuration received by the Supervisor. | ||
|
|
||
| Here's an example that could be used to configure the Agent: | ||
|
|
||
| ``` | ||
| agent: | ||
| config_files: | ||
| - base_config.yaml | ||
| - $OWN_TELEMETRY_CONFIG | ||
| - $OPAMP_EXTENSION_CONFIG | ||
| - $REMOTE_CONFIG | ||
| - compliance_config.yaml | ||
| ``` | ||
|
|
||
| If **one or more** of the special files are not specified, they are automatically | ||
| added at predetermined positions in the list. The order is as follows: | ||
|
|
||
| - `$OWN_TELEMETRY_CONFIG` | ||
| - <USER_PROVIDED_CONFIG_FILES> | ||
| - `$OPAMP_EXTENSION_CONFIG` | ||
| - `$REMOTE_CONFIG` | ||
| # If your change doesn't affect end users or the exported elements of any package, | ||
| # you should instead start your pull request title with [chore] or use the "Skip Changelog" label. | ||
| # Optional: The change log or logs in which this entry should be included. | ||
| # e.g. '[user]' or '[user, api]' | ||
| # Include 'user' if the change is relevant to end users. | ||
| # Include 'api' if there is a change to a library API. | ||
| # Default: '[user]' | ||
| change_logs: [user] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
evan-bradley marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.