-
Notifications
You must be signed in to change notification settings - Fork 209
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
[AppSignals] Implement translation for appsignals on native k8s #1012
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1012 +/- ##
==========================================
+ Coverage 57.58% 63.30% +5.72%
==========================================
Files 370 361 -9
Lines 17548 18199 +651
==========================================
+ Hits 10105 11521 +1416
+ Misses 6848 6083 -765
Partials 595 595 ☔ View full report in Codecov by Sentry. |
11a2ba0
to
c1c40b8
Compare
plugins/processors/awsappsignals/internal/resolver/attributesresolver.go
Outdated
Show resolved
Hide resolved
isEks, err := common.IsEKS() | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
if isEks { | ||
cfg.Resolvers = []appsignalsconfig.Resolver{ | ||
appsignalsconfig.NewEKSResolver(hostedIn), | ||
} | ||
} else { | ||
cfg.Resolvers = []appsignalsconfig.Resolver{ | ||
appsignalsconfig.NewK8sResolver(hostedIn), |
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 see this code snippet used in a bunch of places ? can it be moved to a common util package ?
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.
The logic within the if else blocks are all different. The common code would be lines 70 to 73, but that can't be exported because we would still need to return if an error occurs.
Description of the issue
Native kubernetes(k8s) requires a different configuration for appsignals. This PR handles the translation for when the agent is on a native k8s cluster
Description of changes
HostedIn.K8s.Cluster
when on native k8s instead ofHostedIn.EKS.Cluster
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
Unit tested. Tested on native kubernetes cluster using minikube. Translated yaml for both native k8s and EKS attached below:
Note: ContainerInsights was disabled to remove clutter when viewing translated yaml
Native k8s:
EKS (No changes made, this snippet is just for confirmation):
Requirements
Before commit the code, please do the following steps.
make fmt
andmake fmt-sh
make lint