Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore | Add graphQL description to span exclusion rules APIs #237

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
AnandShivansh marked this conversation as resolved.
Show resolved Hide resolved
@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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a change we still want to make? Anything stopping us from doing it? It can't be done once the API is exposed as it'll be a breaking change.

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")
AnandShivansh marked this conversation as resolved.
Show resolved Hide resolved
@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();
}
Loading