Skip to content

Commit

Permalink
Add description to span exclusion rules
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandShivansh committed Jun 18, 2024
1 parent a09a60f commit efe3500
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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();
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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();
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -15,5 +16,6 @@ public interface ExcludeSpanRuleResultSet extends ResultSet<ExcludeSpanRule> {
@GraphQLField
@GraphQLNonNull
@GraphQLName(RESULT_SET_RESULTS_NAME)
@GraphQLDescription("Exclude span rule list")
List<ExcludeSpanRule> results();
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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();
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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();
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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();
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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<SpanProcessingRuleFilter> spanFilters();
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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();
}

0 comments on commit efe3500

Please sign in to comment.