Skip to content
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

Do not send metric NaN values #2119

Merged
merged 3 commits into from
Feb 16, 2022
Merged

Do not send metric NaN values #2119

merged 3 commits into from
Feb 16, 2022

Conversation

trask
Copy link
Member

@trask trask commented Feb 15, 2022

No description provided.

@trask trask marked this pull request as ready for review February 15, 2022 19:26
@kryalama
Copy link
Contributor

@trask can we please add a unit test for this scenario?

if (filteredPoints.isEmpty()) {
if (metricsData.getMetrics().isEmpty()) {
// this is unexpected
logger.debug("MetricsData has no metric point");
Copy link
Contributor

Choose a reason for hiding this comment

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

should it throw an exception if it's unexpected?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was being conservative, but feel pretty confident, so bumped it up to an exception

}

if (!Double.isFinite(point.getValue())) {
// breeze doesn't like these values
Copy link
Contributor

Choose a reason for hiding this comment

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

do we drop that data point and then send the rest to breeze? here because of bad NaN we drop the whole metric. i wonder how other sdks handle it.

Copy link
Contributor

Choose a reason for hiding this comment

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

unless that data point is the key dimension for that metric. it makes sense to drop it. without it metric doesn't make sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

ya, metric value is required

Copy link
Member Author

Choose a reason for hiding this comment

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

@heyams
Copy link
Contributor

heyams commented Feb 15, 2022

can we add a test for NaN MetricDataPoint?

@trask
Copy link
Member Author

trask commented Feb 16, 2022

can we add a test for NaN MetricDataPoint?

it's tricky currently b/c TelemetryClient is not very testable. I added a TODO in the code, and will revisit in the vnext branch after further TelemetryClient refactoring/simplifications

@trask trask merged commit 6d7d5a4 into main Feb 16, 2022
@trask trask deleted the fix-nan-metrics branch February 16, 2022 23:22
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.

None yet

3 participants