Cargo Features

opentelemetry = { version = "0.21.0", default-features = false, features = ["trace", "metrics", "logs", "logs_level_enabled", "testing"] }
default = trace

The trace feature is set by default whenever opentelemetry is added without default-features = false somewhere in the dependency tree.

trace default testing? = pin-project-lite

Affects opentelemetry::trace, testing::trace, opentelemetry::time

metrics testing?

Affects opentelemetry::metrics, opentelemetry::time

logs logs_level_enabled?

Affects opentelemetry::logs

logs_level_enabled = logs

Affects logger::Logger.event_enabled

testing = metrics, trace

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features.

pin-project-lite trace