-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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: add analytics event to track usage of provider webhooks #2832
Conversation
{ | ||
provide: AnalyticsService, | ||
useFactory: async () => { | ||
const analyticsService = new AnalyticsService(process.env.SEGMENT_TOKEN); |
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 needs to be added in terraform I guess? @scopsy
@@ -34,6 +36,17 @@ export class Webhook { | |||
channel, | |||
}); | |||
|
|||
const member = await this.memberRepository.getOrganizationAdminAccount(command.organizationId); |
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.
We do not know who created the Webhook so I am using admin account here...
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.
Looks great! I will add the terraform entry aswell
if (member) { | ||
this.analyticsService.track('[Webhook] - Provider Webhook events parsed', member._userId, { | ||
_organization: command.organizationId, | ||
_environmentId: command.environmentId, | ||
providerId, | ||
channel, | ||
events, | ||
}); | ||
} |
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.
I think actually that this one will be enough (no need to have the top one. wdyt?
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.
I added both to be able to track if we get more webhooks the we parse...
What change does this PR introduce?
Two tracking events so we can track how much provider webhooks is used.
Why was this change needed?
To be able to understand usage of our provider webhook feature