-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update integration metrics capturing (#985)
Co-authored-by: Christopher Radek <[email protected]>
- Loading branch information
1 parent
6863e96
commit 083f9a1
Showing
6 changed files
with
93 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@segment/analytics-next': minor | ||
--- | ||
|
||
Update integration metrics capturing strategy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Context } from '../context' | ||
|
||
export interface RecordIntegrationMetricProps { | ||
integrationName: string | ||
methodName: string | ||
didError?: boolean | ||
type: 'classic' | 'action' | ||
} | ||
|
||
export function recordIntegrationMetric( | ||
ctx: Context, | ||
{ | ||
methodName, | ||
integrationName, | ||
type, | ||
didError = false, | ||
}: RecordIntegrationMetricProps | ||
): void { | ||
ctx.stats.increment( | ||
`analytics_js.integration.invoke${didError ? '.error' : ''}`, | ||
1, | ||
[ | ||
`method:${methodName}`, | ||
`integration_name:${integrationName}`, | ||
`type:${type}`, | ||
] | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters