-
Notifications
You must be signed in to change notification settings - Fork 3.2k
awsecscontainermetrics: update CpuUtilized metric calculation #1283
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
awsecscontainermetrics: update CpuUtilized metric calculation #1283
Conversation
|
@hossain-rayhan Unfortunately resource is resource - I think it's precisely the exporter layer that should deal with handling resource attributes correctly and not correct for the receiver to fill these in as labels. Apps send resource, so if the exporter isn't handling it correctly, then app metrics are already broken anyways. Do you mind scoping this PR down just to the percentage value change for CPUUtilized? |
|
@anuraaga , Yes, I removed metric label settings from this PR. Will create a separate PR with those changes. Please, let's move with |
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 it safe to not check CPUReserved == 0 here?
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.
For a task, CPUReserved cannot be zero. If the value is not present, we calculate it from all the containers. And, in ECS task, you must need to set CPU Limit- either in task level or in container level.
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.
Cool - let's add a comment to the effect
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.
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.
Let's use Previous instead of Pre in the code (not json which is fixed I suppose) for readability.
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.
Updated.
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.
Previous here too
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.
Updated.
anuraaga
left a comment
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.
Thanks!
|
Thanks @anuraaga for the fast review. |
|
@hossain-rayhan the Datadog exporter issue was fixed on #1274, you can rebase/merge master to get the tests to pass |
…and update cpu calculations Signed-off-by: Rayhan Hossain <[email protected]>
Signed-off-by: Rayhan Hossain <[email protected]>
Signed-off-by: Rayhan Hossain <[email protected]>
Signed-off-by: Rayhan Hossain <[email protected]>
Signed-off-by: Rayhan Hossain <[email protected]>
31c2161 to
2f66404
Compare
|
cools. I rebased my code with master and all the tests passed. Thanks @mx-psi |
Signed-off-by: Bogdan Drutu <[email protected]>
Description:
We had our internal discussion and we decided to report
CpuUtilizedmetric in percentage. We studied our new calculation and verified with domain expert.[Update] As the reviewer's suggestion, will create a separate PR for the following one.
Earlier we decided to add task and container metadata as resource attributes. However, CloudWatch
awsemfexporter reads dimensions only from metric labels. As this exporter is major target forawsecscontainermetricsreceiver, we need to add these metadata as metric labels. I discussed this in our OTel Metric SIG meeting. We also discussed internally and agreed to add them as metric labels as well.This change will address both of these issues.
Link to tracking Issue:
#1282
Testing:
Unit test added.