az iot hub distributed-tracing

Note

This reference is part of the azure-iot extension for the Azure CLI (version 2.32.0 or higher). The extension will automatically install the first time you run an az iot hub distributed-tracing command. Learn more about extensions.

Manage distributed settings per-device.

Commands

az iot hub distributed-tracing show

Get the distributed tracing settings for a device.

az iot hub distributed-tracing update

Update the distributed tracing options for a device.

az iot hub distributed-tracing show

Get the distributed tracing settings for a device.

az iot hub distributed-tracing show --device-id
                                    --hub-name
                                    [--auth-type {key, login}]
                                    [--resource-group]

Examples

Get the distributed tracing settings for a device

az iot hub distributed-tracing show -d {device_id} -n {iothub_name}

Required Parameters

--device-id -d

Target Device Id.

--hub-name -n

IoT Hub name. Required if --login is not provided.

Optional Parameters

--auth-type

Indicates whether the operation should auto-derive a policy key or use the current Azure AD session. You can configure the default using az configure --defaults iothub-data-auth-type=<auth-type-value>.

accepted values: key, login
default value: key
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az iot hub distributed-tracing update

Update the distributed tracing options for a device.

az iot hub distributed-tracing update --device-id
                                      --hub-name
                                      --sampling-mode {off, on}
                                      --sampling-rate
                                      [--auth-type {key, login}]
                                      [--resource-group]

Examples

Update the distributed tracing options for a device

az iot hub distributed-tracing update -d {device_id} --sm on --sr 50 -n {iothub_name}

Required Parameters

--device-id -d

Target Device Id.

--hub-name -n

IoT Hub name. Required if --login is not provided.

--sampling-mode --sm

Turns sampling for distributed tracing on and off. 1 is On and, 2 is Off.

accepted values: off, on
--sampling-rate --sr

Controls the amount of messages sampled for adding trace context. This value isa percentage. Only values from 0 to 100 (inclusive) are permitted.

Optional Parameters

--auth-type

Indicates whether the operation should auto-derive a policy key or use the current Azure AD session. You can configure the default using az configure --defaults iothub-data-auth-type=<auth-type-value>.

accepted values: key, login
default value: key
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.