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 AEI data source #493

Merged
merged 1 commit into from
Mar 7, 2024
Merged

Add AEI data source #493

merged 1 commit into from
Mar 7, 2024

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Mar 4, 2024

Goal

Implements the capture of AEI via the DataSource interface which allows them to be sent as OTel logs. It's important to note this does not alter any payloads yet. The existing ApplicationExitInfoService 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 unit test coverage.

@fractalwrench fractalwrench changed the base branch from master to log-refactors March 4, 2024 16:07
@fractalwrench fractalwrench force-pushed the add-aei-data-source branch 2 times, most recently from b67af1a to a29e3e6 Compare March 4, 2024 16:18
Copy link

codecov bot commented Mar 4, 2024

Codecov Report

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

Project coverage is 79.34%. Comparing base (4e21f52) to head (8201255).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #493      +/-   ##
==========================================
- Coverage   79.35%   79.34%   -0.01%     
==========================================
  Files         388      389       +1     
  Lines       10577    10722     +145     
  Branches     1573     1594      +21     
==========================================
+ Hits         8393     8507     +114     
- Misses       1548     1574      +26     
- Partials      636      641       +5     
Files Coverage Δ
...ndroid/embracesdk/capture/aei/AeiDataSourceImpl.kt 79.31% <79.31%> (ø)

... and 3 files with indirect coverage changes

@fractalwrench fractalwrench changed the title wip: add aei log data source Add AEI data source Mar 4, 2024
@fractalwrench fractalwrench force-pushed the log-refactors branch 2 times, most recently from d7883f3 to ada5d94 Compare March 5, 2024 08:51
Base automatically changed from log-refactors to master March 5, 2024 09:13
@fractalwrench fractalwrench force-pushed the add-aei-data-source branch 2 times, most recently from 71f866c to d209350 Compare March 6, 2024 11:24
@fractalwrench fractalwrench marked this pull request as ready for review March 6, 2024 11:24
@fractalwrench fractalwrench requested a review from a team as a code owner March 6, 2024 11:24
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

@RequiresApi(VERSION_CODES.R)
internal class AeiDataSourceImpl(
private val backgroundWorker: BackgroundWorker,
private val configService: ConfigService,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought we had wanted to make the orchestrator push config info to the data sources rather than have them directly depend on them. Is the current state due to how everything is hooked up to the legacy stuff right now, or will this be necessary going forward?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The orchestrator does control whether a feature is enabled/disabled but that's it right now.

There isn't any such approach for config that alters limits/how data is captured. IMO just passing a ConfigService or even a *Behavior class is probably the simplest option

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think i was more worried about how the dependency graph would work but if every data capture service is at a higher level then that's OK.

I think I would prefer a Behaviour as we can eventually abstract that away if we want to set configuration for data sources that may not have access to the config service - even in a separate module in the SDK

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.

One comment about the config service usage, but looks good to me in general.

@fractalwrench fractalwrench merged commit 3371bc9 into master Mar 7, 2024
4 checks passed
@fractalwrench fractalwrench deleted the add-aei-data-source branch March 7, 2024 10:15
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.

3 participants