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
# Enable Azure Monitor OpenTelemetry for .NET, Node.js, Python and Java applications
12
+
# Enable Azure Monitor OpenTelemetry for .NET, Node.js, Python, and Java applications
13
13
14
14
This article describes how to enable and configure OpenTelemetry-based data collection to power the experiences within [Azure Monitor Application Insights](app-insights-overview.md#application-insights-overview). We walk through how to install the "Azure Monitor OpenTelemetry Distro." The Distro [automatically collects](opentelemetry-add-modify.md#automatic-data-collection) traces, metrics, logs, and exceptions across your application and its dependencies. To learn more about collecting data using OpenTelemetry, see [Data Collection Basics](opentelemetry-overview.md) or [OpenTelemetry FAQ](#frequently-asked-questions).
15
15
16
16
## OpenTelemetry Release Status
17
17
18
-
OpenTelemetry offerings are available for .NET, Node.js, Python and Java applications.
18
+
OpenTelemetry offerings are available for .NET, Node.js, Python, and Java applications.
19
19
20
20
> [!NOTE]
21
21
> For a feature-by-feature release status, see the [FAQ](#whats-the-current-release-state-of-features-within-the-azure-monitor-opentelemetry-distro).
@@ -133,7 +133,7 @@ To enable Azure Monitor Application Insights, you make a minor modification to y
133
133
134
134
##### [ASP.NET Core](#tab/aspnetcore)
135
135
136
-
Add `UseAzureMonitor()` to your application startup. This is in your `program.cs` class.
136
+
Add `UseAzureMonitor()` to your application startup, located in your `program.cs` class.
137
137
138
138
```csharp
139
139
// Import the Azure.Monitor.OpenTelemetry.AspNetCore namespace.
@@ -188,7 +188,7 @@ var loggerFactory = LoggerFactory.Create(builder =>
188
188
189
189
Java autoinstrumentation is enabled through configuration changes; no code changes are required.
190
190
191
-
Point the JVM to the jar file by adding `-javaagent:"path/to/applicationinsights-agent-3.5.0.jar"` to your application's JVM args.
191
+
Point the Java virtual machine (JVM) to the jar file by adding `-javaagent:"path/to/applicationinsights-agent-3.5.0.jar"` to your application's JVM args.
192
192
193
193
> [!TIP]
194
194
> Sampling is enabled by default at a rate of 5 requests per second, aiding in cost management. Telemetry data may be missing in scenarios exceeding this rate. For more information on modifying sampling configuration, see [sampling overrides](./java-standalone-sampling-overrides.md).
@@ -219,21 +219,9 @@ from azure.monitor.opentelemetry import configure_azure_monitor
219
219
# Import the tracing api from the `opentelemetry` package.
220
220
from opentelemetry import trace
221
221
222
-
# Configure OpenTelemetry to use Azure Monitor with the specified connection
223
-
# string.
224
-
configure_azure_monitor(
225
-
connection_string="<Your Connection String>",
226
-
)
227
-
228
-
# Get a tracer for the current module.
229
-
tracer = trace.get_tracer(__name__)
230
-
231
-
# Start a new span with the name "hello". This also sets this created span as the current span in this context. This span will be exported to Azure Monitor as part of the trace.
232
-
with tracer.start_as_current_span("hello"):
233
-
print("Hello, World!")
234
-
235
-
# Wait for export to take place in the background.
236
-
input()
222
+
# Configure OpenTelemetry to use Azure Monitor with the
@@ -304,8 +292,8 @@ As part of using Application Insights instrumentation, we collect and send diagn
304
292
305
293
### [ASP.NET Core](#tab/aspnetcore)
306
294
307
-
- For details on adding and modifying Azure Monitor OpenTelemetry, see [Add and modify Azure Monitor OpenTelemetry](opentelemetry-add-modify.md)
308
-
- To further configure the OpenTelemetry distro, see [Azure Monitor OpenTelemetry configuration](opentelemetry-configuration.md)
295
+
- For details on adding and modifying Azure Monitor OpenTelemetry, see [Add and modify Azure Monitor OpenTelemetry](opentelemetry-add-modify.md).
296
+
- To further configure the OpenTelemetry distro, see [Azure Monitor OpenTelemetry configuration](opentelemetry-configuration.md).
309
297
- To review the source code, see the [Azure Monitor AspNetCore GitHub repository](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore).
310
298
- To install the NuGet package, check for updates, or view release notes, see the [Azure Monitor AspNetCore NuGet Package](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.AspNetCore) page.
311
299
- To become more familiar with Azure Monitor and OpenTelemetry, see the [Azure Monitor Example Application](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Demo).
@@ -314,8 +302,8 @@ As part of using Application Insights instrumentation, we collect and send diagn
314
302
315
303
#### [.NET](#tab/net)
316
304
317
-
- For details on adding and modifying Azure Monitor OpenTelemetry, see [Add and modify Azure Monitor OpenTelemetry](opentelemetry-add-modify.md)
318
-
- To further configure the OpenTelemetry distro, see [Azure Monitor OpenTelemetry configuration](opentelemetry-configuration.md)
305
+
- For details on adding and modifying Azure Monitor OpenTelemetry, see [Add and modify Azure Monitor OpenTelemetry](opentelemetry-add-modify.md).
306
+
- To further configure the OpenTelemetry distro, see [Azure Monitor OpenTelemetry configuration](opentelemetry-configuration.md).
319
307
- To review the source code, see the [Azure Monitor Exporter GitHub repository](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter).
320
308
- To install the NuGet package, check for updates, or view release notes, see the [Azure Monitor Exporter NuGet Package](https://www.nuget.org/packages/Azure.Monitor.OpenTelemetry.Exporter) page.
321
309
- To become more familiar with Azure Monitor and OpenTelemetry, see the [Azure Monitor Example Application](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Demo).
@@ -324,7 +312,7 @@ As part of using Application Insights instrumentation, we collect and send diagn
324
312
325
313
### [Java](#tab/java)
326
314
327
-
- For details on adding and modifying Azure Monitor OpenTelemetry, see [Add and modify Azure Monitor OpenTelemetry](opentelemetry-add-modify.md)
315
+
- For details on adding and modifying Azure Monitor OpenTelemetry, see [Add and modify Azure Monitor OpenTelemetry](opentelemetry-add-modify.md).
- To review the source code, see the [Azure Monitor Java autoinstrumentation GitHub repository](https://github.com/Microsoft/ApplicationInsights-Java).
330
318
- To learn more about OpenTelemetry and its community, see the [OpenTelemetry Java GitHub repository](https://github.com/open-telemetry/opentelemetry-java-instrumentation).
@@ -333,7 +321,7 @@ As part of using Application Insights instrumentation, we collect and send diagn
333
321
334
322
### [Node.js](#tab/nodejs)
335
323
336
-
- For details on adding and modifying Azure Monitor OpenTelemetry, see [Add and modify Azure Monitor OpenTelemetry](opentelemetry-add-modify.md)
324
+
- For details on adding and modifying Azure Monitor OpenTelemetry, see [Add and modify Azure Monitor OpenTelemetry](opentelemetry-add-modify.md).
337
325
- To review the source code, see the [Azure Monitor OpenTelemetry GitHub repository](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/monitor/monitor-opentelemetry).
338
326
- To install the npm package and check for updates, see the [`@azure/monitor-opentelemetry` npm Package](https://www.npmjs.com/package/@azure/monitor-opentelemetry) page.
339
327
- To become more familiar with Azure Monitor Application Insights and OpenTelemetry, see the [Azure Monitor Example Application](https://github.com/Azure-Samples/azure-monitor-opentelemetry-node.js).
@@ -342,7 +330,7 @@ As part of using Application Insights instrumentation, we collect and send diagn
342
330
343
331
### [Python](#tab/python)
344
332
345
-
- For details on adding and modifying Azure Monitor OpenTelemetry, see [Add and modify Azure Monitor OpenTelemetry](opentelemetry-add-modify.md)
333
+
- For details on adding and modifying Azure Monitor OpenTelemetry, see [Add and modify Azure Monitor OpenTelemetry](opentelemetry-add-modify.md).
346
334
- To review the source code and extra documentation, see the [Azure Monitor Distro GitHub repository](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-opentelemetry/README.md).
347
335
- To see extra samples and use cases, see [Azure Monitor Distro samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/monitor/azure-monitor-opentelemetry/samples).
348
336
- See the [changelog](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/monitor/azure-monitor-opentelemetry/CHANGELOG.md) on GitHub.
0 commit comments