try add a criteria with include for telemetry processor in ApplicationInsights V3 (java) Codeless Approach is not working?

98 views Asked by At

I have to add a new attribute facility on all logs with a filter to name attributes with value toto value, but I don't know why it s not working maybe including criteria is not working? I use this tutorial https://learn.microsoft.com/en-us/azure/azure-monitor/app/java-standalone-telemetry-processors.

my conf json and my jar application insights-agent-3.4.15.jar


{
  "connectionString": "secret",
  "role": {
    "name": "dev"
  },
  "preview": {
    "processors": [
      {
        "type": "attribute",
        "include": {
          "matchType": "strict",
          "attributes": [
            {
              "key": "toto",
              "value": "valuetoto"
            }
          ]
        },
        "actions": [
          {
            "key": "opfacility",
            "value": "opcpf",
            "action": "insert"
          }
        ]
      }
    ]
  }
}

on my insight transaction search result I have Properties Telemetry type trace

custom properties toto valuetoto

why is my processor not working? I try without including criteria and its work the processor add my new attribute but why the include doesn't work anything wrong?

1

There are 1 answers

1
Suresh Chikkam On

I try without including criteria and its work the processor add my new attribute but why the include doesn't work anything wrong?

I also referred the above documentation demonstrates how to configure an attribute processor with an "include" condition to match specific attributes and values, but the processor failed.

Configure an ApplicationInsights.xml file to you application check below.

<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
  <InstrumentationKey>YourInstrumentationKey</InstrumentationKey>
  <!-- Other configuration settings -->
  
  <TelemetryProcessors>
    <Add Type="com.example.CustomAttributeProcessor">
      <Include>
        <MatchType>Strict</MatchType>
        <Attributes>
          <Add Key="toto" Value="valuetoto" />
        </Attributes>
      </Include>
      <Actions>
        <Add Key="opfacility" Value="opcpf" Action="Insert" />
      </Actions>
    </Add>
  </TelemetryProcessors>
</ApplicationInsights>
  • The telemetry processing logic specified in the configuration files is applied to the telemetry data before it's sent to Application Insights.

  • Once the new/updated config file is ready try to re-deploy the JAR files or other relevant resources for the changes

Result: enter image description here

enter image description here