getappmap / appmap-node

AppMap client agent for Node.js
Other
9 stars 4 forks source link

fix: Check APPMAP_RECORDER_PROCESS_ALWAYS truthy value #168

Closed zermelo-wisen closed 1 month ago

zermelo-wisen commented 1 month ago

This PR updates the interpretation of the APPMAP_RECORDER_PROCESS_ALWAYS environment variable so that process recording remains active only if the variable is set to a truthy value (one of ‘true’, ‘1’, ‘on’, ‘yes’).

Previously, the existence of the APPMAP_RECORDER_PROCESS_ALWAYS environment variable, regardless of its value, was interpreted as true.


Behavior regarding this environment variable is as follows:

Default Behavior (When APPMAP_RECORDER_PROCESS_ALWAYS is not set to a truthy value)

When the APPMAP_RECORDER_PROCESS_ALWAYS environment variable is not set to one of the truthy values (true, 1, on, yes), appmap-node behaves as follows:

appmap-node initially creates a process recording AppMap for the entire process. If appmap-node detects a request, a test or a remote recording, it abandons the process recording. Instead, for example, if requests are detected, it creates individual request recordings for each detected request. In this case, you end up with multiple request recordings (one per request) and no process recording. Otherwise there will be just one process recording AppMap.

Behavior with APPMAP_RECORDER_PROCESS_ALWAYS set to a truthy Value

When APPMAP_RECORDER_PROCESS_ALWAYS is set to one of the truthy values (true, 1, on, yes):

appmap-node continues to record the entire process even when a request, a test or a remote recording is detected. As a result, for example, if requests are detected, you get one process recording AppMap that covers the entire process and multiple request recording AppMaps, with one AppMap for each request.

petecheslock commented 1 month ago

Hi @zermelo-wisen - I did a quick test of this branch to see if it was working based on my expectations, but I still seem to get a process recording no matter what the value being set as. Testing with the mern-ecommerce application.

Basically no matter the value of that environment variable i still seem to have process recordings getting created. But perhaps i'm not fully understanding the scope of this change.

Here is a loom where i explain more and show what i'm seeing. https://www.loom.com/share/237004ab6afd4988b21fd134823b0c0f?sid=36c49bdd-ff56-4f22-814a-143f0cd774ac

appland-release commented 1 month ago

:tada: This PR is included in version 2.24.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: