Skip to content

Conversation

@hossain-rayhan
Copy link
Contributor

@hossain-rayhan hossain-rayhan commented Oct 16, 2020

Description:
We had our internal discussion and we decided to report CpuUtilized metric 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 awsemf exporter reads dimensions only from metric labels. As this exporter is major target for awsecscontainermetrics receiver, 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.

@hossain-rayhan hossain-rayhan requested a review from a team October 16, 2020 02:44
@anuraaga
Copy link
Contributor

anuraaga commented Oct 16, 2020

@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?

@hossain-rayhan
Copy link
Contributor Author

@anuraaga , Yes, I removed metric label settings from this PR. Will create a separate PR with those changes. Please, let's move with CpuUtilzed and UsageInVCPU metric calculations here. Thanks.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@hossain-rayhan hossain-rayhan changed the title awsecscontainermetrics: add task/container metadata as metric labels and update CpuUtilized metric calculation awsecscontainermetrics: update CpuUtilized metric calculation Oct 16, 2020
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous here too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@hossain-rayhan
Copy link
Contributor Author

hossain-rayhan commented Oct 16, 2020

Thanks @anuraaga for the fast review.
@tigrannajaryan @bogdandrutu can we get this merged. For windows-test, the datadog exporter is failing every-time. I have no clue.

@mx-psi
Copy link
Member

mx-psi commented Oct 16, 2020

@hossain-rayhan the Datadog exporter issue was fixed on #1274, you can rebase/merge master to get the tests to pass

@hossain-rayhan
Copy link
Contributor Author

hossain-rayhan commented Oct 16, 2020

cools. I rebased my code with master and all the tests passed. Thanks @mx-psi
@tigrannajaryan @bogdandrutu can we get this merged.

@tigrannajaryan tigrannajaryan merged commit 23c4329 into open-telemetry:master Oct 16, 2020
dyladan referenced this pull request in dynatrace-oss-contrib/opentelemetry-collector-contrib Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants