-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[ecs-metrics-receiver] extract cluster name from ARN and rename some constants #1626
[ecs-metrics-receiver] extract cluster name from ARN and rename some constants #1626
Conversation
Signed-off-by: Rayhan Hossain <hossain.rayhan@outlook.com>
Signed-off-by: Rayhan Hossain <hossain.rayhan@outlook.com>
@@ -32,19 +32,19 @@ func containerResource(cm ContainerMetadata) pdata.Resource { | |||
|
|||
func taskResource(tm TaskMetadata) pdata.Resource { | |||
resource := pdata.NewResource() | |||
resource.Attributes().UpsertString(AttributeECSCluster, tm.Cluster) | |||
resource.Attributes().UpsertString(AttributeECSCluster, getResourceFromARN(tm.Cluster)) |
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.
Shouldn't some unit tests need to be added / updated for this change?
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.
Yea, its using an existing function which I renamed. I modified existing unit tests to call this func and test possible cases- empty, correct, and incorrect value.
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 a new test for this. Thanks.
Signed-off-by: Rayhan Hossain <hossain.rayhan@outlook.com>
Codecov Report
@@ Coverage Diff @@
## master #1626 +/- ##
==========================================
- Coverage 89.39% 89.39% -0.01%
==========================================
Files 358 358
Lines 17741 17741
==========================================
- Hits 15860 15859 -1
- Misses 1399 1400 +1
Partials 482 482
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: Rayhan Hossain <hossain.rayhan@outlook.com>
Hi @bogdandrutu @tigrannajaryan can we merge this please. |
github was 503'ing on the URL (presumably because the diff is so large now). Don't bother checking the link.
* Set span status code, message and ref types according to the spec * Serialize array attributes as string * Use correct lib name / version key * Add new and adjust existing tests * Update CHANGELOG Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Metadata received from Fargate gives us ClusterARN instead of ClusterName. So, This change extracts the ClusterName if we receive a ClusterARN. It utilizes our existing func (renamed it).
Also, renamed some resource names matching with semantic conventions. Once semantic convention for AWS PR is merged, we can easily change them without introducing any customer facing changes.