Skip to content

Filter logs using attributes does not work starting version 3.7.2 #4526

@dvanackere-lpg

Description

@dvanackere-lpg

Expected behavior

Adding an attribute to a log and add a filter with this attribute should remove the log in Application Insights.
This was the behavior since at least version 3.4.x until version 3.7.1

Actual behavior

The attribute is added, the log is modified accordingly, but the log is not filtered.

To Reproduce

applicationinsights.json:
{ "sampling": { "percentage": 100, "overrides": [{ "telemetryType": "trace", "attributes": [{ "key": "TODELETE", "value": ".*", "matchType": "regexp" } ], "percentage": 0 } ] }, "preview": { "processors": [{ "type": "log", "body": { "toAttributes": { "rules": [ "^Noisy log (?<TODELETE>.*)" ] } } } ] } }

In the application, add a noisy log:
logger.info { "Noisy log that should not be sent to AppInsights" }

System information

Please provide the following information:

  • SDK Version: 3.7.2 to 3.7.5 KO, 3.4.x to 3.7.1 OK
  • Using spring-boot: yes

I suspect that starting version 3.7.2, the 'sampling overrides' and the 'attribute processors' are not handled in the same order (processor then sampling before 3.7.2, sampling then processor starting 3.7.2).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions