2626import merge from 'deepmerge' ;
2727import { createOption } from 'commander' ;
2828import { readConfig } from './config' ;
29+ import globToRegExp from 'glob-to-regexp' ;
2930import { getNetworkConditions , DEFAULT_THROTTLING_OPTIONS } from './helpers' ;
3031import type { CliArgs , RunOptions , ThrottlingOptions } from './common_types' ;
3132
@@ -42,7 +43,10 @@ export function normalizeOptions(cliArgs: CliArgs): RunOptions {
4243 const options : RunOptions = {
4344 ...cliArgs ,
4445 environment : process . env [ 'NODE_ENV' ] || 'development' ,
46+ monitorId : process . env [ 'MONITOR_ID' ] ,
47+ checkgroup : process . env [ 'CHECKGROUP' ] ,
4548 } ;
49+
4650 /**
4751 * Group all events that can be consumed by heartbeat and
4852 * eventually by the Synthetics UI.
@@ -55,6 +59,16 @@ export function normalizeOptions(cliArgs: CliArgs): RunOptions {
5559 options . quietExitCode = true ;
5660 }
5761
62+ if ( cliArgs . traceUrlPatterns ) {
63+ const urlPatterns = cliArgs . traceUrlPatterns . split ( ',' ) . map ( pattern => {
64+ return globToRegExp ( pattern ) ;
65+ } ) ;
66+
67+ options . apm = {
68+ traceUrlPatterns : urlPatterns ,
69+ } ;
70+ }
71+
5872 if ( cliArgs . capability ) {
5973 const supportedCapabilities = [
6074 'trace' ,
0 commit comments