-
Notifications
You must be signed in to change notification settings - Fork 320
Core telemetry migration #6423
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
Core telemetry migration #6423
Conversation
3afb1c4 to
076ed39
Compare
...src/main/java/com/mapbox/navigation/core/telemetry/events/NavigationAppUserTurnstileEvent.kt
Outdated
Show resolved
Hide resolved
...src/main/java/com/mapbox/navigation/core/telemetry/events/NavigationAppUserTurnstileEvent.kt
Outdated
Show resolved
Hide resolved
...tion-core/src/main/java/com/mapbox/navigation/core/telemetry/events/NavigationCancelEvent.kt
Outdated
Show resolved
Hide resolved
...avigation-core/src/test/java/com/mapbox/navigation/core/telemetry/events/EventsTestHelper.kt
Outdated
Show resolved
Hide resolved
...avigation-core/src/test/java/com/mapbox/navigation/core/telemetry/events/EventsTestHelper.kt
Show resolved
Hide resolved
libnavigation-metrics/src/main/java/com/mapbox/navigation/metrics/MapboxMetricsReporter.kt
Outdated
Show resolved
Hide resolved
libnavigation-metrics/src/main/java/com/mapbox/navigation/metrics/MapboxMetricsReporter.kt
Outdated
Show resolved
Hide resolved
libnavigation-metrics/src/main/java/com/mapbox/navigation/metrics/MapboxMetricsReporter.kt
Outdated
Show resolved
Hide resolved
libnavigation-metrics/src/main/java/com/mapbox/navigation/metrics/MapboxMetricsReporter.kt
Outdated
Show resolved
Hide resolved
libnavigation-metrics/src/main/java/com/mapbox/navigation/metrics/extensions/MetricEventEx.kt
Show resolved
Hide resolved
076ed39 to
c296c41
Compare
Codecov Report
@@ Coverage Diff @@
## main #6423 +/- ##
============================================
+ Coverage 69.42% 69.49% +0.06%
- Complexity 4653 4707 +54
============================================
Files 697 700 +3
Lines 27520 27703 +183
Branches 3205 3255 +50
============================================
+ Hits 19107 19251 +144
+ Misses 7169 7166 -3
- Partials 1244 1286 +42
|
libnavigation-metrics/src/test/java/com/mapbox/navigation/metrics/MapboxMetricsReporterTest.kt
Outdated
Show resolved
Hide resolved
libnavigation-metrics/src/test/java/com/mapbox/navigation/metrics/MapboxMetricsReporterTest.kt
Outdated
Show resolved
Hide resolved
libnavigation-metrics/src/main/java/com/mapbox/navigation/metrics/MapboxMetricsReporter.kt
Show resolved
Hide resolved
libnavigation-metrics/src/main/java/com/mapbox/navigation/metrics/MapboxMetricsReporter.kt
Outdated
Show resolved
Hide resolved
libnavigation-metrics/src/main/java/com/mapbox/navigation/metrics/MapboxMetricsReporter.kt
Outdated
Show resolved
Hide resolved
...on-core/src/main/java/com/mapbox/navigation/core/telemetry/events/CoreTelemetryEventUtils.kt
Outdated
Show resolved
Hide resolved
...on-core/src/main/java/com/mapbox/navigation/core/telemetry/events/CoreTelemetryEventUtils.kt
Outdated
Show resolved
Hide resolved
...on-core/src/main/java/com/mapbox/navigation/core/telemetry/events/CoreTelemetryEventUtils.kt
Outdated
Show resolved
Hide resolved
...rics/src/main/java/com/mapbox/navigation/metrics/internal/event/AppUserTurnstileInterface.kt
Outdated
Show resolved
Hide resolved
| mapboxSdkDirectionsModels : "com.mapbox.mapboxsdk:mapbox-sdk-directions-models:${version.mapboxSdkServices}", | ||
| mapboxSdkRefreshModels : "com.mapbox.mapboxsdk:mapbox-sdk-directions-refresh-models:${version.mapboxSdkServices}", | ||
| mapboxEvents : "com.mapbox.mapboxsdk:mapbox-android-telemetry:${version.mapboxEvents}", | ||
| mapboxCore : "com.mapbox.mapboxsdk:mapbox-android-core:${version.mapboxCore}", |
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 can also be removed, doesn't it?
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 like we can, let me check
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 cannot, following classes are part of mapbox-android-core:
com.mapbox.android.core.location.LocationEngine;com.mapbox.android.core.location.LocationEngineRequest
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.
Weren't we planning to reintroduce this same classes under the same packages but directly from the Common SDK @tarigo @tatiana-yan?
In the current situation, we'd still need to maintain https://github.com/mapbox/mapbox-events-android/.
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 have com.mapbox.common.location.compat.LocationEngine, com.mapbox.common.location.compat.LocationEngineRequest
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 see https://github.com/mapbox/mapbox-sdk-common/issues/2807 is still open (I can't find corresponding JIRA ticket).
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 means that Nav SDK cannot drop the dependency on MME (at least the location part) because LocationEngine and LocationEngineRequest are part of our public API.
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.
Let's discuss this separately, it doesn't block 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.
For the external customers there is a plan to replace it by renaming Common's LocationEngine compat, you can keep core dependency because it's a public API but migrate to compat - it would be great to test it, but from the next release - there are some issues to address.
Maps SDK has already adopted it.
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.
ref CORESDK-465
libnavigation-base/src/main/java/com/mapbox/navigation/base/metrics/MetricEvent.kt
Outdated
Show resolved
Hide resolved
libnavigation-core/src/main/java/com/mapbox/navigation/core/telemetry/events/NavigationEvent.kt
Show resolved
Hide resolved
...tion-core/src/main/java/com/mapbox/navigation/core/telemetry/events/NavigationCancelEvent.kt
Show resolved
Hide resolved
libnavigation-metrics/src/main/java/com/mapbox/navigation/metrics/MapboxMetricsReporter.kt
Outdated
Show resolved
Hide resolved
libnavigation-metrics/src/main/java/com/mapbox/navigation/metrics/MapboxMetricsReporter.kt
Show resolved
Hide resolved
libnavigation-metrics/src/main/java/com/mapbox/navigation/metrics/MapboxMetricsReporter.kt
Outdated
Show resolved
Hide resolved
libnavigation-metrics/src/main/java/com/mapbox/navigation/metrics/MapboxMetricsReporter.kt
Outdated
Show resolved
Hide resolved
|
|
||
| /** | ||
| * Disables metrics reporting and ends [mapboxTelemetry] session. | ||
| * Disables metrics reporting and ends [EventsServiceInterface] and [TelemetryService] session. |
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.
Current implementation does not stop EventsService and TelemetryService.
What should this method do? If it must stop interaction and location events sending (for the entire application and all Mapbox SDKs we have in the application) we need to setEventsCollectionState(false) here.
If it should not stop events collection we need to remove Disables metrics reporting and ends [EventsServiceInterface] and [TelemetryService] session. from method description.
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 need to setEventsCollectionState(false) here.
@tatiana-yan then it stops collecting metrics from every single SDK (nav, maps, search), right? It's not fit for the current method, let's change the description
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.
Right, it will stop all except turnstiles for all SDKs. if you want to stop navigation events only, you can set some internal flag to ignore events sending
And is there some use-case when we need to stop collecting navigation events but not maps/search/locations? In that case, user should have independent settings to opt-out from maps/nav/search which looks unlikely.
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'm not sure that any customers use this API, but since it's public we should respect it. I'll add internal falgs
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, we're not recommending using this API at all. To align the API I'll add internal flags 👍
And is there some use-case when we need to stop collecting navigation events but not maps/search/locations?
don't think this must be done via MapboxReporter API
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.
Capturing from a chat, @RingerJK to cut a ticket to discuss our recommendations on how developers/end-users should opt-out of telemetry collection (since TelemetryUtils#setEventsCollectionState is documented as internal). Not a blocker for this PR but has to be resolved before the changes go stable.
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.
ref CORESDK-1357
libnavigation-base/src/main/java/com/mapbox/navigation/base/metrics/MetricsReporter.kt
Show resolved
Hide resolved
...src/main/java/com/mapbox/navigation/core/telemetry/events/NavigationAppUserTurnstileEvent.kt
Show resolved
Hide resolved
| ioJobController.scope.launch { | ||
| metricsObserver?.onMetricUpdated(metricEvent.metricName, metricEvent.toJson(gson)) | ||
| } |
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 on a worker thread? I found the original PR in #2237 but it has no context. Documentation for the interface doesn't mention that it'll be called from a worker.
Not a blocker here, just something I noticed to discuss separately.
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.
ref NAVAND-730
libnavigation-metrics/src/main/java/com/mapbox/navigation/metrics/MapboxMetricsReporter.kt
Outdated
Show resolved
Hide resolved
VysotskiVadim
left a comment
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 don't see any critical issues in code, but I can't do a proper review as I haven't undrstood yet how telemetry works 🙂
LukasPaczos
left a comment
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 with a note that there are some open threads that need to be addressed before these changes go stable.
Description
migrating to
core telemetryblocked by #6422