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

feat(analysis): Adds timeout property to NewRelic metrics provider. Resolves: #3741 #3742

Merged
merged 18 commits into from
Aug 14, 2024

Conversation

orlando-valdez-ck
Copy link
Contributor

@orlando-valdez-ck orlando-valdez-ck commented Jul 24, 2024

Resolves: #3741

Adds a timeout property to the New Relic metrics provider spec to be sent to the NerdGraph API for queries that take longer than the default 5 seconds. I bumped up the newrelic-go-client library while working on this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional with a list of types and scopes found here, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I've signed my commits with DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My builds are green. Try syncing with master if they are not.
  • My organization is added to USERS.md.

@@ -41,13 +66,30 @@ type NewRelicClient struct {
}

// Query executes a NRQL query against the given New Relic account
func (n *NewRelicClient) Query(query string) ([]nrdb.NRDBResult, error) {
results, err := n.Nrdb.Query(n.AccountID, nrdb.NRQL(query))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's an equivalent function that supports passing timeout in the nrdb package but it pulls way more data than the current function which by itself can impact latency.
That's why I switched to the NerdGraph package to send the timeout in the query without incurring in additional data over the wire. I actually slimmed down the query compared to the used in the Query function to just what we need for this metric provider so the GQL API has to do less work to respond (and even less data transmitted back)

Copy link

codecov bot commented Jul 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.99%. Comparing base (36b9e15) to head (e781f32).
Report is 57 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #3742       +/-   ##
===========================================
+ Coverage        0   83.99%   +83.99%     
===========================================
  Files           0      162      +162     
  Lines           0    18517    +18517     
===========================================
+ Hits            0    15554    +15554     
- Misses          0     2101     +2101     
- Partials        0      862      +862     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zachaller zachaller added this to the v1.8 milestone Jul 25, 2024
Signed-off-by: Orlando Valdez <[email protected]>
Signed-off-by: Orlando Valdez <[email protected]>
Signed-off-by: Orlando Valdez <[email protected]>
Signed-off-by: Orlando Valdez <[email protected]>
@zachaller zachaller force-pushed the feat/newrelic-timeout branch from 54cd686 to 1a28ef1 Compare July 25, 2024 01:15
@argoproj argoproj deleted a comment from github-actions bot Jul 25, 2024
Copy link
Contributor

github-actions bot commented Jul 25, 2024

Published E2E Test Results

  4 files    4 suites   3h 24m 59s ⏱️
112 tests 102 ✅  7 💤 3 ❌
452 runs  420 ✅ 28 💤 4 ❌

For more details on these failures, see this check.

Results for commit e781f32.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Jul 25, 2024

Published Unit Test Results

2 263 tests   2 263 ✅  2m 58s ⏱️
  128 suites      0 💤
    1 files        0 ❌

Results for commit e781f32.

♻️ This comment has been updated with latest results.

@zachaller
Copy link
Collaborator

Can I have you update with master and fix conflicts, that should re-run the tests now that I have them fixed.

@argoproj argoproj deleted a comment from github-actions bot Jul 30, 2024
@argoproj argoproj deleted a comment from github-actions bot Jul 30, 2024
@orlando-valdez-ck orlando-valdez-ck marked this pull request as draft August 1, 2024 17:51
@orlando-valdez-ck
Copy link
Contributor Author

Noticed something during my last round of local testing. Changed to draft while I figure this out.

Signed-off-by: Orlando Valdez <[email protected]>
@orlando-valdez-ck orlando-valdez-ck marked this pull request as ready for review August 1, 2024 20:42
@orlando-valdez-ck
Copy link
Contributor Author

Ready for review now

Copy link

@zachaller zachaller merged commit 97ded54 into argoproj:master Aug 14, 2024
25 checks passed
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.

Add timeout attribute for NewRelic metrics provider
2 participants