| page_type | sample | |
|---|---|---|
| languages |
|
|
| products |
|
These code samples show common champion scenario operations with the AzureMonitorTraceExporter.
- Trace: sample_trace.py
- Client: sample_client.py
- Server: sample_server.py
- Azure Service Bus Send: sample_servicebus_send.py
- Azure Service Bus Receive: sample_servicebus_receive.py
$ pip install azure-opentelemetry-exporter-azuremonitor --pre-
Update
APPLICATIONINSIGHTS_CONNECTION_STRINGenvironment variable -
Run the sample
$ # from this directory
$ python sample_trace.py-
Update
APPLICATIONINSIGHTS_CONNECTION_STRINGenvironment variable -
Run the sample
$ pip install opentelemetry-instrumentation-requests
$ # from this directory
$ python sample_request.py-
Update
APPLICATIONINSIGHTS_CONNECTION_STRINGenvironment variable -
Run the sample
$ pip install opentelemetry-instrumentation-requests
$ pip install opentelemetry-instrumentation-flask
$ # from this directory
$ python sample_server.pyThe following sample assumes that you have setup an Azure Service Bus namespace.
-
Update
APPLICATIONINSIGHTS_CONNECTION_STRINGenvironment variable -
Update
SERVICE_BUS_CONN_STRenvironment variable -
Update
SERVICE_BUS_QUEUE_NAMEenvironment variable -
Run the sample
$ # azure-servicebus library
$ pip install azure-servicebus
$ # azure sdk core tracing library for opentelemetry
$ pip install azure-core-tracing-opentelemetry
$ # from this directory
$ python sample_servicebus_send.pyThe following sample assumes that you have setup an Azure Service Bus namespace.
-
Update
APPLICATIONINSIGHTS_CONNECTION_STRINGenvironment variable -
Update
SERVICE_BUS_CONN_STRenvironment variable -
Update
SERVICE_BUS_QUEUE_NAMEenvironment variable -
Run the sample
$ # azure-servicebus library
$ pip install azure-servicebus
$ # azure sdk core tracing library for opentelemetry
$ pip install azure-core-tracing-opentelemetry
$ # from this directory
$ python sample_servicebus_receive.pyAfter running the applications, data would be available in Azure