@@ -171,6 +171,7 @@ public static Configuration create(Path agentJarPath, @Nullable RpConfiguration
171171 + " and it is now enabled by default,"
172172 + " so no need to enable it under preview configuration" );
173173 }
174+ logWarningIfUsingInternalAttributes (config );
174175
175176 overlayFromEnv (config , agentJarPath .getParent ());
176177 config .sampling .percentage = roundToNearest (config .sampling .percentage , true );
@@ -191,6 +192,46 @@ public static Configuration create(Path agentJarPath, @Nullable RpConfiguration
191192 return config ;
192193 }
193194
195+ private static void logWarningIfUsingInternalAttributes (Configuration config ) {
196+ for (Configuration .ProcessorConfig processor : config .preview .processors ) {
197+ if (processor .include != null ) {
198+ logWarningIfUsingInternalAttributes (processor .include );
199+ }
200+ if (processor .exclude != null ) {
201+ logWarningIfUsingInternalAttributes (processor .exclude );
202+ }
203+ for (Configuration .ProcessorAction action : processor .actions ) {
204+ if (action .key != null ) {
205+ logWarningIfUsingInternalAttributes (action .key .getKey ());
206+ }
207+ if (action .fromAttribute != null ) {
208+ logWarningIfUsingInternalAttributes (action .fromAttribute .getKey ());
209+ }
210+ }
211+ }
212+ for (SamplingOverride override : config .preview .sampling .overrides ) {
213+ for (Configuration .SamplingOverrideAttribute attribute : override .attributes ) {
214+ logWarningIfUsingInternalAttributes (attribute .key );
215+ }
216+ }
217+ }
218+
219+ private static void logWarningIfUsingInternalAttributes (
220+ Configuration .ProcessorIncludeExclude includeExclude ) {
221+ for (Configuration .ProcessorAttribute attribute : includeExclude .attributes ) {
222+ logWarningIfUsingInternalAttributes (attribute .key );
223+ }
224+ }
225+
226+ private static void logWarningIfUsingInternalAttributes (String attributeKey ) {
227+ if (attributeKey .startsWith ("applicationinsights.internal." )) {
228+ configurationLogger .warn (
229+ "Usage of internal attributes in processor configurations is not supported"
230+ + " and will be removed in a future version: "
231+ + attributeKey );
232+ }
233+ }
234+
194235 private static void overlayProfilerEnvVars (Configuration config ) {
195236 config .preview .profiler .enabled =
196237 Boolean .parseBoolean (
0 commit comments