From efe3500ac2af31a8bc9086a95c0e8cd3ac22794f Mon Sep 17 00:00:00 2001 From: Shivansh Anand Srivastava Date: Wed, 19 Jun 2024 00:20:36 +0530 Subject: [PATCH 1/5] Add description to span exclusion rules --- .../schema/mutation/DeleteSpanProcessingRuleResponse.java | 2 ++ .../schema/mutation/ExcludeSpanRuleUpdate.java | 4 ++++ .../schema/mutation/SpanProcessingMutationSchema.java | 4 ++++ .../schema/query/ExcludeSpanRuleResultSet.java | 2 ++ .../schema/query/SpanProcessingQuerySchema.java | 2 ++ .../graphql/spanprocessing/schema/rule/ExcludeSpanRule.java | 3 +++ .../spanprocessing/schema/rule/ExcludeSpanRuleInfo.java | 5 +++++ .../schema/rule/filter/SpanProcessingLogicalFilter.java | 3 +++ .../schema/rule/filter/SpanProcessingRelationalFilter.java | 5 +++++ .../schema/rule/filter/SpanProcessingRuleFilter.java | 3 +++ 10 files changed, 33 insertions(+) diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/DeleteSpanProcessingRuleResponse.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/DeleteSpanProcessingRuleResponse.java index c66d830f..4a4e8413 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/DeleteSpanProcessingRuleResponse.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/DeleteSpanProcessingRuleResponse.java @@ -1,5 +1,6 @@ package org.hypertrace.graphql.spanprocessing.schema.mutation; +import graphql.annotations.annotationTypes.GraphQLDescription; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; import graphql.annotations.annotationTypes.GraphQLNonNull; @@ -12,5 +13,6 @@ public interface DeleteSpanProcessingRuleResponse { @GraphQLField @GraphQLNonNull @GraphQLName(DELETE_SPAN_PROCESSING_RULE_RESPONSE_SUCCESS) + @GraphQLDescription("Delete span processing rule is success or not") boolean success(); } diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/ExcludeSpanRuleUpdate.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/ExcludeSpanRuleUpdate.java index 0c593bb9..0e88a4f0 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/ExcludeSpanRuleUpdate.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/ExcludeSpanRuleUpdate.java @@ -1,5 +1,6 @@ package org.hypertrace.graphql.spanprocessing.schema.mutation; +import graphql.annotations.annotationTypes.GraphQLDescription; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; import graphql.annotations.annotationTypes.GraphQLNonNull; @@ -17,16 +18,19 @@ public interface ExcludeSpanRuleUpdate extends Identifiable { @GraphQLField @GraphQLName(NAME_KEY) + @GraphQLDescription("Exclude span rule name") @GraphQLNonNull String name(); @GraphQLField @GraphQLName(SPAN_PROCESSING_FILTER_KEY) + @GraphQLDescription("Span processing rule filter") @GraphQLNonNull SpanProcessingRuleFilter spanFilter(); @GraphQLField @GraphQLName(DISABLED_KEY) + @GraphQLDescription("Exclude span rule is disabled or not") @GraphQLNonNull boolean disabled(); } diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/SpanProcessingMutationSchema.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/SpanProcessingMutationSchema.java index e8a51b4a..ffa44786 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/SpanProcessingMutationSchema.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/SpanProcessingMutationSchema.java @@ -1,6 +1,7 @@ package org.hypertrace.graphql.spanprocessing.schema.mutation; import graphql.annotations.annotationTypes.GraphQLDataFetcher; +import graphql.annotations.annotationTypes.GraphQLDescription; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; import graphql.annotations.annotationTypes.GraphQLNonNull; @@ -16,6 +17,7 @@ public interface SpanProcessingMutationSchema { @GraphQLField @GraphQLName(CREATE_EXCLUDE_SPAN_RULE_MUTATION_NAME) + @GraphQLDescription("Create exclude span rule") @GraphQLNonNull @GraphQLDataFetcher(ExcludeSpanCreateRuleMutator.class) ExcludeSpanRule createExcludeSpanRule( @@ -24,6 +26,7 @@ ExcludeSpanRule createExcludeSpanRule( @GraphQLField @GraphQLName(UPDATE_EXCLUDE_SPAN_RULE_MUTATION_NAME) + @GraphQLDescription("Update exclude span rule") @GraphQLNonNull @GraphQLDataFetcher(ExcludeSpanUpdateRuleMutator.class) ExcludeSpanRule updateExcludeSpanRule( @@ -32,6 +35,7 @@ ExcludeSpanRule updateExcludeSpanRule( @GraphQLField @GraphQLName(DELETE_EXCLUDE_SPAN_RULE_MUTATION_NAME) + @GraphQLDescription("Delete exclude span rule") @GraphQLNonNull @GraphQLDataFetcher(ExcludeSpanDeleteRuleMutator.class) DeleteSpanProcessingRuleResponse deleteExcludeSpanRule( diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/query/ExcludeSpanRuleResultSet.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/query/ExcludeSpanRuleResultSet.java index 7bb6607d..ef5e3036 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/query/ExcludeSpanRuleResultSet.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/query/ExcludeSpanRuleResultSet.java @@ -1,5 +1,6 @@ package org.hypertrace.graphql.spanprocessing.schema.query; +import graphql.annotations.annotationTypes.GraphQLDescription; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; import graphql.annotations.annotationTypes.GraphQLNonNull; @@ -15,5 +16,6 @@ public interface ExcludeSpanRuleResultSet extends ResultSet { @GraphQLField @GraphQLNonNull @GraphQLName(RESULT_SET_RESULTS_NAME) + @GraphQLDescription("Exclude span rule list") List results(); } diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/query/SpanProcessingQuerySchema.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/query/SpanProcessingQuerySchema.java index 60aa3e52..dee0b272 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/query/SpanProcessingQuerySchema.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/query/SpanProcessingQuerySchema.java @@ -1,6 +1,7 @@ package org.hypertrace.graphql.spanprocessing.schema.query; import graphql.annotations.annotationTypes.GraphQLDataFetcher; +import graphql.annotations.annotationTypes.GraphQLDescription; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; import graphql.annotations.annotationTypes.GraphQLNonNull; @@ -12,6 +13,7 @@ public interface SpanProcessingQuerySchema { @GraphQLField @GraphQLNonNull @GraphQLName(EXCLUDE_SPAN_RULES_QUERY_NAME) + @GraphQLDescription("Get all exclude span rules") @GraphQLDataFetcher(ExcludeSpanRulesFetcher.class) ExcludeSpanRuleResultSet excludeSpanRules(); } diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRule.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRule.java index 1f8943a5..ca730bdb 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRule.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRule.java @@ -1,5 +1,6 @@ package org.hypertrace.graphql.spanprocessing.schema.rule; +import graphql.annotations.annotationTypes.GraphQLDescription; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; import graphql.annotations.annotationTypes.GraphQLNonNull; @@ -15,11 +16,13 @@ public interface ExcludeSpanRule extends Identifiable, ExcludeSpanRuleInfo { @GraphQLField @GraphQLName(CREATION_TIME_KEY) + @GraphQLDescription("Exclude span rule creation tme") @GraphQLNonNull Instant creationTime(); @GraphQLField @GraphQLName(LAST_UPDATED_TIME_KEY) + @GraphQLDescription("Exclude span rule last update tme") @GraphQLNonNull Instant lastUpdatedTime(); } diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRuleInfo.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRuleInfo.java index 29a414b8..ecd08b24 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRuleInfo.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRuleInfo.java @@ -1,5 +1,6 @@ package org.hypertrace.graphql.spanprocessing.schema.rule; +import graphql.annotations.annotationTypes.GraphQLDescription; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; import graphql.annotations.annotationTypes.GraphQLNonNull; @@ -16,21 +17,25 @@ public interface ExcludeSpanRuleInfo { @GraphQLField @GraphQLName(NAME_KEY) + @GraphQLDescription("Exclude span rule name") @GraphQLNonNull String name(); @GraphQLField @GraphQLName(SPAN_FILTER_KEY) + @GraphQLDescription("Span processing rule filter") @GraphQLNonNull SpanProcessingRuleFilter spanFilter(); @GraphQLField @GraphQLName(DISABLED_KEY) + @GraphQLDescription("Exclude span rule is disabled or not") @GraphQLNonNull boolean disabled(); @GraphQLField @GraphQLName(RULE_TYPE_KEY) + @GraphQLDescription("Exclude span rule type") // TODO: make this field non-nullable ExcludeSpanRuleRuleType ruleType(); } diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingLogicalFilter.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingLogicalFilter.java index 991b5506..5586e915 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingLogicalFilter.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingLogicalFilter.java @@ -1,5 +1,6 @@ package org.hypertrace.graphql.spanprocessing.schema.rule.filter; +import graphql.annotations.annotationTypes.GraphQLDescription; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; import graphql.annotations.annotationTypes.GraphQLNonNull; @@ -15,11 +16,13 @@ public interface SpanProcessingLogicalFilter { @GraphQLField @GraphQLName(SPAN_PROCESSING_LOGICAL_OPERATOR_KEY) + @GraphQLDescription("Span processing logical operator") @GraphQLNonNull LogicalOperator logicalOperator(); @GraphQLField @GraphQLName(SPAN_PROCESSING_FILTERS_KEY) + @GraphQLDescription("Span processing filters") @GraphQLNonNull List spanFilters(); } diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRelationalFilter.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRelationalFilter.java index ca3b8e50..084596f1 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRelationalFilter.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRelationalFilter.java @@ -2,6 +2,7 @@ import static org.hypertrace.core.graphql.common.schema.results.arguments.filter.FilterArgument.FILTER_ARGUMENT_VALUE; +import graphql.annotations.annotationTypes.GraphQLDescription; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; import graphql.annotations.annotationTypes.GraphQLNonNull; @@ -16,19 +17,23 @@ public interface SpanProcessingRelationalFilter { @GraphQLField @GraphQLName(SPAN_PROCESSING_FILTER_KEY_KEY) + @GraphQLDescription("Span processing filter key") String key(); @GraphQLField @GraphQLName(SPAN_PROCESSING_FILTER_FIELD_KEY) + @GraphQLDescription("Span processing filter field") SpanProcessingFilterField field(); @GraphQLField @GraphQLName(RELATION_OPERATOR_KEY) + @GraphQLDescription("Span processing relational operator") @GraphQLNonNull SpanProcessingRelationalOperator relationalOperator(); @GraphQLField @GraphQLName(FILTER_ARGUMENT_VALUE) + @GraphQLDescription("Span processing filter value") @GraphQLNonNull Object value(); } diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRuleFilter.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRuleFilter.java index 87f3b603..6c591ecf 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRuleFilter.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRuleFilter.java @@ -1,5 +1,6 @@ package org.hypertrace.graphql.spanprocessing.schema.rule.filter; +import graphql.annotations.annotationTypes.GraphQLDescription; import graphql.annotations.annotationTypes.GraphQLField; import graphql.annotations.annotationTypes.GraphQLName; @@ -12,9 +13,11 @@ public interface SpanProcessingRuleFilter { @GraphQLField @GraphQLName(SPAN_PROCESSING_LOGICAL_FILTER_KEY) + @GraphQLDescription("Span processing logical filter") SpanProcessingLogicalFilter logicalSpanFilter(); @GraphQLField @GraphQLName(SPAN_PROCESSING_RELATIONAL_FILTER_KEY) + @GraphQLDescription("Span processing relational filter") SpanProcessingRelationalFilter relationalSpanFilter(); } From 2c9f3dbcddec9bfff483046f82890214c8f72f33 Mon Sep 17 00:00:00 2001 From: Shivansh Anand Srivastava Date: Wed, 19 Jun 2024 01:36:48 +0530 Subject: [PATCH 2/5] Resolve PR reviews --- .../mutation/DeleteSpanProcessingRuleResponse.java | 2 +- .../schema/mutation/ExcludeSpanRuleUpdate.java | 6 +++--- .../mutation/SpanProcessingMutationSchema.java | 8 +++++--- .../schema/query/ExcludeSpanRuleResultSet.java | 2 +- .../spanprocessing/schema/rule/ExcludeSpanRule.java | 5 +++-- .../schema/rule/ExcludeSpanRuleInfo.java | 8 +++++--- .../rule/filter/SpanProcessingLogicalFilter.java | 6 ++++-- .../rule/filter/SpanProcessingRelationalFilter.java | 12 ++++++++---- .../schema/rule/filter/SpanProcessingRuleFilter.java | 6 ++++-- 9 files changed, 34 insertions(+), 21 deletions(-) diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/DeleteSpanProcessingRuleResponse.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/DeleteSpanProcessingRuleResponse.java index 4a4e8413..f4b08a40 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/DeleteSpanProcessingRuleResponse.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/DeleteSpanProcessingRuleResponse.java @@ -13,6 +13,6 @@ public interface DeleteSpanProcessingRuleResponse { @GraphQLField @GraphQLNonNull @GraphQLName(DELETE_SPAN_PROCESSING_RULE_RESPONSE_SUCCESS) - @GraphQLDescription("Delete span processing rule is success or not") + @GraphQLDescription("Success field tells us whether the delete call was a success or not") boolean success(); } diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/ExcludeSpanRuleUpdate.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/ExcludeSpanRuleUpdate.java index 0e88a4f0..1e192274 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/ExcludeSpanRuleUpdate.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/ExcludeSpanRuleUpdate.java @@ -18,19 +18,19 @@ public interface ExcludeSpanRuleUpdate extends Identifiable { @GraphQLField @GraphQLName(NAME_KEY) - @GraphQLDescription("Exclude span rule name") + @GraphQLDescription("Update the rule name for the provided ruleId") @GraphQLNonNull String name(); @GraphQLField @GraphQLName(SPAN_PROCESSING_FILTER_KEY) - @GraphQLDescription("Span processing rule filter") + @GraphQLDescription("Update the existing spanFilters for the input ruleId") @GraphQLNonNull SpanProcessingRuleFilter spanFilter(); @GraphQLField @GraphQLName(DISABLED_KEY) - @GraphQLDescription("Exclude span rule is disabled or not") + @GraphQLDescription("Enable or disable the rule") @GraphQLNonNull boolean disabled(); } diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/SpanProcessingMutationSchema.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/SpanProcessingMutationSchema.java index ffa44786..9b445e20 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/SpanProcessingMutationSchema.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/SpanProcessingMutationSchema.java @@ -17,7 +17,8 @@ public interface SpanProcessingMutationSchema { @GraphQLField @GraphQLName(CREATE_EXCLUDE_SPAN_RULE_MUTATION_NAME) - @GraphQLDescription("Create exclude span rule") + @GraphQLDescription( + "Create exclude span rule by providing the rule name, filters, rule type, enabled or disabled state") @GraphQLNonNull @GraphQLDataFetcher(ExcludeSpanCreateRuleMutator.class) ExcludeSpanRule createExcludeSpanRule( @@ -26,7 +27,8 @@ ExcludeSpanRule createExcludeSpanRule( @GraphQLField @GraphQLName(UPDATE_EXCLUDE_SPAN_RULE_MUTATION_NAME) - @GraphQLDescription("Update exclude span rule") + @GraphQLDescription( + "Update exclude span rule name, filters and enable/disable it for the provided ruleId") @GraphQLNonNull @GraphQLDataFetcher(ExcludeSpanUpdateRuleMutator.class) ExcludeSpanRule updateExcludeSpanRule( @@ -35,7 +37,7 @@ ExcludeSpanRule updateExcludeSpanRule( @GraphQLField @GraphQLName(DELETE_EXCLUDE_SPAN_RULE_MUTATION_NAME) - @GraphQLDescription("Delete exclude span rule") + @GraphQLDescription("Delete exclude span rule based on ruleId") @GraphQLNonNull @GraphQLDataFetcher(ExcludeSpanDeleteRuleMutator.class) DeleteSpanProcessingRuleResponse deleteExcludeSpanRule( diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/query/ExcludeSpanRuleResultSet.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/query/ExcludeSpanRuleResultSet.java index ef5e3036..bf64a40f 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/query/ExcludeSpanRuleResultSet.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/query/ExcludeSpanRuleResultSet.java @@ -16,6 +16,6 @@ public interface ExcludeSpanRuleResultSet extends ResultSet { @GraphQLField @GraphQLNonNull @GraphQLName(RESULT_SET_RESULTS_NAME) - @GraphQLDescription("Exclude span rule list") + @GraphQLDescription("Exclude span rule list in") List results(); } diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRule.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRule.java index ca730bdb..4a8fa354 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRule.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRule.java @@ -7,6 +7,7 @@ import java.time.Instant; import org.hypertrace.core.graphql.common.schema.id.Identifiable; +@GraphQLDescription("Exclude span rules are the set of rules created using filters based on span attributes based on which we exclude spans at source from reaching the platform") @GraphQLName(ExcludeSpanRule.TYPE_NAME) public interface ExcludeSpanRule extends Identifiable, ExcludeSpanRuleInfo { String TYPE_NAME = "ExcludeSpanRule"; @@ -16,13 +17,13 @@ public interface ExcludeSpanRule extends Identifiable, ExcludeSpanRuleInfo { @GraphQLField @GraphQLName(CREATION_TIME_KEY) - @GraphQLDescription("Exclude span rule creation tme") + @GraphQLDescription("Exclude span rule creation time") @GraphQLNonNull Instant creationTime(); @GraphQLField @GraphQLName(LAST_UPDATED_TIME_KEY) - @GraphQLDescription("Exclude span rule last update tme") + @GraphQLDescription("Exclude span rule last update time") @GraphQLNonNull Instant lastUpdatedTime(); } diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRuleInfo.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRuleInfo.java index ecd08b24..fd1f95ce 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRuleInfo.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRuleInfo.java @@ -23,19 +23,21 @@ public interface ExcludeSpanRuleInfo { @GraphQLField @GraphQLName(SPAN_FILTER_KEY) - @GraphQLDescription("Span processing rule filter") + @GraphQLDescription("Span processing rule filter contains filters based on span attributes") @GraphQLNonNull SpanProcessingRuleFilter spanFilter(); @GraphQLField @GraphQLName(DISABLED_KEY) - @GraphQLDescription("Exclude span rule is disabled or not") + @GraphQLDescription( + "Disabled field denotes whether the rule is disabled or not. By default it is enabled") @GraphQLNonNull boolean disabled(); @GraphQLField @GraphQLName(RULE_TYPE_KEY) - @GraphQLDescription("Exclude span rule type") + @GraphQLDescription( + "Exclude span rule type tells us whether it is user configured rule or system rule") // TODO: make this field non-nullable ExcludeSpanRuleRuleType ruleType(); } diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingLogicalFilter.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingLogicalFilter.java index 5586e915..6e7e2807 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingLogicalFilter.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingLogicalFilter.java @@ -16,13 +16,15 @@ public interface SpanProcessingLogicalFilter { @GraphQLField @GraphQLName(SPAN_PROCESSING_LOGICAL_OPERATOR_KEY) - @GraphQLDescription("Span processing logical operator") + @GraphQLDescription( + "The logical operator is used to combine the list of filters provided in the spanFilters field") @GraphQLNonNull LogicalOperator logicalOperator(); @GraphQLField @GraphQLName(SPAN_PROCESSING_FILTERS_KEY) - @GraphQLDescription("Span processing filters") + @GraphQLDescription( + "List of span filters to be evaluated combining together with the logical operator provided") @GraphQLNonNull List spanFilters(); } diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRelationalFilter.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRelationalFilter.java index 084596f1..5cfd35ab 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRelationalFilter.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRelationalFilter.java @@ -17,23 +17,27 @@ public interface SpanProcessingRelationalFilter { @GraphQLField @GraphQLName(SPAN_PROCESSING_FILTER_KEY_KEY) - @GraphQLDescription("Span processing filter key") + @GraphQLDescription( + "Span processing filter key is the span attribute provided as string like http.request.body.email") String key(); @GraphQLField @GraphQLName(SPAN_PROCESSING_FILTER_FIELD_KEY) - @GraphQLDescription("Span processing filter field") + @GraphQLDescription( + "Span processing filter field supports a list of pre-defined fields like environment name, service name, url and url path (url without query params)") SpanProcessingFilterField field(); @GraphQLField @GraphQLName(RELATION_OPERATOR_KEY) - @GraphQLDescription("Span processing relational operator") + @GraphQLDescription( + "Span processing relational operator which combines the lhs (key or field) and rhs (value)") @GraphQLNonNull SpanProcessingRelationalOperator relationalOperator(); @GraphQLField @GraphQLName(FILTER_ARGUMENT_VALUE) - @GraphQLDescription("Span processing filter value") + @GraphQLDescription( + "Span processing filter value to be evaluated using the relational operator for the provided lhs (key or field)") @GraphQLNonNull Object value(); } diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRuleFilter.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRuleFilter.java index 6c591ecf..2ce8c087 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRuleFilter.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRuleFilter.java @@ -13,11 +13,13 @@ public interface SpanProcessingRuleFilter { @GraphQLField @GraphQLName(SPAN_PROCESSING_LOGICAL_FILTER_KEY) - @GraphQLDescription("Span processing logical filter") + @GraphQLDescription( + "Span processing logical filter containing list of spanFilters and the logical operator") SpanProcessingLogicalFilter logicalSpanFilter(); @GraphQLField @GraphQLName(SPAN_PROCESSING_RELATIONAL_FILTER_KEY) - @GraphQLDescription("Span processing relational filter") + @GraphQLDescription( + "Span processing relational filter which takes in lhs and lhs, combining them with relational operator") SpanProcessingRelationalFilter relationalSpanFilter(); } From a51d5d7bf6c4fe663763ab6e557b7fc4e4d0800f Mon Sep 17 00:00:00 2001 From: Shivansh Anand Srivastava Date: Wed, 19 Jun 2024 01:39:56 +0530 Subject: [PATCH 3/5] Resolve PR reviews --- .../graphql/spanprocessing/schema/rule/ExcludeSpanRule.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRule.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRule.java index 4a8fa354..89abef9f 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRule.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRule.java @@ -7,8 +7,9 @@ import java.time.Instant; import org.hypertrace.core.graphql.common.schema.id.Identifiable; -@GraphQLDescription("Exclude span rules are the set of rules created using filters based on span attributes based on which we exclude spans at source from reaching the platform") @GraphQLName(ExcludeSpanRule.TYPE_NAME) +@GraphQLDescription( + "Exclude span rules are the set of rules created using filters on span attributes based on which we exclude spans at source from reaching the platform") public interface ExcludeSpanRule extends Identifiable, ExcludeSpanRuleInfo { String TYPE_NAME = "ExcludeSpanRule"; From 05beb610fd04c8093a5318a9bf335924bc69ce06 Mon Sep 17 00:00:00 2001 From: Shivansh Anand Srivastava Date: Wed, 19 Jun 2024 17:17:33 +0530 Subject: [PATCH 4/5] Resolve PR reviews --- .../spanprocessing/schema/mutation/ExcludeSpanRuleUpdate.java | 2 +- .../schema/mutation/SpanProcessingMutationSchema.java | 3 +-- .../graphql/spanprocessing/schema/rule/ExcludeSpanRule.java | 2 +- .../spanprocessing/schema/rule/ExcludeSpanRuleInfo.java | 2 +- .../schema/rule/filter/SpanProcessingRelationalFilter.java | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/ExcludeSpanRuleUpdate.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/ExcludeSpanRuleUpdate.java index 1e192274..73077a7c 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/ExcludeSpanRuleUpdate.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/ExcludeSpanRuleUpdate.java @@ -24,7 +24,7 @@ public interface ExcludeSpanRuleUpdate extends Identifiable { @GraphQLField @GraphQLName(SPAN_PROCESSING_FILTER_KEY) - @GraphQLDescription("Update the existing spanFilters for the input ruleId") + @GraphQLDescription("Replace the existing spanFilters for the input ruleId") @GraphQLNonNull SpanProcessingRuleFilter spanFilter(); diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/SpanProcessingMutationSchema.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/SpanProcessingMutationSchema.java index 9b445e20..c9b54aff 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/SpanProcessingMutationSchema.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/mutation/SpanProcessingMutationSchema.java @@ -17,8 +17,7 @@ public interface SpanProcessingMutationSchema { @GraphQLField @GraphQLName(CREATE_EXCLUDE_SPAN_RULE_MUTATION_NAME) - @GraphQLDescription( - "Create exclude span rule by providing the rule name, filters, rule type, enabled or disabled state") + @GraphQLDescription("Creates a new ExcludeSpanRule. See ExcludeSpanRule for more information.") @GraphQLNonNull @GraphQLDataFetcher(ExcludeSpanCreateRuleMutator.class) ExcludeSpanRule createExcludeSpanRule( diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRule.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRule.java index 89abef9f..4450beb6 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRule.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRule.java @@ -9,7 +9,7 @@ @GraphQLName(ExcludeSpanRule.TYPE_NAME) @GraphQLDescription( - "Exclude span rules are the set of rules created using filters on span attributes based on which we exclude spans at source from reaching the platform") + "An ExcludeSpanRule describes a set of conditions based on span attributes. When matched, a span is discarded and not eligible for further processing.") public interface ExcludeSpanRule extends Identifiable, ExcludeSpanRuleInfo { String TYPE_NAME = "ExcludeSpanRule"; diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRuleInfo.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRuleInfo.java index fd1f95ce..e8a6c436 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRuleInfo.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRuleInfo.java @@ -30,7 +30,7 @@ public interface ExcludeSpanRuleInfo { @GraphQLField @GraphQLName(DISABLED_KEY) @GraphQLDescription( - "Disabled field denotes whether the rule is disabled or not. By default it is enabled") + "Disabled field denotes whether the rule is disabled or not. By default it is enabled on write") @GraphQLNonNull boolean disabled(); diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRelationalFilter.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRelationalFilter.java index 5cfd35ab..91589356 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRelationalFilter.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/filter/SpanProcessingRelationalFilter.java @@ -18,7 +18,7 @@ public interface SpanProcessingRelationalFilter { @GraphQLField @GraphQLName(SPAN_PROCESSING_FILTER_KEY_KEY) @GraphQLDescription( - "Span processing filter key is the span attribute provided as string like http.request.body.email") + "Span processing filter key is the span attribute provided as string like http.request.header.authorization") String key(); @GraphQLField From a3b21be6db3b8b9d81b87d9a69f41d8ff8738595 Mon Sep 17 00:00:00 2001 From: Shivansh Anand Srivastava Date: Wed, 19 Jun 2024 19:35:02 +0530 Subject: [PATCH 5/5] Resolve PR reviews --- .../spanprocessing/schema/rule/ExcludeSpanRuleInfo.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRuleInfo.java b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRuleInfo.java index e8a6c436..c13b6819 100644 --- a/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRuleInfo.java +++ b/hypertrace-graphql-span-processing-schema/src/main/java/org/hypertrace/graphql/spanprocessing/schema/rule/ExcludeSpanRuleInfo.java @@ -29,8 +29,7 @@ public interface ExcludeSpanRuleInfo { @GraphQLField @GraphQLName(DISABLED_KEY) - @GraphQLDescription( - "Disabled field denotes whether the rule is disabled or not. By default it is enabled on write") + @GraphQLDescription("Disabled field denotes whether the rule is disabled or not.") @GraphQLNonNull boolean disabled();