Share via


az iot hub distributed-tracing

Note

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

This command group is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Manage distributed settings per-device.

Commands

Name Description Type Status
az iot hub distributed-tracing show

Get the distributed tracing settings for a device.

Extension Preview
az iot hub distributed-tracing update

Update the distributed tracing options for a device.

Extension Preview

az iot hub distributed-tracing show

Preview

Command group 'iot hub distributed-tracing' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

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 or hostname. 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. If the authentication type is login and the resource hostname is provided, resource lookup will be skipped unless needed.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>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az iot hub distributed-tracing update

Preview

Command group 'iot hub distributed-tracing' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

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 or hostname. 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. If the authentication type is login and the resource hostname is provided, resource lookup will be skipped unless needed.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>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.