Skip to content

Commit

Permalink
Expose URL_PATH in exclusion rules (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanket-mundra authored Feb 14, 2024
1 parent e414d22 commit 2cae628
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ enum Field {
FIELD_URL = 1;
FIELD_SERVICE_NAME = 2;
FIELD_ENVIRONMENT_NAME = 3;
FIELD_URL_PATH = 4;
}

enum RelationalOperator {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.hypertrace.span.processing.config.service;

import static org.hypertrace.span.processing.config.service.v1.Field.FIELD_URL;
import static org.hypertrace.span.processing.config.service.v1.Field.FIELD_URL_PATH;
import static org.hypertrace.span.processing.config.service.v1.LogicalOperator.LOGICAL_OPERATOR_AND;
import static org.hypertrace.span.processing.config.service.v1.RelationalOperator.RELATIONAL_OPERATOR_CONTAINS;
import static org.hypertrace.span.processing.config.service.v1.RuleType.RULE_TYPE_SYSTEM;
Expand Down Expand Up @@ -284,6 +285,18 @@ private ExcludeSpanRule buildMockSystemExcludeSpanRule(boolean disabled) {
.build())
.build())
.build())
.addOperands(
SpanFilter.newBuilder()
.setRelationalSpanFilter(
RelationalSpanFilterExpression.newBuilder()
.setOperator(RELATIONAL_OPERATOR_CONTAINS)
.setField(FIELD_URL_PATH)
.setRightOperand(
SpanFilterValue.newBuilder()
.setStringValue("health")
.build())
.build())
.build())
.build())
.build())
.build())
Expand Down Expand Up @@ -324,6 +337,15 @@ private Config buildMockConfig() {
"operator",
"RELATIONAL_OPERATOR_CONTAINS",
"right_operand",
Map.of("string_value", "health"))),
Map.of(
"relational_span_filter",
Map.of(
"field",
"FIELD_URL_PATH",
"operator",
"RELATIONAL_OPERATOR_CONTAINS",
"right_operand",
Map.of("string_value", "health"))))))))))));
}
}

0 comments on commit 2cae628

Please sign in to comment.