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..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 @@ -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("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 0c593bb9..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 @@ -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("Update the rule name for the provided ruleId") @GraphQLNonNull String name(); @GraphQLField @GraphQLName(SPAN_PROCESSING_FILTER_KEY) + @GraphQLDescription("Replace the existing spanFilters for the input ruleId") @GraphQLNonNull SpanProcessingRuleFilter spanFilter(); @GraphQLField @GraphQLName(DISABLED_KEY) + @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 e8a51b4a..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 @@ -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("Creates a new ExcludeSpanRule. See ExcludeSpanRule for more information.") @GraphQLNonNull @GraphQLDataFetcher(ExcludeSpanCreateRuleMutator.class) ExcludeSpanRule createExcludeSpanRule( @@ -24,6 +26,8 @@ ExcludeSpanRule createExcludeSpanRule( @GraphQLField @GraphQLName(UPDATE_EXCLUDE_SPAN_RULE_MUTATION_NAME) + @GraphQLDescription( + "Update exclude span rule name, filters and enable/disable it for the provided ruleId") @GraphQLNonNull @GraphQLDataFetcher(ExcludeSpanUpdateRuleMutator.class) ExcludeSpanRule updateExcludeSpanRule( @@ -32,6 +36,7 @@ ExcludeSpanRule updateExcludeSpanRule( @GraphQLField @GraphQLName(DELETE_EXCLUDE_SPAN_RULE_MUTATION_NAME) + @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 7bb6607d..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 @@ -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 in") 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..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 @@ -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; @@ -7,6 +8,8 @@ import org.hypertrace.core.graphql.common.schema.id.Identifiable; @GraphQLName(ExcludeSpanRule.TYPE_NAME) +@GraphQLDescription( + "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"; @@ -15,11 +18,13 @@ public interface ExcludeSpanRule extends Identifiable, ExcludeSpanRuleInfo { @GraphQLField @GraphQLName(CREATION_TIME_KEY) + @GraphQLDescription("Exclude span rule creation time") @GraphQLNonNull Instant creationTime(); @GraphQLField @GraphQLName(LAST_UPDATED_TIME_KEY) + @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 29a414b8..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 @@ -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,26 @@ 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 contains filters based on span attributes") @GraphQLNonNull SpanProcessingRuleFilter spanFilter(); @GraphQLField @GraphQLName(DISABLED_KEY) + @GraphQLDescription("Disabled field denotes whether the rule is disabled or not.") @GraphQLNonNull boolean disabled(); @GraphQLField @GraphQLName(RULE_TYPE_KEY) + @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 991b5506..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 @@ -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,15 @@ public interface SpanProcessingLogicalFilter { @GraphQLField @GraphQLName(SPAN_PROCESSING_LOGICAL_OPERATOR_KEY) + @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( + "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 ca3b8e50..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 @@ -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,27 @@ 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.header.authorization") String key(); @GraphQLField @GraphQLName(SPAN_PROCESSING_FILTER_FIELD_KEY) + @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 which combines the lhs (key or field) and rhs (value)") @GraphQLNonNull SpanProcessingRelationalOperator relationalOperator(); @GraphQLField @GraphQLName(FILTER_ARGUMENT_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 87f3b603..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 @@ -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,13 @@ public interface SpanProcessingRuleFilter { @GraphQLField @GraphQLName(SPAN_PROCESSING_LOGICAL_FILTER_KEY) + @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 which takes in lhs and lhs, combining them with relational operator") SpanProcessingRelationalFilter relationalSpanFilter(); }