newrelic / newrelic-android-agent

SDK to enable instrumentation of Android mobile apps in New Relic
Apache License 2.0
14 stars 14 forks source link

[NR-178365] Enable Log forwarding to Log Ingest #177

Closed cthomas-newrelic closed 9 months ago

cthomas-newrelic commented 9 months ago

[NR-178365] Add log forwarding class

LogForwarder is derived fromPayload sender, which is a component of the PayloadController model and understands Vortex response codes. Unlike a PayloadSender, it wraps a file as its data store.

[NR-223001] Add suggested supportability names to metrics namespace

Metric Root: "Supportability/AgentHealth/LogReporting" with the following sub-keys:

"Init" - LogReporting feature has started "UploadTime" - Duration of upload requests to ingest "UploadTimeOut" - Count of failed upload attempts due to connect tmeout "UploadThrottled" - Count of uploads not accepted by ingest due to API limits "FailedUpload" - Count of upload attempts that fail for otehr reasons "Expired" - Log data that is removed from use device due to expiration "Removed/Rejected" - Count of log records that are rejects by the agent's LogReporter log validation "Size/Uncompressed" - the size of the log data payload

[NR-170090] Store log date files in the app cache directory

LogReports are stored in the apps cache directory, rather than the persistent files directory. The o/s may remove the oldest files when storage runs low, offloading some of the maintenance work from the reporter, but potentially resulting in unreported log file deletions.

[NR-170090] Experimental: set minimum size on file archives

For MVP evaluation : Prevents sending small amounts of data to log ingest every minute. Translates to fewer API calls, but does contradict the goal of getting data into NR asap.

Threshold value to Vortex payload limit div 4.

codecov[bot] commented 9 months ago

Codecov Report

Attention: 21 lines in your changes are missing coverage. Please review.

Comparison is base (d918d4b) 54.89% compared to head (41cdd58) 55.06%. Report is 1 commits behind head on epic/nr92548-mobileLoggingSupport.

Files Patch % Lines
...om/newrelic/agent/android/logging/LogReporter.java 52.17% 11 Missing :warning:
...m/newrelic/agent/android/logging/LogForwarder.java 82.35% 9 Missing :warning:
.../newrelic/agent/android/payload/PayloadSender.java 80.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## epic/nr92548-mobileLoggingSupport #177 +/- ## ======================================================================= + Coverage 54.89% 55.06% +0.16% - Complexity 3094 3111 +17 ======================================================================= Files 315 315 Lines 15929 15983 +54 Branches 1712 1715 +3 ======================================================================= + Hits 8745 8801 +56 + Misses 6289 6283 -6 - Partials 895 899 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

cthomas-newrelic commented 9 months ago

@ndesai-newrelic Still has a failing test that doesn't fail for me locally. Could you pull the branch and run the build (with check)?