-
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
Configure appsignals processor on EKS with cluster name #980
Conversation
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.
LGTM! thanks!
9038bf2
to
532305d
Compare
translator/translate/otel/processor/awsappsignals/translator.go
Outdated
Show resolved
Hide resolved
@lisguo @sky333999 Can you help review? |
translator/translate/otel/processor/awsappsignals/translator.go
Outdated
Show resolved
Hide resolved
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #980 +/- ##
==========================================
+ Coverage 57.58% 63.02% +5.43%
==========================================
Files 370 360 -10
Lines 17548 18202 +654
==========================================
+ Hits 10105 11471 +1366
+ Misses 6848 6142 -706
+ Partials 595 589 -6 ☔ View full report in Codecov by Sentry. |
translator/translate/otel/processor/awsappsignals/translator.go
Outdated
Show resolved
Hide resolved
func newHostedInAttributeResolver(attributeMap map[string]string) *hostedInAttributeResolver { | ||
func newHostedInAttributeResolver(name string, attributeMap map[string]string) *hostedInAttributeResolver { | ||
if name == "" { | ||
name = "Generic" |
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.
Could we instead use the PlatformGeneric const here as well instead of a string or do we want this to intentionally be Generic
and not generic
?
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.
We use Generic
following the examples provided by CloudWatch metrics: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html.
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.
Added const PlatformGeneric
.
b121450
to
583ff41
Compare
// TODO: change default config when other resolvers are supported | ||
Resolvers: []string{"eks"}, | ||
return &appsignalsconfig.Config{ | ||
Resolvers: []appsignalsconfig.Resolver{}, |
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.
is there a use case when we have a default resolver? What happens then?
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 would never expect the default resolver to be initied for real use case. In case it happens, it will fail the config validation with unknown resolver
error.
if common.IsAppSignalsKubernetes() { | ||
cfg.Resolvers = []string{"eks"} | ||
if !hostedInConfigured { | ||
hostedIn = util.GetClusterNameFromEc2Tagger() |
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.
nice, I didn't even know we had this function
9c8e255
to
f424a1b
Compare
Seems like there are some unit test failures
|
The test failed for some irrelevant issue
|
Description of the issue
Currently, the
awsappsignals
processor reads cluster name from resource attributes which is extracted from EC2 tagkubernetes.io/cluster/my-cluster
byresourcedetection
processor. Most of time, it's working because EKS adds the tag to nodes during provisioning. However, according to Amazon EKS VPC and subnet requirements and considerations, this tag is not a hard dependency for EKS, thus if the customer removes the tag accidentally (or on purpose), our metrics will fail to be generated with correct EKS cluster name dimension, and cause false alarming or missin graphs if the metrics are used in dashboards or alarms/SLOs.Description of changes
awsappsignals
processor on EKS;resolvers
fromstring
array to object array;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
Requirements
Before commit the code, please do the following steps.
make fmt
andmake fmt-sh
make lint