-
Notifications
You must be signed in to change notification settings - Fork 727
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
Add appdynamicscloud metric provider #1360
base: main
Are you sure you want to change the base?
Conversation
Hi @stefanprodan, I think the PR is ready for review. Please let me know if I can provide anything else. I would love to get this into the next release. Thank you, Charles |
Signed-off-by: charleslin-appd <charles.lin@appdynamics.com>
Signed-off-by: charleslin-appd <charles.lin@appdynamics.com>
Signed-off-by: charleslin-appd <charles.lin@appdynamics.com>
Signed-off-by: charleslin-appd <charles.lin@appdynamics.com>
e3be145
to
c77d8eb
Compare
I believe the DCO check is passed. Any chance for getting the PR reviewed? |
Signed-off-by: charleslin-appd <charles.lin@appdynamics.com>
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.
hey @charlesLin, thanks for opening this PR!
i have a few questions about the code, most of them regarding how the upstream provider itself works. since i have zero experience with AppDynamics Cloud, i don't feel very comfortable reviewing this PR. some more doc refs and explanation would be really helpful.
} | ||
// actual result (non-meta data) is in the data element of the last item | ||
// of the json array | ||
data := anyValue[len(anyValue)-1]["data"].([]any) |
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.
according to the OpenAPI docs:
The ModelResultChunk will be always the first item in the response array. The rest of the items might be a mix of DataResultChunk, ErrorResultChunk and HeartbeatResultChunk
how are we safely assuming that the data we are interested in will always be the last item of the array?
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.
Hi @aryan9600 ,
Thank you for reviewing and the questions. AppDynamics Cloud Query response is a big model that covers metrics, logs, traces and spans. I am hoping to reduce the code complexity since we only retrieves a single floating value from the upstream. As long as the query submitted to the upstream is for a single metrics value, the result is either empty DataResultChunk or an array of {timestamp, numbers} pair with the last item being the value that we wanted. Rather than including the entire package of the API data model and un-marshaling all the meta data, what I try to do is to put enough error checking around each type cast so that we can safely return the numeric value at the end. I just realized that I need to error check the last type cast to float64 as well. Will it be good enough once that is added?
Thanks,
Charles
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.
Hi @aryan9600,
I added error checking for type cast of the last item of the array to float. Love to hear your thoughts.
Thanks,
Charles
Signed-off-by: charleslin-appd <charles.lin@appdynamics.com>
Codecov ReportBase: 54.37% // Head: 54.23% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1360 +/- ##
==========================================
- Coverage 54.37% 54.23% -0.14%
==========================================
Files 84 85 +1
Lines 10044 10172 +128
==========================================
+ Hits 5461 5517 +56
- Misses 3927 3983 +56
- Partials 656 672 +16
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
AppDynamics Cloud offers full-stack observability for large, managed Kubernetes deployments. I would like to use its metrics in flagger.