Skip to content
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

Add fragment breadcrumb data source #491

Merged
merged 1 commit into from
Mar 7, 2024
Merged

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Mar 4, 2024

Goal

Implements the capture of fragment breadcrumbs via the DataSource interface which allows them to be sent as OTel spans in the session payload. It's important to note this does not alter the session payload yet. The LegacyFragmentBreadcrumbDataSource will continue to add directly to the payload.

A future PR will contain the changeset for enabling the new data capture mechanism. This uncouples work & allows us to merge more without blocking changes.

Testing

Added a unit test.

Copy link

codecov bot commented Mar 4, 2024

Codecov Report

Attention: Patch coverage is 76.56250% with 15 lines in your changes are missing coverage. Please review.

Project coverage is 79.29%. Comparing base (3371bc9) to head (3242f45).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #491      +/-   ##
==========================================
- Coverage   79.33%   79.29%   -0.04%     
==========================================
  Files         389      390       +1     
  Lines       10722    10752      +30     
  Branches     1594     1599       +5     
==========================================
+ Hits         8506     8526      +20     
- Misses       1577     1580       +3     
- Partials      639      646       +7     
Files Coverage Δ
...racesdk/capture/crumbs/EmbraceBreadcrumbService.kt 96.55% <100.00%> (ø)
...pture/crumbs/LegacyFragmentBreadcrumbDataSource.kt 85.71% <85.71%> (ø)
...sdk/capture/crumbs/FragmentBreadcrumbDataSource.kt 66.66% <64.28%> (-19.05%) ⬇️

... and 5 files with indirect coverage changes

@fractalwrench fractalwrench force-pushed the add-view-crumb-spans branch 2 times, most recently from e88aec2 to 6a61b7d Compare March 6, 2024 11:05
@fractalwrench fractalwrench marked this pull request as ready for review March 6, 2024 11:05
@fractalwrench fractalwrench requested a review from a team as a code owner March 6, 2024 11:05
Copy link
Contributor

@lucaslabari lucaslabari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


@Test
fun `end an unknown fragment`() {
dataSource.endFragment("my_fragment")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to validate that this returns false.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an extra assertion here

* by [RemoteConfig].
*/
private const val DEFAULT_VIEW_STACK_SIZE = 20
internal const val TYPE_NAME = "ux.view"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defining these in each data source is really calling out for a central repository now 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will address this in a separate PR

/**
* Captures fragment breadcrumbs.
*/
internal class LegacyFragmentBreadcrumbDataSource(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The functionality of the legacy services are validated by... the integration tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's existing test coverage yes. I think this one is covered by existing unit test coverage.

Copy link
Collaborator

@bidetofevil bidetofevil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fractalwrench fractalwrench merged commit dbc32b8 into master Mar 7, 2024
4 checks passed
@fractalwrench fractalwrench deleted the add-view-crumb-spans branch March 7, 2024 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants