Skip to content

Commit 73716e5

Browse files
committed
Moving content from troubleshooting articles to includes
1 parent f754867 commit 73716e5

File tree

1 file changed

+185
-23
lines changed

1 file changed

+185
-23
lines changed

articles/azure-monitor/includes/azure-monitor-app-insights-opentelemetry-support.md

Lines changed: 185 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,62 +6,224 @@ ms.topic: include
66
ms.date: 08/26/2023
77
---
88

9-
## Troubleshooting (old)
9+
## Troubleshooting
1010

1111
### [ASP.NET Core](#tab/aspnetcore)
1212

13-
Not working? Check out the troubleshooting page for [ASP.NET Core](/troubleshoot/azure/azure-monitor/app-insights/opentelemetry-troubleshooting-dotnet).
13+
#### Step 1: Enable diagnostic logging
1414

15-
#### [.NET](#tab/net)
15+
The Azure Monitor Exporter uses EventSource for its internal logging. The exporter logs are available to any EventListener by opting in to the source that's named `OpenTelemetry-AzureMonitor-Exporter`. For troubleshooting steps, see [OpenTelemetry Troubleshooting](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry#troubleshooting) on GitHub.
1616

17-
Not working? Check out the troubleshooting page for [.NET](/troubleshoot/azure/azure-monitor/app-insights/opentelemetry-troubleshooting-dotnet).
17+
#### Step 2: Test connectivity between your application host and the ingestion service
1818

19-
### [Java](#tab/java)
19+
Application Insights SDKs and agents send telemetry to get ingested as REST calls at our ingestion endpoints. To test connectivity from your web server or application host computer to the ingestion service endpoints, use cURL commands or raw REST requests from PowerShell. For more information, see [Troubleshoot missing application telemetry in Azure Monitor Application Insights](../investigate-missing-telemetry.md).
2020

21-
Not working? Check out the troubleshooting page for [Java](/troubleshoot/azure/azure-monitor/app-insights/opentelemetry-troubleshooting-java).
21+
#### Known issues
2222

23-
### [Java native](#tab/java-native)
23+
The following items are known issues for the Azure Monitor OpenTelemetry Exporters:
2424

25-
Not working? Check out the troubleshooting page for [Java](/troubleshoot/azure/azure-monitor/app-insights/opentelemetry-troubleshooting-java).
25+
- The operation name is missing from dependency telemetry. The missing operation name causes failures and adversely affects performance tab experience.
2626

27-
### [Node.js](#tab/nodejs)
27+
- The device model is missing from request and dependency telemetry. The missing device model adversely affects device cohort analysis.
2828

29-
Not working? Check out the troubleshooting page for [Node.js](/troubleshoot/azure/azure-monitor/app-insights/opentelemetry-troubleshooting-nodejs).
29+
### [.NET](#tab/net)
3030

31-
### [Python](#tab/python)
31+
#### Step 1: Enable diagnostic logging
3232

33-
Not working? Check out the troubleshooting page for [Python](/troubleshoot/azure/azure-monitor/app-insights/opentelemetry-troubleshooting-python).
33+
The Azure Monitor Exporter uses EventSource for its internal logging. The exporter logs are available to any EventListener by opting in to the source that's named `OpenTelemetry-AzureMonitor-Exporter`. For troubleshooting steps, see [OpenTelemetry Troubleshooting](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry#troubleshooting) on GitHub.
3434

35-
---
35+
#### Step 2: Test connectivity between your application host and the ingestion service
3636

37-
## Troubleshooting (new)
37+
Application Insights SDKs and agents send telemetry to get ingested as REST calls at our ingestion endpoints. To test connectivity from your web server or application host computer to the ingestion service endpoints, use cURL commands or raw REST requests from PowerShell. For more information, see [Troubleshoot missing application telemetry in Azure Monitor Application Insights](../investigate-missing-telemetry.md).
3838

39-
### [ASP.NET Core](#tab/aspnetcore)
39+
#### Known issues
4040

41-
...
41+
The following items are known issues for the Azure Monitor OpenTelemetry Exporters:
4242

43-
### [.NET](#tab/net)
43+
- The operation name is missing from dependency telemetry. The missing operation name causes failures and adversely affects performance tab experience.
4444

45-
...
45+
- The device model is missing from request and dependency telemetry. The missing device model adversely affects device cohort analysis.
4646

4747
### [Java](#tab/java)
4848

49-
...
49+
#### Step 1: Enable diagnostic logging
50+
51+
By default, diagnostic logging is enabled in Azure Monitor Application Insights. For more information, see [Troubleshoot guide: Azure Monitor Application Insights for Java](java-standalone-troubleshoot.md).
52+
53+
#### Step 2: Test connectivity between your application host and the ingestion service
54+
55+
Application Insights SDKs and agents send telemetry to get ingested as REST calls at our ingestion endpoints. To test connectivity from your web server or application host computer to the ingestion service endpoints, use cURL commands or raw REST requests from PowerShell. For more information, see [Troubleshoot missing application telemetry in Azure Monitor Application Insights](../investigate-missing-telemetry.md).
56+
57+
#### Known issues
58+
59+
- If you [download the Application Insights client library for installation](/azure/azure-monitor/app/opentelemetry-enable?tabs=java#install-the-client-libraries) from a browser, sometimes the downloaded JAR file is corrupted and is about half the size of the source file. If you experience this problem, download the JAR file by running the [curl](https://curl.se) or [wget](https://www.gnu.org/software/wget/) command, as shown in the following example command calls:
60+
61+
```bash
62+
curl --location --output applicationinsights-agent-3.4.11.jar https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.4.11/applicationinsights-agent-3.4.11.jar
63+
```
64+
65+
```bash
66+
wget --output-document=applicationinsights-agent-3.4.11.jar https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.4.11/applicationinsights-agent-3.4.11.jar
67+
```
68+
69+
> [!NOTE]
70+
> The example command calls apply to Application Insights for Java version 3.4.11. To find the version number and URL address of the current release of Application Insights for Java, see <https://github.com/microsoft/ApplicationInsights-Java/releases>.
5071
5172
### [Java native](#tab/java-native)
5273

53-
...
74+
#### Step 1: Verify the OpenTelemetry version
75+
76+
You might notice the following message during the application startup:
77+
78+
```output
79+
WARN c.a.m.a.s.OpenTelemetryVersionCheckRunner - The OpenTelemetry version is not compatible with the spring-cloud-azure-starter-monitor dependency.
80+
The OpenTelemetry version should be <version>
81+
```
82+
83+
In this case, you have to import the OpenTelemetry Bills of Materials
84+
by following the OpenTelemetry documentation in the [Spring Boot starter](https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/getting-started/).
85+
86+
#### Step 2: Enable self-diagnostics
87+
88+
If something doesn't work as expected, you can enable self-diagnostics at the `DEBUG` level to get some insights. To do so, set the self-diagnostics level to `ERROR`, `WARN`, `INFO`, `DEBUG`, or `TRACE` by using the `APPLICATIONINSIGHTS_SELF_DIAGNOSTICS_LEVEL` environment variable.
89+
90+
To enable self-diagnostics at the `DEBUG` level when running a docker container, run the following command:
91+
92+
```console
93+
docker run -e APPLICATIONINSIGHTS_SELF_DIAGNOSTICS_LEVEL=DEBUG <image-name>
94+
```
95+
96+
> [!NOTE]
97+
> Replace *`<image-name>`* with the docker image name accordingly.
98+
>
99+
[!INCLUDE [Third-party disclaimer](../../../../includes/third-party-disclaimer.md)]
54100

55101
### [Node.js](#tab/nodejs)
56102

57-
...
103+
#### Step 1: Enable diagnostic logging
104+
105+
Azure Monitor Exporter uses the OpenTelemetry API logger for internal logs. To enable the logger, run the following code snippet:
106+
107+
```javascript
108+
const { diag, DiagConsoleLogger, DiagLogLevel } = require("@opentelemetry/api");
109+
const { NodeTracerProvider } = require("@opentelemetry/sdk-trace-node");
110+
111+
const provider = new NodeTracerProvider();
112+
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.ALL);
113+
provider.register();
114+
```
115+
116+
#### Step 2: Test connectivity between your application host and the ingestion service
117+
118+
Application Insights SDKs and agents send telemetry to get ingested as REST calls at our ingestion endpoints. To test connectivity from your web server or application host computer to the ingestion service endpoints, use cURL commands or raw REST requests from PowerShell. For more information, see [Troubleshoot missing application telemetry in Azure Monitor Application Insights](../investigate-missing-telemetry.md).
119+
120+
#### Known issues
121+
122+
The following items are known issues for the Azure Monitor OpenTelemetry Exporters:
123+
124+
- The operation name is missing from dependency telemetry. The missing operation name causes failures and adversely affects performance tab experience.
125+
126+
- The device model is missing from request and dependency telemetry. The missing device model adversely affects device cohort analysis.
127+
128+
- The database server name is missing from the dependency name. Because the database server name isn't included, OpenTelemetry Exporters incorrectly aggregate tables that have the same name onto different servers.
58129

59130
### [Python](#tab/python)
60131

132+
#### Step 1: Enable diagnostic logging
133+
134+
The Microsoft Azure Monitor Exporter uses the [Python standard logging library](https://docs.python.org/3/library/logging.html) for its internal logging. OpenTelemetry API and Azure Monitor Exporter logs are assigned a severity level of `WARNING` or `ERROR` for irregular activity. The `INFO` severity level is used for regular or successful activity.
135+
136+
By default, the Python logging library sets the severity level to `WARNING`. Therefore, you must change the severity level to see logs under this severity setting. The following example code shows how to output logs of all severity levels to the console and a file:
137+
138+
```python
139+
...
140+
import logging
141+
142+
logging.basicConfig(format = "%(asctime)s:%(levelname)s:%(message)s", level = logging.DEBUG)
143+
144+
logger = logging.getLogger(__name__)
145+
file = logging.FileHandler("example.log")
146+
stream = logging.StreamHandler()
147+
logger.addHandler(file)
148+
logger.addHandler(stream)
61149
...
150+
```
151+
152+
#### Step 2: Test connectivity between your application host and the ingestion service
153+
154+
Application Insights SDKs and agents send telemetry to get ingested as REST calls at our ingestion endpoints. To test connectivity from your web server or application host computer to the ingestion service endpoints, use cURL commands or raw REST requests from PowerShell. For more information, see [Troubleshoot missing application telemetry in Azure Monitor Application Insights](../investigate-missing-telemetry.md).
155+
156+
#### Step 3: Avoid duplicate telemetry
157+
158+
Duplicate telemetry is often caused if you create multiple instances of processors or exporters. Make sure that you run only one exporter and processor at a time for each telemetry pillar (logs, metrics, and distributed tracing).
159+
160+
The following sections describe scenarios that can cause duplicate telemetry.
161+
162+
##### Duplicate trace logs in Azure Functions
163+
164+
If you see a pair of entries for each trace log within Application Insights, you probably enabled the following types of logging instrumentation:
165+
166+
- The native logging instrumentation in Azure Functions
167+
- The `azure-monitor-opentelemetry` logging instrumentation within the distribution
168+
169+
To prevent duplication, you can disable the distribution's logging, but leave the native logging instrumentation in Azure Functions enabled. To do this, set the `OTEL_LOGS_EXPORTER` environment variable to `None`.
170+
171+
##### Duplicate telemetry in "Always On" Azure Functions
172+
173+
If the **Always On** setting in Azure Functions is set to **On**, Azure Functions keeps some processes running in the background after each run is complete. For instance, suppose that you have a five-minute timer function that calls `configure_azure_monitor` each time. After 20 minutes, you then might have four metric exporters that are running at the same time. This situation might be the source of your duplicate metrics telemetry.
174+
175+
In this situation, either set the **Always On** setting to **Off**, or try manually shutting down the providers between each `configure_azure_monitor` call. To shut down each provider, run shutdown calls for each current meter, tracer, and logger provider, as shown in the following code:
176+
177+
```python
178+
get_meter_provider().shutdown()
179+
get_tracer_provider().shutdown()
180+
get_logger_provider().shutdown()
181+
```
182+
183+
##### Azure Workbooks and Jupyter Notebooks
184+
185+
Azure Workbooks and Jupyter Notebooks might keep exporter processes running in the background. To prevent duplicate telemetry, clear the cache before you make more calls to `configure_azure_monitor`.
186+
187+
#### Step 4: Make sure that Flask request data is collected
188+
189+
If you implement a Flask application, you might find that you can't collect Requests table data from Application Insights while you use the [Azure Monitor OpenTelemetry Distro client library for Python](/python/api/overview/azure/monitor-opentelemetry-readme). This issue could occur if you don't structure your `import` declarations correctly. You might be importing the `flask.Flask` web application framework before you call the `configure_azure_monitor` function to instrument the Flask library. For example, the following code doesn't successfully instrument the Flask app:
190+
191+
```python
192+
from azure.monitor.opentelemetry import configure_azure_monitor
193+
from flask import Flask
194+
195+
configure_azure_monitor()
196+
197+
app = Flask(__name__)
198+
```
199+
200+
Instead, we recommend that you import the `flask` module as a whole, and then call `configure_azure_monitor` to configure OpenTelemetry to use Azure Monitor before you access `flask.Flask`:
201+
202+
```python
203+
from azure.monitor.opentelemetry import configure_azure_monitor
204+
import flask
205+
206+
configure_azure_monitor()
207+
208+
app = flask.Flask(__name__)
209+
```
210+
211+
Alternatively, you can call `configure_azure_monitor` before you import `flask.Flask`:
212+
213+
```python
214+
from azure.monitor.opentelemetry import configure_azure_monitor
215+
216+
configure_azure_monitor()
217+
218+
from flask import Flask
219+
220+
app = Flask(__name__)
221+
```
62222

63223
---
64224

225+
[!INCLUDE [Azure Help Support](../../../../includes/azure-help-support.md)]
226+
65227
## Support
66228

67229
Select a tab for the language of your choice to discover support options.
@@ -88,9 +250,9 @@ Select a tab for the language of your choice to discover support options.
88250
### [Java native](#tab/java-native)
89251

90252
- For Azure support issues, open an [Azure support ticket](https://azure.microsoft.com/support/create-ticket/).
91-
- For help with troubleshooting, review the [troubleshooting steps](/troubleshoot/azure/azure-monitor/app-insights/java-standalone-troubleshoot).
92253
- For OpenTelemetry issues, contact the [OpenTelemetry community](https://opentelemetry.io/community/) directly.
93-
- For a list of open issues related to Azure Monitor Java Autoinstrumentation, see the [GitHub Issues Page](https://github.com/microsoft/ApplicationInsights-Java/issues).
254+
- For a list of open issues with Spring Boot native applications, see the [GitHub Issues Page](https://github.com/Azure/azure-sdk-for-java/issues?q=is%3Aopen+is%3Aissue+label%3A%22Spring+Monitor%22).
255+
- For a list of open issues with Quarkus native applications, see the [GitHub Issues Page](https://github.com/quarkiverse/quarkus-opentelemetry-exporter).
94256

95257
### [Node.js](#tab/nodejs)
96258

0 commit comments

Comments
 (0)