-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[browserstack-service] Add Funnel Data instrumentation [v8] #12392
[browserstack-service] Add Funnel Data instrumentation [v8] #12392
Conversation
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.
Thanks for the PR. I would generally advise not to wrap everything within a try/catch
.
packages/wdio-browserstack-service/src/instrumentation/funnelInstrumentation.ts
Outdated
Show resolved
Hide resolved
packages/wdio-browserstack-service/src/instrumentation/funnelInstrumentation.ts
Outdated
Show resolved
Hide resolved
packages/wdio-browserstack-service/src/instrumentation/funnelInstrumentation.ts
Outdated
Show resolved
Hide resolved
try { | ||
this.hookStartedStats.triggered() | ||
this.sendBatchEvents(this.getEventForHook('HookRunStarted', hookData)) |
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.
Why is this wrapped in a try/catch
block?
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.
The sendBatchEvents
method calls add
method of RequestQueueHandler which can throw exception
- currently when build start not yet completed.
This try catch is added to mainly get the proper instrumentation on how many events, we were able to send properly and how many failed. That's why this try catch is needed to catch the instrumentation properly, we are re-throwing the exception from here after catching.
try { | ||
this.hookFinishedStats.triggered(hookData.result) | ||
this.sendBatchEvents(this.getEventForHook('HookRunFinished', hookData)) |
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.
same
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.
The sendBatchEvents
method calls add
method of RequestQueueHandler which can throw exception
- currently when build start not yet completed.
This try catch is added to mainly get the proper instrumentation on how many events, we were able to send properly and how many failed. That's why this try catch is needed to catch the instrumentation properly, we are re-throwing the exception from here after catching.
}).json() | ||
BStackLogger.debug(`[${logTag}] Success response: ${JSON.stringify(data)}`) | ||
} catch (error) { | ||
BStackLogger.debug(`[${logTag}] Failed. Error: ${error}`) |
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.
Shouldn't we return an error object here too similar to line 23?
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.
Actually this method should throw error for any reason it is not able to make the request, forgot to update it before. Have updated it now to throw errors
Hey @christian-bromann, thanks for the quick review of the PR and sorry for my delay in responding. Have replied to all comments and made changes wherever necessary. Please re-review the PR |
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.
Two last comments. Can we raise a similar PR to main
and optionally v7
if you like to backport this.
Co-authored-by: Christian Bromann <git@bromann.dev>
Co-authored-by: Christian Bromann <git@bromann.dev>
…o add_observability_stats
Hey @christian-bromann, have resolved the comments. Also the failing tests doesn't seem related to the changes.
|
Let me know if I can help to resolve the issue. I recommend checking out That said, I wanted to make sure that we have all 3 PRs ready to go before merging. |
v9 is working for me locally now. I was trying out v9 branch day before yesterday, but faced some typescript errors when ran the setup. Not sure what merged in main now, but with latest pull, currently it is working for me 🎉 . Will try to create the v9 PR for this. @christian-bromann It might take some time for me (possibly tomorrow) to create a v9 PR as I need to port the changes and test them. Possible for merging this PR for now? Will share the v7 and v9 PRs as soon as they are ready. |
I am happy to merge once we have the PR for |
Sure @christian-bromann, I will try to create rest of the PRs asap. Thanks! |
Hey @christian-bromann, have created PRs for main and v7. Please have a look |
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.
LGTM 👍
Proposed changes
Types of changes
Checklist
Backport Request
//: # (The current
main
branch is the development branch for WebdriverIO v9. If your change should be released to the current major version of WebdriverIO (v8), please raise another PR with the same changes against thev8
branch.)v9
and doesn't need to be back-ported#XXXXX
Further comments
Reviewers: @webdriverio/project-committers