-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: handle float value in NumberDataPoint
It's currently possible to have a `Counter` with a `Float` value, but this fails to export because the `NumberDataPoint` is always assumed to be an `Integer` for the purposes of ProtoBuf encoding. The `.proto` for a `NumberDataPoint` allows for a float value in the `as_double` key, so there should be no reason that we should not be able to support `Float` `Counter`s. This commit adds support for `Float` values in `NumberDataPoint`, which in turn adds support for `Float` `Counter`s. I also updated the documentation in the structs for both `NumberDataPoint.value` and `HistogramDataPoint.sum` to match the expected type based on the `.proto`. Adds a test to confirm that the metrics_exporter handles both `Integer` and `Float` values for a `NumberDataPoint`.
- Loading branch information
1 parent
08b1130
commit c703e36
Showing
4 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters