@@ -30,8 +30,15 @@ const getDefaultConfig = (isDistributable: boolean): ApmAgentConfig => {
3030 return {
3131 active : false ,
3232 globalLabels : { } ,
33+ // Do not use a centralized controlled config
34+ centralConfig : false ,
35+ // Capture all exceptions that are not caught
36+ logUncaughtExceptions : true ,
37+ // Can be performance intensive, disabling by default
38+ breakdownMetrics : false ,
3339 } ;
3440 }
41+
3542 return {
3643 active : false ,
3744 serverUrl : 'https://f1542b814f674090afd914960583265f.apm.us-central1.gcp.cloud.es.io:443' ,
@@ -60,14 +67,14 @@ export class ApmConfiguration {
6067 ) {
6168 // eslint-disable-next-line @typescript-eslint/no-var-requires
6269 const { version, build } = require ( join ( this . rootDir , 'package.json' ) ) ;
63- this . kibanaVersion = version . replace ( / \. / g , '_' ) ;
70+ this . kibanaVersion = version ;
6471 this . pkgBuild = build ;
6572 }
6673
6774 public getConfig ( serviceName : string ) : ApmAgentConfig {
6875 return {
6976 ...this . getBaseConfig ( ) ,
70- serviceName : ` ${ serviceName } - ${ this . kibanaVersion } ` ,
77+ serviceName,
7178 } ;
7279 }
7380
@@ -76,7 +83,8 @@ export class ApmConfiguration {
7683 const apmConfig = merge (
7784 getDefaultConfig ( this . isDistributable ) ,
7885 this . getConfigFromKibanaConfig ( ) ,
79- this . getDevConfig ( )
86+ this . getDevConfig ( ) ,
87+ this . getDistConfig ( )
8088 ) ;
8189
8290 const rev = this . getGitRev ( ) ;
@@ -88,6 +96,8 @@ export class ApmConfiguration {
8896 if ( uuid ) {
8997 apmConfig . globalLabels . kibana_uuid = uuid ;
9098 }
99+
100+ apmConfig . serviceVersion = this . kibanaVersion ;
91101 this . baseConfig = apmConfig ;
92102 }
93103
@@ -123,6 +133,19 @@ export class ApmConfiguration {
123133 }
124134 }
125135
136+ /** Config keys that cannot be overridden in production builds */
137+ private getDistConfig ( ) : ApmAgentConfig {
138+ if ( ! this . isDistributable ) {
139+ return { } ;
140+ }
141+
142+ return {
143+ // Headers & body may contain sensitive info
144+ captureHeaders : false ,
145+ captureBody : 'off' ,
146+ } ;
147+ }
148+
126149 private getGitRev ( ) {
127150 if ( this . isDistributable ) {
128151 return this . pkgBuild . sha ;
0 commit comments