-
Notifications
You must be signed in to change notification settings - Fork 636
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
fix(stackdriver): read INT64 metrics correctly #933
Conversation
...kdriver/src/main/java/com/netflix/kayenta/stackdriver/metrics/StackdriverMetricsService.java
Show resolved
Hide resolved
...ver/src/test/java/com/netflix/kayenta/stackdriver/metrics/StackdriverMetricsServiceTest.java
Outdated
Show resolved
Hide resolved
...ver/src/test/java/com/netflix/kayenta/stackdriver/metrics/StackdriverMetricsServiceTest.java
Outdated
Show resolved
Hide resolved
Hi @dbyron-sf ! It's been a while :-) I got some help and put in the time to write the test (I also wrote another one while I was at it). I ran the test and it's green when the fix is applied and red when running with the original code. It's ready for review, please take a look and tell me what you think. Thank you |
...ver/src/test/java/com/netflix/kayenta/stackdriver/metrics/StackdriverMetricsServiceTest.java
Outdated
Show resolved
Hide resolved
@InjectMocks StackdriverMetricsService stackdriverMetricsService; | ||
|
||
@Test | ||
public void readsInt64Metrics() throws IOException { |
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.
This test fails without the code change above, which is great!
...ver/src/test/java/com/netflix/kayenta/stackdriver/metrics/StackdriverMetricsServiceTest.java
Outdated
Show resolved
Hide resolved
...ver/src/test/java/com/netflix/kayenta/stackdriver/metrics/StackdriverMetricsServiceTest.java
Outdated
Show resolved
Hide resolved
Thanks so much for sticking with this! |
Of course, it's my pleasure! |
Hi David, thank you for the review and the help. Is there anything else that needs to be done from my side? I see there's a failed check but I don't know if that's anything I can fix, seems like a permission issue |
The StackDriver metric service was hardcoded to read only doubleValue of metrics. However, some metrics are reported from StackDriver as INT64. When the service tries to read them as a doubleValue, they get back a 0, regardless of the true value. Added a test for the type of metric reported, and logic to read and map accordingly. In case of an unexpected value, preserved the previous behavior (reading as doubleValue)