-
Notifications
You must be signed in to change notification settings - Fork 46
[OpAMP] Remote config -> effective config feedback #2898
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
Closed
robsunday
wants to merge
28
commits into
signalfx:main
from
robsunday:opamp-remote-effective-config-feedback
+574
−177
Closed
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
c592854
work in progress
breedx-splk d80e8b9
simplify by making a test config class impl
breedx-splk ff88ec8
factor out the creational stuff into a builder, add tests
breedx-splk daa85ff
default
breedx-splk 0706870
rework tests
breedx-splk dfc76ed
rename
breedx-splk 7f880ff
import logger
breedx-splk 37e5776
work on tests
breedx-splk 16eb882
rename sequencer -> flusher.
breedx-splk 2bec48f
spotless
breedx-splk 6976881
Merge branch 'main' into opamp-tmp
robsunday 3e8642b
POC
robsunday 6b553f9
POC code refactored into production
robsunday da2bd25
Test fixed
robsunday 67ad654
Added possibility to turn off profiler from remote config
robsunday 7676238
fix
robsunday 7bf5bc4
code review followup
robsunday 4d25025
Merge branch 'main' into opamp-tmp
robsunday dd1c3b1
Additional JFR check added
robsunday d345784
Enable reporting effective config after change
robsunday 14ae567
Enable reporting effective config after change
robsunday 8f66b55
Spotless
robsunday 476da9c
Merge branch 'main' into opamp-remote-effective-config-feedback
robsunday 944e0b8
Merge fix
robsunday 0e10073
Remote config status reporting improved
robsunday 06c7fe9
Refactoring of profiler config
robsunday 3c46ecd
Use configuration supplier in few additional places
robsunday dfda42b
cleanup
robsunday 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
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
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
135 changes: 135 additions & 0 deletions
135
opamp/src/main/java/com/splunk/opentelemetry/opamp/ProfilerRemoteConfiguration.java
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,135 @@ | ||
| /* | ||
| * Copyright Splunk Inc. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package com.splunk.opentelemetry.opamp; | ||
|
|
||
| import com.splunk.opentelemetry.profiler.ProfilerConfiguration; | ||
| import java.time.Duration; | ||
| import java.util.Objects; | ||
| import java.util.logging.Logger; | ||
| import javax.annotation.Nullable; | ||
|
|
||
| public class ProfilerRemoteConfiguration implements ProfilerConfiguration { | ||
| private static final Logger logger = | ||
| Logger.getLogger(ProfilerRemoteConfiguration.class.getName()); | ||
|
|
||
| private final ProfilerConfiguration delegate; | ||
|
|
||
| private boolean enabled; | ||
|
|
||
| ProfilerRemoteConfiguration(ProfilerConfiguration delegate) { | ||
| this.delegate = Objects.requireNonNull(delegate); | ||
|
|
||
| enabled = delegate.isEnabled(); | ||
| } | ||
|
|
||
| void setEnabled(boolean enabled) { | ||
| this.enabled = enabled; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean isEnabled() { | ||
| return enabled; | ||
| } | ||
|
|
||
| @Override | ||
| public void log() { | ||
| logger.info("-----------------------"); | ||
| logger.info("Remote profiler configuration overwrites:"); | ||
| log("Enabled", isEnabled()); | ||
| logger.info("Base profiler configuration:"); | ||
| delegate.log(); | ||
| } | ||
|
|
||
| private static void log(String key, @Nullable Object value) { | ||
| logger.info(String.format("%30s : %s", key, value)); | ||
| } | ||
|
|
||
| @Override | ||
| public String getIngestUrl() { | ||
| return delegate.getIngestUrl(); | ||
| } | ||
|
|
||
| @Override | ||
| public String getOtlpProtocol() { | ||
| return delegate.getOtlpProtocol(); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean getMemoryEnabled() { | ||
| return delegate.getMemoryEnabled(); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean getMemoryEventRateLimitEnabled() { | ||
| return delegate.getMemoryEventRateLimitEnabled(); | ||
| } | ||
|
|
||
| @Override | ||
| public String getMemoryEventRate() { | ||
| return delegate.getMemoryEventRate(); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean getUseAllocationSampleEvent() { | ||
| return delegate.getUseAllocationSampleEvent(); | ||
| } | ||
|
|
||
| @Override | ||
| public Duration getCallStackInterval() { | ||
| return delegate.getCallStackInterval(); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean getIncludeAgentInternalStacks() { | ||
| return delegate.getIncludeAgentInternalStacks(); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean getIncludeJvmInternalStacks() { | ||
| return delegate.getIncludeJvmInternalStacks(); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean getTracingStacksOnly() { | ||
| return delegate.getTracingStacksOnly(); | ||
| } | ||
|
|
||
| @Override | ||
| public int getStackDepth() { | ||
| return delegate.getStackDepth(); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean getKeepFiles() { | ||
| return delegate.getKeepFiles(); | ||
| } | ||
|
|
||
| @Override | ||
| public String getProfilerDirectory() { | ||
| return delegate.getProfilerDirectory(); | ||
| } | ||
|
|
||
| @Override | ||
| public Duration getRecordingDuration() { | ||
| return delegate.getRecordingDuration(); | ||
| } | ||
|
|
||
| @Override | ||
| public Object getConfigProperties() { | ||
| return delegate.getConfigProperties(); | ||
| } | ||
| } |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[for reviewer] This class is a proxy over original configuration. Original profiler configuration is immutable once created. This class overwrites handling of the properties that are updatable via remote configuration, while preserving original values.
I'm still considering introducing a mutable ProfilerConfiguration interface implementation and letting appropriate factories to set it up. This would be served via SUPPLIER without any proxy objects.