Skip to content

Commit

Permalink
Do not update RemoteService dimension on the to be aggregated depende…
Browse files Browse the repository at this point in the history
…ncy metrics (#1062)
  • Loading branch information
mxiamxia authored Feb 29, 2024
1 parent ad93eb1 commit 1d5b5eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
)

const (
UnprocessedServiceOperationValue = "AllOtherOperations"
UnprocessedRemoteServiceValue = "AllOtherDependencies"
UnprocessedServiceOperationValue = "AllOtherOperations"
UnprocessedRemoteServiceOperationValue = "AllOtherRemoteOperations"
)

const (
Expand Down Expand Up @@ -338,13 +338,13 @@ func (s *service) admitMetricData(metric *MetricData) bool {

func (s *service) rollupMetricData(attributes pcommon.Map) {
for _, indexAttr := range awsDeclaredMetricAttributes {
if strings.HasPrefix(indexAttr, "HostedIn.") || (indexAttr == common.MetricAttributeLocalService) {
if strings.HasPrefix(indexAttr, "HostedIn.") || (indexAttr == common.MetricAttributeLocalService) || (indexAttr == common.MetricAttributeRemoteService) {
continue
}
if indexAttr == common.MetricAttributeLocalOperation {
attributes.PutStr(indexAttr, UnprocessedServiceOperationValue)
} else if indexAttr == common.MetricAttributeRemoteService {
attributes.PutStr(indexAttr, UnprocessedRemoteServiceValue)
} else if indexAttr == common.MetricAttributeRemoteOperation {
attributes.PutStr(indexAttr, UnprocessedRemoteServiceOperationValue)
} else {
attributes.PutStr(indexAttr, "-")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ func TestAdmitAndRollup(t *testing.T) {
admittedAttributes[uniqKey.AsString()] = attr
} else {
for _, indexedAttrKey := range awsDeclaredMetricAttributes {
if strings.HasPrefix(indexedAttrKey, "HostedIn.") || indexedAttrKey == "Service" {
if strings.HasPrefix(indexedAttrKey, "HostedIn.") || indexedAttrKey == "Service" || indexedAttrKey == "RemoteService" {
continue
}
attrValue, _ := attr.Get(indexedAttrKey)
if indexedAttrKey == common.MetricAttributeLocalOperation {
assert.Equal(t, UnprocessedServiceOperationValue, attrValue.AsString())
} else if indexedAttrKey == common.MetricAttributeRemoteService {
assert.Equal(t, UnprocessedRemoteServiceValue, attrValue.AsString())
} else if indexedAttrKey == common.MetricAttributeRemoteOperation {
assert.Equal(t, UnprocessedRemoteServiceOperationValue, attrValue.AsString())
} else {
assert.Equal(t, "-", attrValue.AsString())
}
Expand Down

0 comments on commit 1d5b5eb

Please sign in to comment.