You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 16, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: contrib/opencensus-ext-azure/README.rst
+30-20Lines changed: 30 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,8 +24,8 @@ The **Azure Monitor Log Handler** allows you to export Python logs to `Azure Mon
24
24
This example shows how to send a warning level log to Azure Monitor.
25
25
26
26
* Create an Azure Monitor resource and get the instrumentation key, more information can be found `here <https://docs.microsoft.com/azure/azure-monitor/app/create-new-resource>`_.
27
-
* Put the instrumentation key in ``APPINSIGHTS_INSTRUMENTATIONKEY`` environment variable.
28
-
* You can also specify the instrumentation key explicitly in the code, which will take priority over a set environment variable.
27
+
* Place your instrumentation key in a `connection string` and directly into your code.
28
+
* Alternatively, you can specify your `connection string` in an environment variable ``APPLICATIONINSIGHTS_CONNECTION_STRING``.
29
29
30
30
.. code:: python
31
31
@@ -34,15 +34,16 @@ This example shows how to send a warning level log to Azure Monitor.
34
34
from opencensus.ext.azure.log_exporter import AzureLogHandler
* Alternatively, you can specify your `connection string` in an environment variable ``APPLICATIONINSIGHTS_CONNECTION_STRING``.
41
+
40
42
You can enrich the logs with trace IDs and span IDs by using the `logging integration <../opencensus-ext-logging>`_.
41
43
42
44
* Create an Azure Monitor resource and get the instrumentation key, more information can be found `here <https://docs.microsoft.com/azure/azure-monitor/app/create-new-resource>`_.
43
-
* Install the `logging integration package <../opencensus-ext-logging>`_ using ``pip install opencensus-ext-logging``.
44
-
* Put the instrumentation key in ``APPINSIGHTS_INSTRUMENTATIONKEY`` environment variable.
45
-
* You can also specify the instrumentation key explicitly in the code, which will take priority over a set environment variable.
45
+
* Place your instrumentation key in a `connection string` and directly into your code.
46
+
* Alternatively, you can specify your `connection string` in an environment variable ``APPLICATIONINSIGHTS_CONNECTION_STRING``.
46
47
47
48
.. code:: python
48
49
@@ -58,25 +59,28 @@ You can enrich the logs with trace IDs and span IDs by using the `logging integr
The **Azure Monitor Metrics Exporter** allows you to export metrics to `Azure Monitor`_.
76
80
77
81
* Create an Azure Monitor resource and get the instrumentation key, more information can be found `here <https://docs.microsoft.com/azure/azure-monitor/app/create-new-resource>`_.
78
-
* Put the instrumentation key in ``APPINSIGHTS_INSTRUMENTATIONKEY`` environment variable.
79
-
* You can also specify the instrumentation key explicitly in the code, which will take priority over a set environment variable.
82
+
* Place your instrumentation key in a `connection string` and directly into your code.
83
+
* Alternatively, you can specify your `connection string` in an environment variable ``APPLICATIONINSIGHTS_CONNECTION_STRING``.
80
84
81
85
.. code:: python
82
86
@@ -105,7 +109,7 @@ The **Azure Monitor Metrics Exporter** allows you to export metrics to `Azure Mo
105
109
defmain():
106
110
# Enable metrics
107
111
# Set the interval in seconds in which you want to send metrics
@@ -154,6 +158,7 @@ Below is a list of standard metrics that are currently available:
154
158
- Available Memory (bytes)
155
159
- CPU Processor Time (percentage)
156
160
- Incoming Request Rate (per second)
161
+
- Incoming Request Average Execution Time (milliseconds)
157
162
- Outgoing Request Rate (per second)
158
163
- Process CPU Usage (percentage)
159
164
- Process Private Bytes (bytes)
@@ -166,26 +171,31 @@ The **Azure Monitor Trace Exporter** allows you to export `OpenCensus`_ traces t
166
171
This example shows how to send a span "hello" to Azure Monitor.
167
172
168
173
* Create an Azure Monitor resource and get the instrumentation key, more information can be found `here <https://docs.microsoft.com/azure/azure-monitor/app/create-new-resource>`_.
169
-
* Put the instrumentation key in ``APPINSIGHTS_INSTRUMENTATIONKEY`` environment variable.
170
-
* You can also specify the instrumentation key explicitly in the code, which will take priority over a set environment variable.
174
+
* Place your instrumentation key in a `connection string` and directly into your code.
175
+
* Alternatively, you can specify your `connection string` in an environment variable ``APPLICATIONINSIGHTS_CONNECTION_STRING``.
171
176
172
-
.. code:: python
177
+
.. code:: python
173
178
174
179
from opencensus.ext.azure.trace_exporter import AzureExporter
175
180
from opencensus.trace.samplers import ProbabilitySampler
You can also specify the instrumentation key explicitly in the code.
191
+
OpenCensus also supports several [integrations](https://github.com/census-instrumentation/opencensus-python#integration) which allows OpenCensus to integrate with third party libraries.
192
+
193
+
This example shows how to integrate with the [requests](https://2.python-requests.org/en/master/) library.
184
194
185
195
* Create an Azure Monitor resource and get the instrumentation key, more information can be found `here <https://docs.microsoft.com/azure/azure-monitor/app/create-new-resource>`_.
186
196
* Install the `requests integration package <../opencensus-ext-requests>`_ using ``pip install opencensus-ext-requests``.
187
-
* Put the instrumentation key in ``APPINSIGHTS_INSTRUMENTATIONKEY`` environment variable.
188
-
* You can also specify the instrumentation key explicitly in the code, which will take priority over a set environment variable.
197
+
* Place your instrumentation key in a `connection string` and directly into your code.
198
+
* Alternatively, you can specify your `connection string` in an environment variable ``APPLICATIONINSIGHTS_CONNECTION_STRING``.
0 commit comments