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/opentelemetry-enable.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -484,11 +484,11 @@ provider.register();
484
484
485
485
#### [Python](#tab/python)
486
486
487
-
Calling`configure_azure_monitor`will already automatically use the
488
-
`ApplicationInsightsSampler` under the hood, which offers compatibility with
489
-
Application Insights SDKs and performs sampling for your telemetry. You can pass
490
-
the `sampling_ratio` parameter, which takes a value between 0 and 1 inclusive. A
491
-
rate of 0.1 means approximately 10% of your traces will be sent.
487
+
The`configure_azure_monitor()` function will automatically utilize
488
+
ApplicationInsightsSampler for compatibility with Application Insights SDKs and
489
+
to sample your telemetry. The `sampling_ratio` parameter can be used to specify
490
+
the sampling rate, with a valid range of 0 to 1, where 0 is 0% and 1 is 100%.
491
+
For example, a value of 0.1 means 10% of your traces will be sent.
492
492
493
493
```python
494
494
from azure.monitor.opentelemetry import configure_azure_monitor
@@ -1347,9 +1347,11 @@ Coming soon.
1347
1347
1348
1348
#### Use the OpenTelemetry API
1349
1349
1350
-
The simplest way to add your own spans is by using OpenTelemetry's `@WithSpan` annotation.
1350
+
The OpenTelemetry API can be used to add your own spans, which will appear in
1351
+
the `requests` and `dependencies` tables in Application Insights.
1351
1352
1352
-
Spans populate the `requests` and `dependencies` tables in Application Insights.
1353
+
The code example shows how to use the `tracer.start_as_current_span()` method to
1354
+
start, make the span current, and end the span within its context.
1353
1355
1354
1356
```python
1355
1357
...
@@ -1367,7 +1369,7 @@ with tracer.start_as_current_span("my first span") as span:
1367
1369
1368
1370
```
1369
1371
1370
-
By default, the span will end up in the `dependencies` table with dependency type `InProc`.
1372
+
By default, the span will be in the `dependencies` table with a dependency type of`InProc`.
1371
1373
1372
1374
If your method represents a background job that isn't already captured by
1373
1375
auto-instrumentation, we recommend that you set the attribute `kind =
@@ -1798,11 +1800,11 @@ Coming soon.
1798
1800
1799
1801
#### [Python](#tab/python)
1800
1802
1801
-
The Python [logging](https://docs.python.org/3/howto/logging.html) library is [auto-instrumented](#logs). Attaching custom dimensions to your logs by passing a dictionary into the `extra` argument of your logs.
1803
+
The Python [logging](https://docs.python.org/3/howto/logging.html) library is [auto-instrumented](#logs). You can attach custom dimensions to your logs by passing a dictionary into the `extra` argument of your logs.
1802
1804
1803
1805
```python
1804
1806
...
1805
-
logger.warning("WARNGIN: Warning log with properties", extra={"key1": "value1"})
1807
+
logger.warning("WARNING: Warning log with properties", extra={"key1": "value1"})
1806
1808
...
1807
1809
1808
1810
```
@@ -1919,7 +1921,7 @@ Use the add [custom property example](#add-a-custom-property-to-a-span), but rep
ThefollowingexampleshowshowtoexcludeacertainURLfrombeingtrackedbyusingthe [Flask](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-flask) instrumentation configuration options in `configure_azure_monitor()`.
1924
+
ThefollowingexampleshowshowtoexcludeaspecificURLfrombeingtrackedbyusingthe [Flask](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-flask) instrumentation configuration options in the `configure_azure_monitor()` function.
0 commit comments