Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
scripts/inject-amplitude.js
Outdated
| setup: function() { return undefined; }, | ||
| execute: function(event) { |
There was a problem hiding this comment.
don't these need to be async functions?
https://amplitude.com/docs/sdks/sdk-plugins#enrichment-plugins
There was a problem hiding this comment.
yea i think youre right
scripts/inject-amplitude.js
Outdated
| var enrichFrontendPlugin = { | ||
| name: 'enrich-frontend-plugin', |
There was a problem hiding this comment.
use more descriptive name i.e. appendBonkPlugin
scripts/inject-amplitude.js
Outdated
| // Enrichment plugin to add 'frontend' to ALL events (including automatic ones) | ||
| var enrichFrontendPlugin = { | ||
| name: 'enrich-frontend-plugin', | ||
| type: 'enrichment', |
There was a problem hiding this comment.
confirm this is what PluginType.ENRICHMENT's value is
There was a problem hiding this comment.
it is however it defaults to enrichment type so removing
| datadogLogs.setGlobalContextProperty('frontend', FRONTEND); | ||
| datadogLogs.setGlobalContextProperty('dd-client-token', CLIENT_TOKEN); | ||
| datadogLogs.setGlobalContextProperty('instance-id', instanceId); |
There was a problem hiding this comment.
What is the difference between the Global and non-Global context property?
There was a problem hiding this comment.
The difference is when they are executed, global sets the context pre-init and regular is called synchronously after init. This is really just a belt and suspenders incase we were setting the context async before the SDK was fully initialized
| // Enrichment plugin to add 'frontend' to ALL events (including automatic ones) | ||
| var appendBonkPlugin = { | ||
| name: 'append-bonk-plugin', | ||
| execute: async function(event) { |
There was a problem hiding this comment.
in the docs they say its optional and the setup that was there didnt do anything so i dont think we need it.
for reference see Amplitude browser sdk plugins and scroll down to the table in the Create a custom plugin section
Changes
Issue
https://linear.app/dydx/issue/ENG-1600/fix-bonk-logging-issue