forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 26
Add cert watcher for target allocator TLS config #290
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
Open
musa-asad
wants to merge
8
commits into
aws-cwa-dev
Choose a base branch
from
mtls
base: aws-cwa-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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 was referenced Mar 18, 2025
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
okankoAMZ
reviewed
May 20, 2025
} | ||
|
||
// sync request jobs from targetAllocator and update underlying receiver, if the response does not match the provided compareHash. | ||
// baseDiscoveryCfg can be used to provide additional ScrapeConfigs which will be added to the retrieved jobs. | ||
func (m *Manager) sync(compareHash uint64, httpClient *http.Client) (uint64, error) { | ||
func (m *Manager) sync(ctx context.Context, compareHash uint64) (uint64, error) { |
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.
why not just pass the Https client directly why do need to make one client every sync
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of the issue
The Target Allocator manager from the Prometheus receiver doesn't have a mechanism to reload the HTTP client when one of the TLS certificates (CAFile, CertFile, or KeyFile) change due to a refresh. This causes an error when the Target Allocator refreshes its credentials and the OTel Collector doesn't restart since it has a static HTTP client with old credentials.
Description of changes
Important
Co-PRs: 1) aws-observability/helm-charts#163; 2) aws/amazon-cloudwatch-agent#1510; aws/amazon-cloudwatch-agent-operator#284
httpClient
initialization tosync()
function so that it's called repeatedly.setupTLSWatchers()
function to call thesync()
function every time there is a change in one of the credentials.License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
Before
Target Allocator
OTel Collector
After
Target Allocator
OTel Collector