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

Agent support for read-only file systems #2045

Conversation

chynesNR
Copy link
Member

@chynesNR chynesNR commented Nov 9, 2023

This adds support on the Agent side to better handle read-only file systems:

  • A config setting (log:enabled) and environment variable (NEW_RELIC_LOG_ENABLED) to disable logging completely. No file writes will be attempted.
  • If file logging is enabled but fails to write a file, disable logging.
  • An environment variable to use console logging (NEW_RELIC_LOG_CONSOLE) -- there is already an existing config setting.
  • Supportability metrics for when logging is disabled by the user or by error.

* New option to disable logging
* Env var for console logging
* Supportability metric if logging fails
@codecov-commenter
Copy link

codecov-commenter commented Nov 9, 2023

Codecov Report

❗ No coverage uploaded for pull request base (feature/read-only-file-systems@591e368). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                        Coverage Diff                        @@
##             feature/read-only-file-systems    #2045   +/-   ##
=================================================================
  Coverage                                  ?   80.25%           
=================================================================
  Files                                     ?      403           
  Lines                                     ?    24880           
  Branches                                  ?     2996           
=================================================================
  Hits                                      ?    19967           
  Misses                                    ?     4133           
  Partials                                  ?      780           

@chynesNR chynesNR merged commit 822c541 into feature/read-only-file-systems Nov 9, 2023
71 of 73 checks passed
@chynesNR chynesNR deleted the featurework/agent-disable-logging-option branch November 9, 2023 23:34
nr-ahemsath added a commit that referenced this pull request Nov 21, 2023
…ms. (#2085)

* Don't bail if log file can't be created

* Support logging to stdout in the Profiler (#2025)

* Agent support for read-only file systems (#2045)

* New option to disable logging
* Env var for console logging
* Supportability metric if logging fails
* Don't allow audit logging if logging is disabled

* chore: Update Profiler NuGet Package Reference to v10.18.0.15. (#2077)

Co-authored-by: nr-ahemsath <[email protected]>

* Add integration tests for file logging disabled and console logging enabled (#2076)

* Checkpoint in order to switch branches

* Refactored AgentLogFile

Moved AgentLogFile to the fixtures instead of the applications

* Shorten some names

* Fix bug caused by Visual Studio autocorrect

* WIP

* Working tests for logging disabled

* Working console logging tests

* Fix nuget package warnings-as-errors

* Fix GuidConfigurationTests

EndsWith() fails if the profiler logs the version, e.g. New Relic .NET CoreCLR Agent v10.18.0.26.  Use Contains() instead

* Fix integration test build error

* PR feedback

---------

Co-authored-by: chynesNR <[email protected]>
Co-authored-by: Chris Hynes <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: nr-ahemsath <[email protected]>
Co-authored-by: Marty Tippin <[email protected]>
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.

5 participants