use of com.wavefront.agent.preprocessor.SpanAddAnnotationIfNotExistsTransformer in project java by wavefrontHQ.
the class PushAgentTest method setUserPreprocessorForTraceDerivedREDMetrics.
private void setUserPreprocessorForTraceDerivedREDMetrics(int port) {
ReportableEntityPreprocessor preprocessor = new ReportableEntityPreprocessor();
PreprocessorRuleMetrics preprocessorRuleMetrics = new PreprocessorRuleMetrics(null, null, null);
preprocessor.forSpan().addTransformer(new SpanAddAnnotationIfNotExistsTransformer("application", PREPROCESSED_APPLICATION_TAG_VALUE, x -> true, preprocessorRuleMetrics));
preprocessor.forSpan().addTransformer(new SpanAddAnnotationIfNotExistsTransformer("service", PREPROCESSED_SERVICE_TAG_VALUE, x -> true, preprocessorRuleMetrics));
preprocessor.forSpan().addTransformer(new SpanAddAnnotationIfNotExistsTransformer("cluster", PREPROCESSED_CLUSTER_TAG_VALUE, x -> true, preprocessorRuleMetrics));
preprocessor.forSpan().addTransformer(new SpanAddAnnotationIfNotExistsTransformer("shard", PREPROCESSED_SHARD_TAG_VALUE, x -> true, preprocessorRuleMetrics));
preprocessor.forSpan().addTransformer(new SpanReplaceRegexTransformer("sourceName", "^test.*", PREPROCESSED_SOURCE_VALUE, null, null, false, x -> true, preprocessorRuleMetrics));
Map<String, ReportableEntityPreprocessor> userPreprocessorMap = new HashMap<>();
userPreprocessorMap.put(String.valueOf(port), preprocessor);
proxy.preprocessors.userPreprocessors = userPreprocessorMap;
}
Aggregations