-
Notifications
You must be signed in to change notification settings - Fork 325
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 telemetry to companion #1117
feat: add telemetry to companion #1117
Conversation
@juliaxbow I would love your opinion on the formatting of the telemetry section |
Descriptions
Other
|
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 in principle, a few nits, I need to validate this locally though.
add-on/src/lib/telemetry.js
Outdated
} | ||
|
||
/** | ||
* @param {ReturnType<import('./state').initState>['options']} state |
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.
can we import types form the declaration from the lib?
add-on/src/lib/telemetry.js
Outdated
@@ -0,0 +1,60 @@ | |||
|
|||
import { MetricsProvider } from '@ipfs-shipyard/ignite-metrics/vanilla' |
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.
@ipfs-shipyard/ignite-metrics/vanilla
This needs to be mapped correctly, this breaks the build.
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 should be working properly with latest release of ignite-metrics
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 sensible, as long we address below:
- We should not be sending requests to Countly every minute a user uses a browser.
(I assume that is what is happening? I was unable to build this and test locally)- This causes many issues, for example drains laptop battery by waking up WIFI when no internet conneciton would be needed otherwise.
- As discussed, figure a way to batch things so we report them only once an hour or once a day.
- Regular people don't know what 'session' and 'view' means.
- See my suggestions below on humanizing the language :)
Co-authored-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
Co-authored-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
Co-authored-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
* use latest ignite-metrics library * don't use singleton function for grabbing metricsProvider * ensure metrics initialize and update properly
FYI @lidel @whizzzkid I had some changes locally that weren't pushed up... getting those up now |
* Telemetry messages are passed between contexts using browser.runtime * Upgraded to @ipfs-shipyard/ignite-metrics@1.3.0 * Updated consent handling from state to be more explicit
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, thanks!
} | ||
} | ||
|
||
function onTelemetryMessage (request, sender) { |
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.
👍🏽
@@ -556,6 +559,7 @@ export default async function init () { | |||
await registerSubdomainProxy(getState, runtime) | |||
shouldRestartIpfsClient = true | |||
shouldStopIpfsClient = !state.active | |||
state.active ? startSession() : endSession() |
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.
for now this should be ok, in the future we might wanna have a message being broadcast and such listeners can subscribe to those.
${telemetryForm({ | ||
telemetryGroupMinimal: state.options.telemetryGroupMinimal, | ||
telemetryGroupMarketing: state.options.telemetryGroupMarketing, | ||
telemetryGroupPerformance: state.options.telemetryGroupPerformance, | ||
telemetryGroupTracking: state.options.telemetryGroupTracking, | ||
onOptionChange | ||
})} |
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.
@SgtPooki was this updated?
"emitDeclarationOnly": true, | ||
"declaration": true, | ||
"moduleResolution": "nodenext", | ||
"noImplicitAny": false |
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 adding tsconfig.json
and we can fix this when we have a better handle of things.
@lidel I think the default flush interval is good enough for now, we can revisit this later if needed.
for now I think we can merge this and release as is. |
Agreed with @whizzzkid. Metrics are only sent (currently) when interacting with the extension (enabling/disabling, viewing different pages), so battery use should not be a concern. |
Things implemented:
Things to do