Skip to content

Rust introspection: disable max depth rule #5978

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

Merged
merged 3 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion apollo-router/src/plugins/telemetry/otel/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,6 @@ where
attributes.insert(OTEL_ORIGINAL_NAME.into(), builder.name.into());
builder.name = forced_span_name.into();
}

// Assign end time, build and start span, drop span to export
builder
.with_end_time(SystemTime::now())
Expand Down
6 changes: 0 additions & 6 deletions apollo-router/src/query_planner/bridge_query_planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,12 +559,6 @@ impl BridgeQueryPlanner {
) -> Result<graphql::Response, QueryPlannerError> {
let schema = self.schema.api_schema();
let operation = doc.get_operation(key.operation_name.as_deref())?;
apollo_compiler::execution::check_introspection_max_depth(&doc.executable, operation)
.map_err(|_e| {
QueryPlannerError::Introspection(IntrospectionError {
message: Some("Maximum introspection depth exceeded".to_owned()),
})
})?;
let variable_values = Default::default();
let variable_values =
apollo_compiler::execution::coerce_variable_values(schema, operation, &variable_values)
Expand Down
18 changes: 9 additions & 9 deletions apollo-router/tests/integration/telemetry/datadog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ async fn test_default_span_names() -> Result<(), BoxError> {
.unwrap(),
id.to_datadog()
);
router.graceful_shutdown().await;
TraceSpec::builder()
.services(["client", "router", "subgraph"].into())
.span_names(
Expand All @@ -73,7 +74,6 @@ async fn test_default_span_names() -> Result<(), BoxError> {
.build()
.validate_trace(id)
.await?;
router.graceful_shutdown().await;
Ok(())
}

Expand Down Expand Up @@ -104,6 +104,7 @@ async fn test_override_span_names() -> Result<(), BoxError> {
.unwrap(),
id.to_datadog()
);
router.graceful_shutdown().await;
TraceSpec::builder()
.services(["client", "router", "subgraph"].into())
.span_names(
Expand All @@ -125,7 +126,6 @@ async fn test_override_span_names() -> Result<(), BoxError> {
.build()
.validate_trace(id)
.await?;
router.graceful_shutdown().await;
Ok(())
}

Expand Down Expand Up @@ -156,6 +156,7 @@ async fn test_override_span_names_late() -> Result<(), BoxError> {
.unwrap(),
id.to_datadog()
);
router.graceful_shutdown().await;
TraceSpec::builder()
.services(["client", "router", "subgraph"].into())
.span_names(
Expand All @@ -177,7 +178,6 @@ async fn test_override_span_names_late() -> Result<(), BoxError> {
.build()
.validate_trace(id)
.await?;
router.graceful_shutdown().await;
Ok(())
}

Expand Down Expand Up @@ -206,6 +206,7 @@ async fn test_basic() -> Result<(), BoxError> {
.unwrap(),
id.to_datadog()
);
router.graceful_shutdown().await;
TraceSpec::builder()
.operation_name("ExampleQuery")
.services(["client", "router", "subgraph"].into())
Expand Down Expand Up @@ -240,7 +241,6 @@ async fn test_basic() -> Result<(), BoxError> {
.build()
.validate_trace(id)
.await?;
router.graceful_shutdown().await;
Ok(())
}

Expand Down Expand Up @@ -274,6 +274,7 @@ async fn test_with_parent_span() -> Result<(), BoxError> {
.unwrap(),
id.to_datadog()
);
router.graceful_shutdown().await;
TraceSpec::builder()
.operation_name("ExampleQuery")
.services(["client", "router", "subgraph"].into())
Expand Down Expand Up @@ -308,7 +309,6 @@ async fn test_with_parent_span() -> Result<(), BoxError> {
.build()
.validate_trace(id)
.await?;
router.graceful_shutdown().await;
Ok(())
}

Expand Down Expand Up @@ -383,6 +383,7 @@ async fn test_resource_mapping_override() -> Result<(), BoxError> {
.get("apollo-custom-trace-id")
.unwrap()
.is_empty());
router.graceful_shutdown().await;
TraceSpec::builder()
.services(["client", "router", "subgraph"].into())
.span_names(
Expand All @@ -403,7 +404,6 @@ async fn test_resource_mapping_override() -> Result<(), BoxError> {
.build()
.validate_trace(id)
.await?;
router.graceful_shutdown().await;
Ok(())
}

Expand All @@ -428,6 +428,7 @@ async fn test_span_metrics() -> Result<(), BoxError> {
.get("apollo-custom-trace-id")
.unwrap()
.is_empty());
router.graceful_shutdown().await;
TraceSpec::builder()
.operation_name("ExampleQuery")
.services(["client", "router", "subgraph"].into())
Expand All @@ -450,7 +451,6 @@ async fn test_span_metrics() -> Result<(), BoxError> {
.build()
.validate_trace(id)
.await?;
router.graceful_shutdown().await;
Ok(())
}

Expand Down Expand Up @@ -495,12 +495,12 @@ impl TraceSpec {
.await?;
tracing::debug!("{}", serde_json::to_string_pretty(&trace)?);
self.verify_trace_participants(&trace)?;
self.verify_spans_present(&trace)?;
self.validate_measured_spans(&trace)?;
self.verify_operation_name(&trace)?;
self.verify_priority_sampled(&trace)?;
self.verify_version(&trace)?;
self.verify_spans_present(&trace)?;
self.validate_span_kinds(&trace)?;
self.validate_measured_spans(&trace)?;
Ok(())
}

Expand Down