Cargo Features

[dependencies]
apollo-router = { version = "2.0.0-preview.6", default-features = false, features = ["global-allocator", "dhat-heap", "dhat-ad-hoc", "failfast", "telemetry_next", "ci", "snapshot"] }
default = global-allocator

The global-allocator feature is set by default whenever apollo-router is added without default-features = false somewhere in the dependency tree.

global-allocator default

Set the Rust global allocator on some platforms https://doc.rust-lang.org/std/alloc/index.html#the-global_allocator-attribute Enabled by default. Disable default features in library crates or to set it yourself:

[dependencies]
apollo-router = {version = "1.20", default-features = false}
dhat-heap = dhat

if you are doing heap profiling

dhat-ad-hoc = dhat
failfast

Prevents the query execution to continue if any error occurs while fetching the data of a subgraph. This is useful in development as you want to be alerted early when something is wrong instead of receiving an invalid result.

telemetry_next

Enables the use of new telemetry features that are under development and not yet ready for production use.

ci

is set when ci builds take place. It allows us to disable some tests when CI is running on certain platforms.

snapshot = axum-server

Enables the HTTP snapshot server for testing

Required by the snapshot binary

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

axum-server snapshot?
dhat dhat-ad-hoc? dhat-heap?