Search in sources :

Example 26 with ProcessorAction

use of com.microsoft.applicationinsights.agent.internal.configuration.Configuration.ProcessorAction in project ApplicationInsights-Java by microsoft.

the class ExporterWithAttributeProcessorTest method invalidRegexTest.

@Test
void invalidRegexTest() {
    MockExporter mockExporter = new MockExporter();
    ProcessorConfig config = new ProcessorConfig();
    config.type = ProcessorType.ATTRIBUTE;
    config.id = "invalidRegex";
    config.include = new ProcessorIncludeExclude();
    config.include.matchType = MatchType.REGEXP;
    config.include.spanNames = Collections.singletonList("***");
    ProcessorAction action = new ProcessorAction("testKey", ProcessorActionType.UPDATE, "redacted", null, null, null);
    List<ProcessorAction> actions = new ArrayList<>();
    actions.add(action);
    config.actions = actions;
    assertThatThrownBy(() -> new ExporterWithAttributeProcessor(config, mockExporter)).isInstanceOf(FriendlyException.class);
}
Also used : ProcessorAction(com.microsoft.applicationinsights.agent.internal.configuration.Configuration.ProcessorAction) ArrayList(java.util.ArrayList) ProcessorIncludeExclude(com.microsoft.applicationinsights.agent.internal.configuration.Configuration.ProcessorIncludeExclude) ProcessorConfig(com.microsoft.applicationinsights.agent.internal.configuration.Configuration.ProcessorConfig) Test(org.junit.jupiter.api.Test)

Aggregations

ProcessorAction (com.microsoft.applicationinsights.agent.internal.configuration.Configuration.ProcessorAction)26 ProcessorConfig (com.microsoft.applicationinsights.agent.internal.configuration.Configuration.ProcessorConfig)26 ArrayList (java.util.ArrayList)26 Test (org.junit.jupiter.api.Test)26 Span (io.opentelemetry.api.trace.Span)23 ReadableSpan (io.opentelemetry.sdk.trace.ReadableSpan)23 SpanData (io.opentelemetry.sdk.trace.data.SpanData)23 SpanExporter (io.opentelemetry.sdk.trace.export.SpanExporter)23 ProcessorIncludeExclude (com.microsoft.applicationinsights.agent.internal.configuration.Configuration.ProcessorIncludeExclude)14 ProcessorAttribute (com.microsoft.applicationinsights.agent.internal.configuration.Configuration.ProcessorAttribute)5