@@ -126,17 +126,15 @@ private static void isValidRegex(String value) throws FriendlyException {
126126 try {
127127 Pattern .compile (value );
128128 } catch (PatternSyntaxException exception ) {
129- throw new FriendlyException ("ApplicationInsights Java Agent failed to start." ,
130- "Telemetry processor configuration does not have valid regex:" + value ,
129+ throw new FriendlyException ("Telemetry processor configuration does not have valid regex:" + value ,
131130 "Please provide a valid regex in the telemetry processors configuration. " +
132131 "Learn more about telemetry processors here: https://go.microsoft.com/fwlink/?linkid=2151557" );
133132 }
134133 }
135134
136135 public void validate () throws FriendlyException {
137136 if (type == null ) {
138- throw new FriendlyException ("ApplicationInsights Java Agent failed to start." ,
139- "Telemetry processor configuration has a processor with no type!!!" ,
137+ throw new FriendlyException ("Telemetry processor configuration has a processor with no type!!!" ,
140138 "Please provide a type in the telemetry processors configuration. " +
141139 "Learn more about telemetry processors here: https://go.microsoft.com/fwlink/?linkid=2151557" );
142140 }
@@ -153,8 +151,7 @@ public void validate() throws FriendlyException {
153151 public void validateAttributeProcessorConfig () throws FriendlyException {
154152 if (type == ProcessorType .attribute ) {
155153 if (actions == null || actions .isEmpty ()) {
156- throw new FriendlyException ("ApplicationInsights Java Agent failed to start." ,
157- "Telemetry processor configuration has invalid attribute processor configuration with empty actions!!!" ,
154+ throw new FriendlyException ("Telemetry processor configuration has invalid attribute processor configuration with empty actions!!!" ,
158155 "Please provide at least one action in the attribute processors configuration. " +
159156 "Learn more about telemetry processors here: https://go.microsoft.com/fwlink/?linkid=2151557" );
160157 }
@@ -167,8 +164,7 @@ public void validateAttributeProcessorConfig() throws FriendlyException {
167164 public void validateLogOrSpanProcessorConfig () throws FriendlyException {
168165 if (type == ProcessorType .log || type == ProcessorType .span ) {
169166 if (name == null ) {
170- throw new FriendlyException ("ApplicationInsights Java Agent failed to start." ,
171- "Telemetry processor configuration has invalid span/log processor configuration with empty name object!!!" ,
167+ throw new FriendlyException ("Telemetry processor configuration has invalid span/log processor configuration with empty name object!!!" ,
172168 "Please provide name in the span/log processor configuration. " +
173169 "Learn more about telemetry processors here: https://go.microsoft.com/fwlink/?linkid=2151557" );
174170 }
@@ -184,8 +180,7 @@ public static class NameConfig {
184180
185181 public void validate () throws FriendlyException {
186182 if (fromAttributes == null && toAttributes == null ) {
187- throw new FriendlyException ("ApplicationInsights Java Agent failed to start." ,
188- "Telemetry processor configuration has invalid name object with no fromAttributes or no toAttributes!!!" ,
183+ throw new FriendlyException ("Telemetry processor configuration has invalid name object with no fromAttributes or no toAttributes!!!" ,
189184 "Please provide at least one of fromAttributes or toAttributes in the processor configuration. " +
190185 "Learn more about telemetry processors here: https://go.microsoft.com/fwlink/?linkid=2151557" );
191186 }
@@ -198,8 +193,7 @@ public static class ToAttributeConfig {
198193
199194 public void validate () throws FriendlyException {
200195 if (rules ==null || rules .isEmpty ()) {
201- throw new FriendlyException ("ApplicationInsights Java Agent failed to start." ,
202- "Telemetry processor configuration has invalid toAttribute value with no rules!!!" ,
196+ throw new FriendlyException ("Telemetry processor configuration has invalid toAttribute value with no rules!!!" ,
203197 "Please provide at least one rule under the toAttribute section of processor configuration. " +
204198 "Learn more about telemetry processors here: https://go.microsoft.com/fwlink/?linkid=2151557" );
205199 }
@@ -218,16 +212,14 @@ public static class ProcessorIncludeExclude {
218212
219213 public void validate (ProcessorType processorType ) throws FriendlyException {
220214 if (this .matchType == null ) {
221- throw new FriendlyException ("ApplicationInsights Java Agent failed to start." ,
222- "Telemetry processor configuration has invalid include/exclude value with no matchType!!!" ,
215+ throw new FriendlyException ("Telemetry processor configuration has invalid include/exclude value with no matchType!!!" ,
223216 "Please provide matchType under the include/exclude section of processor configuration. " +
224217 "Learn more about telemetry processors here: https://go.microsoft.com/fwlink/?linkid=2151557" );
225218 }
226219 if (this .attributes != null ) {
227220 for (ProcessorAttribute attribute : this .attributes ) {
228221 if (attribute .key == null || attribute .key .isEmpty ()) {
229- throw new FriendlyException ("ApplicationInsights Java Agent failed to start." ,
230- "Telemetry processor configuration has invalid include/exclude value with attribute which has empty key!!!" ,
222+ throw new FriendlyException ("Telemetry processor configuration has invalid include/exclude value with attribute which has empty key!!!" ,
231223 "Please provide valid key with value under the include/exclude's attribute section of processor configuration. " +
232224 "Learn more about telemetry processors here: https://go.microsoft.com/fwlink/?linkid=2151557" );
233225 }
@@ -248,8 +240,7 @@ public void validate (ProcessorType processorType) throws FriendlyException {
248240
249241 private void validAttributeProcessorIncludeExclude () throws FriendlyException {
250242 if (spanNames == null && attributes == null ) {
251- throw new FriendlyException ("ApplicationInsights Java Agent failed to start." ,
252- "Telemetry processor configuration has invalid include/exclude value with no spanNames or no attributes!!!" ,
243+ throw new FriendlyException ("Telemetry processor configuration has invalid include/exclude value with no spanNames or no attributes!!!" ,
253244 "Please provide at least one of spanNames or attributes under the include/exclude section of processor configuration. " +
254245 "Learn more about telemetry processors here: https://go.microsoft.com/fwlink/?linkid=2151557" );
255246 }
@@ -262,8 +253,7 @@ private void validAttributeProcessorIncludeExclude() throws FriendlyException {
262253
263254 private void validateLogProcessorIncludeExclude () throws FriendlyException {
264255 if (logNames == null && attributes == null ) {
265- throw new FriendlyException ("ApplicationInsights Java Agent failed to start." ,
266- "Telemetry processor configuration has invalid include/exclude value with no logNames or no attributes!!!" ,
256+ throw new FriendlyException ("Telemetry processor configuration has invalid include/exclude value with no logNames or no attributes!!!" ,
267257 "Please provide at least one of logNames or attributes under the include/exclude section of processor configuration. " +
268258 "Learn more about telemetry processors here: https://go.microsoft.com/fwlink/?linkid=2151557" );
269259 }
@@ -276,8 +266,7 @@ private void validateLogProcessorIncludeExclude() throws FriendlyException {
276266
277267 private void validateSpanProcessorIncludeExclude () throws FriendlyException {
278268 if (spanNames == null && attributes == null ) {
279- throw new FriendlyException ("ApplicationInsights Java Agent failed to start." ,
280- "Telemetry processor configuration has invalid include/exclude value with no spanNames or no attributes!!!" ,
269+ throw new FriendlyException ("Telemetry processor configuration has invalid include/exclude value with no spanNames or no attributes!!!" ,
281270 "Please provide at least one of spanNames or attributes under the include/exclude section of processor configuration. " +
282271 "Learn more about telemetry processors here: https://go.microsoft.com/fwlink/?linkid=2151557" );
283272 }
@@ -305,21 +294,18 @@ public static class ProcessorAction {
305294 public void validate () throws FriendlyException {
306295
307296 if (this .key == null || this .key .isEmpty ()) {
308- throw new FriendlyException ("ApplicationInsights Java Agent failed to start." ,
309- "Telemetry processor configuration has invalid action with empty key!!!" ,
297+ throw new FriendlyException ("Telemetry processor configuration has invalid action with empty key!!!" ,
310298 "Please provide a valid key with value under each action section of processor configuration. " +
311299 "Learn more about telemetry processors here: https://go.microsoft.com/fwlink/?linkid=2151557" );
312300 }
313301 if (this .action == null ) {
314- throw new FriendlyException ("ApplicationInsights Java Agent failed to start." ,
315- "Telemetry processor configuration has invalid config with empty action!!!" ,
302+ throw new FriendlyException ("Telemetry processor configuration has invalid config with empty action!!!" ,
316303 "Please provide a valid action. Telemetry processors cannot have empty or no actions. " +
317304 "Learn more about telemetry processors here: https://go.microsoft.com/fwlink/?linkid=2151557" );
318305 }
319306 if (this .action == ProcessorActionType .insert || this .action == ProcessorActionType .update ) {
320307 if (this .value == null && this .fromAttribute == null ) {
321- throw new FriendlyException ("ApplicationInsights Java Agent failed to start." ,
322- "Telemetry processor configuration has invalid action with empty value or empty fromAttribute!!!" ,
308+ throw new FriendlyException ("Telemetry processor configuration has invalid action with empty value or empty fromAttribute!!!" ,
323309 "Please provide a valid action with value under each action section of processor configuration. " +
324310 "Learn more about telemetry processors here: https://go.microsoft.com/fwlink/?linkid=2151557" );
325311 }
0 commit comments