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.
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
[Bug Fix] Fix Excessive IMDS related error logging #1440
[Bug Fix] Fix Excessive IMDS related error logging #1440
Changes from all commits
d2fcc03
fb911a1
391e332
c3f3432
22d785e
0235728
442a935
eae7f2e
5b93fab
8a2b696
ec09673
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This may seem drastic but based on the codebase serviceprovider isn't really used in Kubernetes scenario. It always gets overriden by either Instrumentation or K8sWorkload service name source.
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.
similar to the above -- shouldn't this be
if e.kubernetesMode != modeEKS
? So that we can account for native k8s?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.
I disabled it for all kubernetes environment because
serviceprovider
isn't used for any Kubernetes related logics. GetMetricServiceNameAndSource is the only public function that is used forawsentity
processor and that is only referenced in EC2 specific processor logic:amazon-cloudwatch-agent/plugins/processors/awsentity/processor.go
Line 214 in 161cd5b
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.
Does
e.serviceprovider.startServiceProvider()
do anything beneficial on EKS? Seems strange that we would have to do this just to avoid the IMDS checkThere 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.
I don't think so.
startServiceProvider
scrapes IAM role or service name from instance tags so they can be used for service names. In Kubernetes environment neither of these will be used because they have lower priority thanInstrumentation
orK8sWorkload
.Code wise, I only see serviceprovider public function called in
awsentity
processor if we are strictly on EC2:amazon-cloudwatch-agent/plugins/processors/awsentity/processor.go
Line 214 in 161cd5b