Skip to content
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
5 changes: 5 additions & 0 deletions .changesets/docs_eh_instrumentation_examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Add instrumentation configuration examples ([PR #6487](https://github.com/apollographql/router/pull/6487))

The docs for router telemetry have new example configurations for common use cases for [selectors](https://www.apollographql.com/docs/graphos/reference/router/telemetry/instrumentation/selectors) and [condition](https://www.apollographql.com/docs/graphos/reference/router/telemetry/instrumentation/conditions).

By [@shorgi](https://github.com/shorgi) in https://github.com/apollographql/router/pull/6487
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ to be supplied. These are either located in the current directory or explicitly
specified via flag, either by an absolute path, or a path relative to the current
directory.


Needs backporting!

```
Usage:

Expand Down
4 changes: 2 additions & 2 deletions apollo-router/src/axum_factory/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ use crate::http_server_factory::HttpServerFactory;
use crate::http_server_factory::HttpServerHandle;
use crate::json_ext::Path;
use crate::plugin::test::MockSubgraph;
use crate::query_planner::BridgeQueryPlannerPool;
use crate::query_planner::QueryPlannerService;
use crate::router_factory::create_plugins;
use crate::router_factory::Endpoint;
use crate::router_factory::RouterFactory;
Expand Down Expand Up @@ -2266,7 +2266,7 @@ async fn test_supergraph_timeout() {

let schema = include_str!("..//testdata/minimal_supergraph.graphql");
let schema = Arc::new(Schema::parse(schema, &conf).unwrap());
let planner = BridgeQueryPlannerPool::new(schema.clone(), conf.clone())
let planner = QueryPlannerService::new(schema.clone(), conf.clone())
.await
.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion apollo-router/src/plugins/authorization/authenticated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1945,7 +1945,7 @@ mod tests {
#[tokio::test]
async fn introspection_mixed_with_authenticated_fields() {
// Note: in https://github.com/apollographql/router/pull/5952/ we moved introspection handling
// before authorization filtering in bridge_query_planner.rs, relying on the fact that queries
// before authorization filtering in query_planner_service.rs, relying on the fact that queries
// mixing introspection and concrete fields are not supported, so introspection answers right
// away. If this ever changes, we should make sure that unauthorized fields are still properly
// filtered out
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,9 +633,8 @@ mod tests {
use tower::Service;

use super::*;
use crate::introspection::IntrospectionCache;
use crate::plugins::authorization::CacheKeyMetadata;
use crate::query_planner::BridgeQueryPlanner;
use crate::query_planner::QueryPlannerService;
use crate::services::layers::query_analysis::ParsedDocument;
use crate::services::query_planner::PlanOptions;
use crate::services::QueryPlannerContent;
Expand Down Expand Up @@ -722,13 +721,9 @@ mod tests {
.unwrap_or_default();
let supergraph_schema = schema.supergraph_schema().clone();

let mut planner = BridgeQueryPlanner::new(
schema.into(),
config.clone(),
Arc::new(IntrospectionCache::new(&config)),
)
.await
.unwrap();
let mut planner = QueryPlannerService::new(schema.into(), config.clone())
.await
.unwrap();

let ctx = Context::new();
ctx.extensions()
Expand Down
4 changes: 2 additions & 2 deletions apollo-router/src/plugins/include_subgraph_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ mod test {
use crate::json_ext::Object;
use crate::plugin::test::MockSubgraph;
use crate::plugin::DynPlugin;
use crate::query_planner::BridgeQueryPlannerPool;
use crate::query_planner::QueryPlannerService;
use crate::router_factory::create_plugins;
use crate::services::layers::persisted_queries::PersistedQueryLayer;
use crate::services::layers::query_analysis::QueryAnalysisLayer;
Expand Down Expand Up @@ -210,7 +210,7 @@ mod test {
include_str!("../../../apollo-router-benchmarks/benches/fixtures/supergraph.graphql");
let schema = Schema::parse(schema, &configuration).unwrap();

let planner = BridgeQueryPlannerPool::new(schema.into(), Arc::clone(&configuration))
let planner = QueryPlannerService::new(schema.into(), Arc::clone(&configuration))
.await
.unwrap();
let schema = planner.schema();
Expand Down
6 changes: 2 additions & 4 deletions apollo-router/src/plugins/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ use tower::{BoxError, ServiceExt};
use tower::ServiceBuilder;
use tower_service::Service;

use crate::introspection::IntrospectionCache;
use crate::plugin::DynPlugin;
use crate::plugin::PluginInit;
use crate::plugin::PluginPrivate;
use crate::query_planner::BridgeQueryPlanner;
use crate::query_planner::QueryPlannerService;
use crate::services::execution;
use crate::services::http;
use crate::services::router;
Expand Down Expand Up @@ -94,8 +93,7 @@ impl<T: Into<Box<dyn DynPlugin + 'static>> + 'static> PluginTestHarness<T> {
let schema = Schema::parse(schema, &config).unwrap();
let sdl = schema.raw_sdl.clone();
let supergraph = schema.supergraph_schema().clone();
let introspection = Arc::new(IntrospectionCache::new(&config));
let planner = BridgeQueryPlanner::new(schema.into(), Arc::new(config), introspection)
let planner = QueryPlannerService::new(schema.into(), Arc::new(config))
.await
.unwrap();
(sdl, supergraph, planner.subgraph_schemas())
Expand Down
4 changes: 2 additions & 2 deletions apollo-router/src/plugins/traffic_shaping/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ mod test {
use crate::plugin::test::MockSubgraph;
use crate::plugin::test::MockSupergraphService;
use crate::plugin::DynPlugin;
use crate::query_planner::BridgeQueryPlannerPool;
use crate::query_planner::QueryPlannerService;
use crate::router_factory::create_plugins;
use crate::services::layers::persisted_queries::PersistedQueryLayer;
use crate::services::layers::query_analysis::QueryAnalysisLayer;
Expand Down Expand Up @@ -528,7 +528,7 @@ mod test {

let config = Arc::new(config);
let schema = Arc::new(Schema::parse(schema, &config).unwrap());
let planner = BridgeQueryPlannerPool::new(schema.clone(), config.clone())
let planner = QueryPlannerService::new(schema.clone(), config.clone())
.await
.unwrap();
let subgraph_schemas = planner.subgraph_schemas();
Expand Down
113 changes: 0 additions & 113 deletions apollo-router/src/query_planner/bridge_query_planner_pool.rs

This file was deleted.

4 changes: 2 additions & 2 deletions apollo-router/src/query_planner/caching_query_planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use crate::plugins::authorization::CacheKeyMetadata;
use crate::plugins::progressive_override::LABELS_TO_OVERRIDE_KEY;
use crate::plugins::telemetry::utils::Timer;
use crate::query_planner::fetch::SubgraphSchemas;
use crate::query_planner::BridgeQueryPlannerPool;
use crate::query_planner::QueryPlannerService;
use crate::services::layers::persisted_queries::PersistedQueryLayer;
use crate::services::layers::query_analysis::ParsedDocument;
use crate::services::layers::query_analysis::QueryAnalysisLayer;
Expand Down Expand Up @@ -338,7 +338,7 @@ where
}
}

impl CachingQueryPlanner<BridgeQueryPlannerPool> {
impl CachingQueryPlanner<QueryPlannerService> {
pub(crate) fn subgraph_schemas(
&self,
) -> Arc<HashMap<String, Arc<Valid<apollo_compiler::Schema>>>> {
Expand Down
6 changes: 2 additions & 4 deletions apollo-router/src/query_planner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@

#![allow(missing_docs)] // FIXME

pub(crate) use bridge_query_planner::*;
pub(crate) use bridge_query_planner_pool::*;
pub(crate) use caching_query_planner::*;
pub use plan::QueryPlan;
pub(crate) use plan::*;
pub(crate) use query_planner_service::*;

pub use self::fetch::OperationKind;

pub(crate) mod bridge_query_planner;
mod bridge_query_planner_pool;
mod caching_query_planner;
mod convert;
mod execution;
pub(crate) mod fetch;
mod labeler;
mod plan;
pub(crate) mod query_planner_service;
pub(crate) mod rewrites;
mod selection;
mod subgraph_context;
Expand Down
Loading