Advanced configuration
revd
script is used to either compile individual groups of files or to compile from a revdebug.json
configuration file that can be present in the topmost directory of the project. revdebug.json
can contain only options, options, and files for the project or multiple hierarchical subprojects with their own options each of which can be instrumented individually. Command line configuration options can override options in revdebug.json
if you wish to build a subproject with different options than are specified in revdebug.json
.
revd
manages the source files you are instrumenting by copying the clean originals to a parallel directory tree under revdsrc/ at the top-level directory of the project and replacing the original files with instrumented versions. This is done so that the original project does not have to be aware of or changed for RevDeBug.
The top-level directory for the project is considered to be the first at or above the current level which contains a package.json
or revdebug.json
file. All operations are executed with respect to this directory, even if you run revd
in a subdirectory.
For example, the following will instrument all the Javascript files in the current directory:
For all Javascript files in all subdirectories as well:
Note: The quotes are needed to prevent the shell from expanding the wildcards incorrectly on its own. Use quotes around wildcards whenever there is doubt.
If the previous commands are not run in the top project directory then an appropriate path configuration value will be set to make sure the compilation is relative to the top.
If project files are defined in revdebug.json
then the project can be instrumented by doing: revd
And if multiple projects or subprojects are defined then they may be instrumented as follows:
Or for a subproject of .project1:
Project names always start with a dot character and the alias for the top-level project is just a dot.
Compiler
In addition to being able to specify all project options on the command line, there are options that can only be passed on the command line in order to tell the compiler what to do or to control behavior, they are:
Actions: | |
| Print help info. (short: |
| Print the version. (short: |
| Do source map postprocessing after any tools farther down the chain have been run (typescript, webpack, etc...). |
| Restore original uninstrumented source files for given config or specified directly. |
| Restore ALL original source files in managed source directory and remove directory. |
| Dump processed configuration which would be used (don't actually do anything). |
Behavior: | |
| Add argument for substitution in revdebug.json, |
| Force certain actions even if errors would otherwise prevent it. (short: |
| Skip certain actions. (short: |
| Maximum number of threads to use, Node 12+. (default: all logical CPUs) |
| Show all error messages with stack traces. (short: |
| Compile-time record server override address to send metadata. (default: from |
| Compile-time record server override port to send metadata. (default: from |
revdebug.json file structure
The structure of the revdebug.json configuration file may be as follows (please note the names "option1", "option2" etc... used are just placeholders for the actual option names listed farther down):
This is for a simple configuration that only specifies options, files would be specified on the command line. For a configuration that specifies what files to instrument:
You can even specify multiple hierarchical nested projects with their own options as:
List of options
The actual options are as follows:
Information: | |
Network: | |
| The hostname or IP address as a string of the record server. |
| The port of the record server, this must be a number. |
| The port of the record server for |
| Use secure connections. |
| Timeout for connection attempt in milliseconds. |
| Amount of time to wait before attempting reconnect after disconnect or failed connect in milliseconds. |
Project: | |
| Solution name. If |
| Application name. If |
| The version string. If |
| The release string, normally git commit hash (retrieved automatically if not provided). |
| RevDeBug authorization token. |
Application Performance Monitoring: | |
| Enable or disable Application Performance Monitoring for project, can be |
| Hostname of APM OAP server if different from record server host, the default is same as |
| Port of APM OAP server, the default is 11800. ("node" target only, ignored for "web") |
| Single or list of HTTP status codes to exclude from generating error recordings on incoming requests. Since normally only codes between 400 and 599 generate error traces, it only really makes sense to exclude codes in this range. Status code 0 is a special code which represents errors which can not be determined at the time of filtering. This may represent a 500 internal server error or some other kind of error where the code was not available. For this reason this code was left apart to leave more granular control. |
| Single or list of HTTP status codes to exclude from generating error recordings on outgoing requests. |
| Agent service name. |
| Comma separated list of modules for which to disable APM. |
| Rough maximum number of spans per second limiter, anything over this is not reported. |
| When a cold start is detected append "" to the endpoint name. |
| Comma separated list of wildcard endpoint names to exclude from recording. |
| Comma separated list of endpoint suffixes to exclude from APM recording, the default is ".jpg,.jpeg,.js,.css,.png,.bmp,.gif,.ico,.mp3,.mp4,.html,.svg". |
| Comma-delimited list of http metods to ignore (GET, POST, HEAD, OPTIONS, etc...). |
Node APM: | |
| Record potentially large sql parameters to queries, can be |
| Maximum string length of sql parameters string to send. |
| Record potentially large mongodb parameters to queries, can be |
| Maximum string length of mongodb parameters string to send. |
Browser APM: | ("web" target only, ignored for "node") |
| Determines whether page open events should be registered as a separate trace segment. Default value is |
| Collect FMP (first meaningful paint) data of the first screen, can be |
| Monitor the page hashchange event and report PV, which is suitable for single page application scenarios, can be |
| Support sending of performance data automatically, can be |
| Javascript error monitoring, can be |
| API error monitoring, can be |
| Resource error monitoring, can be |
| Vue error monitoring, otherwise will be reported as js error if that is enabled. Can be |
Browser screen recording: | ("web" target only, ignored for "node") |
| Enable or disable screen recording, can be |
| Minimum number of seconds of screen recording for crash reports. |
Compile: | |
| The type of application you are instrumenting, |
| |
| How to parse |
| How the RevDeBug runtime is incorporated into the project, can be |
| The default instrumentation setting for the project. Normally a whole project will be instrumented except for any functions which may opt out (for performance reasons or whatever). This option allows you to start with instrumentation turned off globally and allow only certain functions or methods to opt-in to being recorded. The possible options are |
| Blacklist of lexical function name calls to exclude from instrumentation because they have a special meaning to a tool farther down the chain, e.g. "require.context". Filename style |
| Include original uninstrumented function source code to return when a function |
| Babel legacy decorator parse mode. Use this if you are using decorators on function parameters (like in Angular for example). |
| Specifies whether JSX parsing is to be used for ALL files or only |
| Specifies whether Typescript parsing is to be used for ALL files instead of only |
Runtime: | |
| The record mode you want this project to start in, options are |
| Console logging level, options are "critical", "error", "warn", "info" or "debug". |
| Log timestamps or not. |
| Normally mutable objects and arrays are stringified for serialization at the point of record. That can be slow so this option allows you to defer stringification to the point of a crash block send (at which point the object contents may have changed), or turn it off altogether. The default normal stringification is |
| Maximum concurrent number of snapshots and exception recordings backlog for send, excess will be dropped, 0 = no limit. |
| The probability (ranging from 0.0 to 1.0) of sending a recording for statistical throttling is set to a default value of 1 (always). |
| Comma separated list of Error names not to send recordings for, including non-Error to specify thrown objects which do not derive from the Error class. The error names are checked respecting class hierarchy so that ignoring a base error class will ignore all derived error classes. For an extreme example, ignoring Error also ignores ReferenceError, TypeError, etc... Currently this is only honored for the APM span where the error occurs. If an error is ignored, no indication is propagated back upstream to store recordings of their own (which normally would be), but if the resulting returned status indicates an error (for example http status code 400+) the upstream component may store a recording anyway due to the general error status. |
| Desired maximum length of crash recordings or snapshots. |
| Enable code isolation blocks for asynchronous code allowing only a certain branch to be recorded irrespective of any other async code being executed in parallel. Only works for |
| Whether to show Symbol keys in properties or not, |
| Whether to show properties of non-Object objects like class instances. By default this is |
| Whether to show properties of functions, |
| Whether to show details of some standard Javascript objects like Date, Set, Map, ArrayBuffer, SharedArrayBuffer and DataView. |
| Whether to show details of typed arrays or just the length. |
| Assign and show globally unique object numeric identifiers on objects which are not |
| Maximum recursion depth for object stringification, has same meaning as "console.dir(obj, {depth: value})". Default is 1 which is 1 less than "console.log()", so "{name: {name: [Object]}}". |
| The maximum(ish) length for stringification of objects or arrays, this value is not strictly obeyed but rather serves as a guide. An actual object stringification may even get to about 2x this length in extreme circumstances. This must be a number. |
Files / Paths: | * Note: These are not inherited from parent or are inherited with path append. |
| This allows you to specify a common path prefix for any files or excludes you specify for the current project or subproject. This value will also be excluded from any |
| This is where you specify the files to be instrumented for this project. If a project has |
| This is specified the same as |
| If the |
| For a |
| Path to the final output of the toolchain for postprocessing. Serves the same purpose for |
| Wildcard specifiers of final output files for postprocessing. |
| For a |
| For a |
| This is a string which is not transformed in any way that is inserted right before the RevDeBug runtime name in any |
| Special case field which allows you to suppress copying the RevDeBug runtime to a directory where the compiler thinks it should go. Intended for configurations where you will be loading the runtime from a custom location. |
| Global wildcard specifiers of files and directories to completely exclude from all processing in all subprojects. (e.g. "**/node_modules/**"). |
All these options can be specified on the command line to override any options in the revdebug.json
file, so for example to set host
on the command line specify --host address
. Options that are boolean such as --apm
or --sourceMap
can be specified on the command line as such to indicate true or --noapm
and --nosourceMap
to indicate false, --apm=true
and --apm=false
are also accepted.
Last updated