Skip to main content

Enable-ZrTrace

Turns on runtime distributed tracing for a Zaris store or a single instance, with no restart. An optional duration auto-disables tracing after a set number of seconds.

Syntax

Enable-ZrTrace [-Store] <string> [[-Instance] <string>] [-Seconds <int>]
[-ManagementUrl <string>]

Description

Enable-ZrTrace enables live tracing by POSTing to the Management Service trace endpoint, which relays TRACE ON [seconds] over the target node's stdin control channel — no restart is required.

Unlike the data-plane cmdlets, this command targets the Management Service at -ManagementUrl rather than a connected store, so it does not use a Connect-ZrStore session or the -StoreName/-Endpoints parameters. Omit -Instance to enable tracing on all instances of the store; supply it to target one node. A positive -Seconds auto-disables tracing after that many seconds, while 0 or an omitted value leaves it on until the node stops or Disable-ZrTrace is run.

The returned object has Store, Instance ((all) when no instance was specified), Enabled ($true), Seconds (the duration or indefinite), Success, and Response (the Management Service response body).

Parameters

ParameterTypeRequiredDescription
-StoreStringYesThe name of the store whose tracing should be enabled. Position 0.
-InstanceStringNoThe specific instance (node) name to target. Position 1. Omit to apply to all instances of the store.
-SecondsInt32NoAuto-disables tracing after this many seconds. 0 or omitted leaves it on indefinitely, until the node stops or Disable-ZrTrace is run.
-ManagementUrlStringNoBase URL of the Management Service to send the trace command to. Default http://localhost:7801.

Examples

Enable tracing on all instances of a store, indefinitely:

Enable-ZrTrace -Store "orders"

Enable tracing on all instances and auto-disable after 120 seconds:

Enable-ZrTrace -Store "orders" -Seconds 120

Enable tracing on a single instance:

Enable-ZrTrace -Store "orders" -Instance "zaris-n0"

Target a remote Management Service:

Enable-ZrTrace -Store "orders" -ManagementUrl "http://zaris-manager:7801"