newrelic / k8s-agents-operator

Apache License 2.0
5 stars 4 forks source link

feat(php): add agent installation logic to operator #79

Closed bduranleau-nr closed 1 week ago

bduranleau-nr commented 1 month ago

Description

Adds support for the PHP Agent Operator.

For PHP, we need to emulate some of the aspects of the typical newrelic-install.sh script that the base PHP agent relies on in order to avoid having to inject commands into the application container itself. This logic requires the addition of an annotation (unique to PHP) that requires the user to define the PHP version of the application they intend to instrument. The installation logic will be handled in the initContainer itself, installing the appropriate agent and daemon artifacts, configuration file, and log directories in the shared volume /newrelic-instrumentation. When the application pod starts up, the PHP_INI_SCAN_DIR variable will be injected from the operator into the application container which will instruct the PHP binary on the customer system to search for the INI in the shared volume created by the initContainer, allowing for instrumentation.

Type of change

Checklist:

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 47.43%. Comparing base (dbd7f5a) to head (2c0549a). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #79 +/- ## ======================================= Coverage 47.43% 47.43% ======================================= Files 13 13 Lines 976 976 ======================================= Hits 463 463 Misses 448 448 Partials 65 65 ```

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