Skip to content

Commit 773fcdc

Browse files
committed
Update opentelemetry-add-modify.md
1 parent c42ff72 commit 773fcdc

File tree

1 file changed

+27
-49
lines changed

1 file changed

+27
-49
lines changed

articles/azure-monitor/app/opentelemetry-add-modify.md

Lines changed: 27 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,56 +1195,10 @@ with tracer.start_as_current_span("my request span", kind=SpanKind.SERVER) as sp
11951195

11961196
---
11971197

1198-
### Add Custom Events
1199-
1200-
The OpenTelemetry Events API is still under development. In the meantime, there are workarounds for each language to allow sending of "custom events", which populate the customEvents table in Application Insights.
1201-
1202-
#### [ASP.NET Core](#tab/aspnetcore)
1203-
1204-
Currently unavailable.
1205-
1206-
#### [.NET](#tab/net)
1207-
1208-
Currently unavailable.
1209-
1210-
#### [Java](#tab/java)
1211-
1212-
Currently unavailable.
1213-
1214-
#### [Node.js](#tab/nodejs)
1215-
1216-
Currently unavailable.
1217-
1218-
#### [Python](#tab/python)
1219-
1220-
Until the OpenTelemetry Events API is stable, the [Azure Monitor Events Extension](https://pypi.org/project/azure-monitor-events-extension/0.1.0/) can be used in conjunction with the Azure Monitor OpenTelemetry Distro to send customEvents to Application Insights.
1221-
1222-
Install the distro and the extension:
1223-
1224-
```console
1225-
pip install azure-monitor-opentelemetry
1226-
pip install azure-monitor-events-extension
1227-
```
1228-
1229-
Use the `track_event` API offered in the extension to send customEvents.
1230-
1231-
```python
1232-
...
1233-
from azure.monitor.events.extension import track_event
1234-
from azure.monitor.opentelemetry import configure_azure_monitor
1235-
1236-
configure_azure_monitor()
1237-
1238-
# Use the track_event() api to send custom event telemetry
1239-
# Takes event name and custom dimensions
1240-
track_event("Test event", {"key1": "value1", "key2": "value2"})
1241-
1242-
input()
1243-
...
1244-
```
1245-
12461198
<!--
12471199
1200+
### Add Custom Events
1201+
12481202
#### Span Events
12491203
12501204
The OpenTelemetry Logs/Events API is still under development. In the meantime, you can use the OpenTelemetry Span API to create "Span Events", which populate the traces table in Application Insights. The string passed in to addEvent() is saved to the message field within the trace.
@@ -1419,7 +1373,31 @@ Then use the `TelemetryClient` to send custom telemetry:
14191373

14201374
#### [Python](#tab/python)
14211375

1422-
It isn't available in Python.
1376+
Unlike the other languages, there does not exist an Application Insights SDK for Python. You will be able to achieve all your monitoring needs with the Azure Monitor OpenTelemetry Distro, except for sending `customEvents`. Until the OpenTelemetry Events API is stable, the [Azure Monitor Events Extension](https://pypi.org/project/azure-monitor-events-extension/0.1.0/) can be used in conjunction with the Azure Monitor OpenTelemetry Distro to send `customEvents` to Application Insights.
1377+
1378+
Install the distro and the extension:
1379+
1380+
```console
1381+
pip install azure-monitor-opentelemetry
1382+
pip install azure-monitor-events-extension
1383+
```
1384+
1385+
Use the `track_event` API offered in the extension to send customEvents.
1386+
1387+
```python
1388+
...
1389+
from azure.monitor.events.extension import track_event
1390+
from azure.monitor.opentelemetry import configure_azure_monitor
1391+
1392+
configure_azure_monitor()
1393+
1394+
# Use the track_event() api to send custom event telemetry
1395+
# Takes event name and custom dimensions
1396+
track_event("Test event", {"key1": "value1", "key2": "value2"})
1397+
1398+
input()
1399+
...
1400+
```
14231401

14241402
---
14251403

0 commit comments

Comments
 (0)