@@ -33,6 +33,8 @@ public static class StoredConfig {
3333 final String processTags ;
3434 final String runtimeId ;
3535 final String reportUUID ;
36+ final boolean agentless ;
37+ final boolean sendToErrorTracking ;
3638
3739 StoredConfig (
3840 String reportUUID ,
@@ -41,14 +43,18 @@ public static class StoredConfig {
4143 String version ,
4244 String tags ,
4345 String processTags ,
44- String runtimeId ) {
46+ String runtimeId ,
47+ boolean agentless ,
48+ boolean sendToErrorTracking ) {
4549 this .service = service ;
4650 this .env = env ;
4751 this .version = version ;
4852 this .tags = tags ;
4953 this .processTags = processTags ;
5054 this .runtimeId = runtimeId ;
5155 this .reportUUID = reportUUID ;
56+ this .agentless = agentless ;
57+ this .sendToErrorTracking = sendToErrorTracking ;
5258 }
5359
5460 public static class Builder {
@@ -59,6 +65,8 @@ public static class Builder {
5965 String processTags ;
6066 String runtimeId ;
6167 String reportUUID ;
68+ boolean agentless ;
69+ boolean sendToErrorTracking ;
6270
6371 public Builder (Config config ) {
6472 // get sane defaults
@@ -67,6 +75,8 @@ public Builder(Config config) {
6775 this .version = config .getVersion ();
6876 this .runtimeId = config .getRuntimeId ();
6977 this .reportUUID = RandomUtils .randomUUID ().toString ();
78+ this .agentless = config .isCrashTrackingAgentless ();
79+ this .sendToErrorTracking = config .isCrashTrackingErrorsIntakeEnabled ();
7080 }
7181
7282 public Builder service (String service ) {
@@ -99,14 +109,33 @@ public Builder runtimeId(String runtimeId) {
99109 return this ;
100110 }
101111
112+ public Builder sendToErrorTracking (boolean sendToErrorTracking ) {
113+ this .sendToErrorTracking = sendToErrorTracking ;
114+ return this ;
115+ }
116+
117+ public Builder agentless (boolean agentless ) {
118+ this .agentless = agentless ;
119+ return this ;
120+ }
121+
102122 // @VisibleForTesting
103123 Builder reportUUID (String reportUUID ) {
104124 this .reportUUID = reportUUID ;
105125 return this ;
106126 }
107127
108128 public StoredConfig build () {
109- return new StoredConfig (reportUUID , service , env , version , tags , processTags , runtimeId );
129+ return new StoredConfig (
130+ reportUUID ,
131+ service ,
132+ env ,
133+ version ,
134+ tags ,
135+ processTags ,
136+ runtimeId ,
137+ agentless ,
138+ sendToErrorTracking );
110139 }
111140 }
112141 }
@@ -163,6 +192,8 @@ static void writeConfigToFile(Config config, Path cfgPath, String... additionalE
163192 writeEntry (bw , "process_tags" , ProcessTags .getTagsForSerialization ());
164193 writeEntry (bw , "runtime_id" , wellKnownTags .getRuntimeId ());
165194 writeEntry (bw , "java_home" , SystemProperties .get ("java.home" ));
195+ writeEntry (bw , "agentless" , Boolean .toString (config .isCrashTrackingAgentless ()));
196+ writeEntry (bw , "upload_to_et" , Boolean .toString (config .isCrashTrackingErrorsIntakeEnabled ()));
166197
167198 Runtime .getRuntime ()
168199 .addShutdownHook (
@@ -220,6 +251,12 @@ public static StoredConfig readConfig(Config config, Path scriptPath) {
220251 case "runtime_id" :
221252 cfgBuilder .runtimeId (value );
222253 break ;
254+ case "agentless" :
255+ cfgBuilder .agentless (Boolean .parseBoolean (value ));
256+ break ;
257+ case "upload_to_et" :
258+ cfgBuilder .sendToErrorTracking (Boolean .parseBoolean (value ));
259+ break ;
223260 default :
224261 // ignore
225262 break ;
0 commit comments