Drush commands¶
Native Observability ships nine Drush commands across three modules: native_observability (base), native_observability_metrics, and native_observability_spans. All commands are available once the owning module is enabled.
native_observability:preset:raw¶
Class: PresetInstallCommands::presetRaw. Alias: no:preset:raw.
Enables the RAW tier: native_observability, native_observability_spans, native_observability_metrics, native_observability_cache_observer, native_observability_export. No arguments or options.
drush no:preset:raw
Prints the module list for the tier, which modules were already enabled and skipped, which were newly installed, and next-step hints (configure the Prometheus bearer token before exposing the scrape endpoint publicly).
native_observability:preset:dashboard¶
Class: PresetInstallCommands::presetDashboard. Alias: no:preset:dashboard.
Enables the DASHBOARD tier: RAW plus native_observability_execution, native_observability_database_observer, native_observability_dashboard, native_observability_report, native_observability_status_block. No arguments or options.
drush no:preset:dashboard
Prints the same style of module summary as preset:raw, plus a hint pointing to /admin/reports/native-observability/dashboard.
native_observability:preset:integrations¶
Class: PresetInstallCommands::presetIntegrations. Alias: no:preset:integrations.
Enables the INTEGRATIONS tier: DASHBOARD plus native_observability_otel and native_observability_eca_bridge. No arguments or options. native_observability_eca_bridge_demo is excluded by design and must be enabled separately.
drush no:preset:integrations
Prints the module summary plus hints for configuring the OTLP endpoint and a note that the ECA bridge events are now available to ECA models.
A new install starts at exposure grade 0, so the Prometheus endpoint answers 403 and OpenTelemetry sends nothing until an administrator chooses a grade at /admin/config/development/native-observability/exposure, see External exposure. No Drush command sets the grade.
On a clean site, the very first preset invocation needs the base module enabled first, because Drush only discovers a module's commands once that module is enabled:
drush en native_observability -y
drush no:preset:raw
native_observability:sanity-check¶
Class: SanityCheckCommands::sanityCheck. Alias: no:sanity-check.
Runs ServiceIntegrityInspector::inspect() and prints a table with columns Status, Point, Owner, Detail, one row per checked integration point (decorators, wrappers, middleware, subscribers). No arguments or options.
drush no:sanity-check
Exit code is 0 when the overall status is green or amber (a warning), and 1 when the overall status is error (a conflicting override), so the command can gate test scripts.
native_observability:token:generate¶
Class: TokenCommands::generate. Alias: no:token:generate.
Argument: target, one of prometheus, otlp, or all (default all).
drush no:token:generate all
drush no:token:generate prometheus
drush no:token:generate otlp
Generates a 32-byte random value (64 hex characters) per target and stores it in Drupal State:
| Target | State key |
|---|---|
prometheus |
native_observability_export.secret.prometheus_bearer_token |
otlp |
native_observability_otel.otlp_bearer_token |
A target whose owning module is not enabled is skipped with a warning. The generated token is printed once in the command output. It is never shown again, matching the write-only behavior of the corresponding settings form fields.
native_observability:overhead:measure¶
Class: OverheadCommands::measure. Alias: no:overhead:measure.
Measures the module's overhead per request type, comparing ON and OFF blocks. See Measuring the overhead for what the columns mean and how to read the verdicts.
Options:
| Option | Description |
|---|---|
--pairs |
Measured ON/OFF pairs per workload, on top of one discarded warm-up pair. Default 7 |
--requests |
Sequential requests per block, for the HTTP workloads. Default 15 |
--unit-requests |
Sequential units per block, for the CLI workloads. Default 500 |
--induced-queries |
Sequential SELECT 1 queries per block, for the database statement-event induced-cost row. Default 200 |
--path |
Extra label:/path entry added to the HTTP workload catalog. Repeatable. The label is published if that row is recorded |
--control |
Also run the OFF/OFF control pass that establishes the noise floor. Default on. --no-control skips it |
--keep-rows |
Keep the rows written by ON blocks instead of deleting them at the end. Default off |
--only |
Comma-separated workload labels to run. Empty runs the full catalog |
--record |
Workload label whose row to publish as the measured overhead on the report. Nothing is written when omitted. Cannot be combined with --ledger |
--ledger |
Enable the capture cost ledger for this run and attribute the delta to the ledger-censed functions. Default off |
drush no:overhead:measure
drush no:overhead:measure --path=node:/node/1 --only=front-page,node
drush no:overhead:measure --only=front-page --record=front-page
native_observability:overhead:clear¶
Class: OverheadCommands::clear. Alias: no:overhead:clear.
Deletes the stored overhead measurement and sets the report overhead.display back to hidden. No arguments or options. Prints a notice and succeeds when nothing is stored.
drush no:overhead:clear
native-observability-metric:aggregate¶
Class: NativeObservabilityMetricsCommands::aggregate. Alias: nom:aggregate.
Options:
| Option | Description |
|---|---|
--rolling |
Enable rolling window aggregation. Accepts 1 or 0. Default 0 |
--seconds |
Rolling window duration in seconds, used only when --rolling=1. Default 300 |
drush native-observability-metric:aggregate
drush native-observability-metric:aggregate --rolling=1 --seconds=300
Without --rolling, aggregates the latest completed metrics window via RouteMetricsAggregator::aggregateLatestCompletedWindow. With --rolling=1, aggregates a rolling window ending now via aggregateRollingWindow($seconds). Prints a table with columns Route, Requests, Throughput / min, Avg duration (ms), P95 (ms), P99 (ms). When no metrics are generated, prints a warning and still returns success.
native-observability-span:http-test¶
Class: NativeObservabilitySpansCommands::httpTest. Alias: nos:http-test.
Options:
| Option | Description |
|---|---|
--timeout |
Request timeout in seconds. Default 8 |
--connect-timeout |
Connection timeout in seconds. Default 4 |
drush native-observability-span:http-test
drush native-observability-span:http-test --timeout=5 --connect-timeout=2
Runs a fixed set of outbound HTTP calls through Drupal's http_client service (example.com, Google's generate_204, two httpbin.org status endpoints, and one call to a non-resolving host to exercise the DNS-failure path). Prints a table with columns Test, Method, URL, Status, Error, Body (response body truncated to 250 characters). Purely diagnostic: it validates that the HTTP client decoration used for span generation is producing spans, without asserting on trace storage itself.
Naming note¶
The preset, sanity-check, token, and overhead commands use the underscore namespace native_observability:*. The metric and span commands use the hyphenated namespace native-observability-metric:* and native-observability-span:*. Both forms are correct; use whichever full name or alias is shown above for each command.