Stop converting nanosecond metrics #1322
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the issue
Currently, nanosecond metrics are converted to microseconds before being published to CloudWatch because CloudWatch does not support nanosecond unit. The closest unit is microseconds.
Unfortunately, this implicit conversion can be confusing for metrics with
ns
in the name likekafka.producer.io-wait-time-ns-avg
because the value/unit in CloudWatch will actually be Microseconds which is inconsistent with the metric name. This also results in a loss of precision.Description of changes
This change removes the conversion of nanosecond metrics. Instead, they are published unmodified with a unit of "None".
License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
Kicked off integration tests for that branch. Checked the
metric_value_benchmark
integ test outputs, search forkafka.producer.io-wait-time-ns-avg
, find log messages like:Plot the
kafka.producer.io-wait-time-ns-avg
metric with that instance ID in CloudWatch. Do that for a few OS types for both my branch and main branch to compare. The updated metrics are about 1000x larger, which is expected. Also noted that the updated metrics do not have a unit associated.Requirements
Before commit the code, please do the following steps.
make fmt
andmake fmt-sh
make lint