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
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/opencensus-python.md
+28-28Lines changed: 28 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -251,13 +251,13 @@ For details on how to modify tracked telemetry before it is sent to Azure Monito
251
251
252
252
By default, the metrics exporter will send a set of standard metrics to Azure Monitor. You can disable this by setting the `enable_standard_metrics` flag to `False`in the constructor of the metrics exporter.
Below is a list of standard metrics that are currently sent:
262
262
263
263
- Available Memory (bytes)
@@ -335,8 +335,8 @@ For details on how to modify tracked telemetry before it is sent to Azure Monito
335
335
336
336
4. The exporter will send log data to Azure Monitor. You can find the data under `traces`.
337
337
338
-
> [!NOTE]
339
-
>`traces`in this context isnot the same as`Tracing`. `traces` refers to the type of telemetry that you will see in Azure Monitor when utilizing the `AzureLogHandler`. `Tracing` refers to a concept in OpenCensus and relates to [distributed tracing](https://docs.microsoft.com/azure/azure-monitor/app/distributed-tracing).
338
+
> [!NOTE]
339
+
>`traces`in this context isnot the same as`Tracing`. `traces` refers to the type of telemetry that you will see in Azure Monitor when utilizing the `AzureLogHandler`. `Tracing` refers to a concept in OpenCensus and relates to [distributed tracing](https://docs.microsoft.com/azure/azure-monitor/app/distributed-tracing).
340
340
341
341
5. To format your log messages, you can use `formatters`in the built-in Python [logging API](https://docs.python.org/3/library/logging.html#formatter-objects).
342
342
@@ -368,8 +368,8 @@ For details on how to modify tracked telemetry before it is sent to Azure Monito
368
368
```
369
369
370
370
6. You can also add custom properties to your log messages in the *extra* keyword argument using the custom_dimensions field. These will appear as key-value pairs in`customDimensions`in Azure Monitor.
371
-
> [!NOTE]
372
-
> For this feature to work, you need to pass a dictionary to the custom_dimensions field. If you pass arguments of any other type, the logger will ignore them.
371
+
> [!NOTE]
372
+
> For this feature to work, you need to pass a dictionary to the custom_dimensions field. If you pass arguments of any other type, the logger will ignore them.
373
373
374
374
```python
375
375
import logging
@@ -392,25 +392,25 @@ For details on how to modify tracked telemetry before it is sent to Azure Monito
392
392
393
393
OpenCensus Python does not automatically track and send `exception` telemetry. They are sent through the `AzureLogHandler` by using exceptions through the Python logging library. You can add custom properties just like with normal logging.
394
394
395
-
```python
396
-
import logging
397
-
398
-
from opencensus.ext.azure.log_exporter import AzureLogHandler
399
-
400
-
logger= logging.getLogger(__name__)
401
-
#TODO: replace the all-zero GUID with your instrumentation key.
logger.exception('Captured an exception.', extra=properties)
413
+
```
414
414
Since you must log exceptions explicitly, it is up to the user in how they want to log unhandled exceptions. OpenCensus does not place restrictions in how a user wants to do this, aslongas they explicitly log an exception telemetry.
0 commit comments