Skip to content

Commit 611223f

Browse files
alexandra5000rhr323
authored andcommitted
Update the main iOS SDK troubleshooting page (elastic#3369)
This PR updates the troubleshooting page for the EDOT iOS SDK. The page now addresses common issues encountered when instrumenting iOS applications, including data export failures, missing telemetry, resource detection problems, and crashes during SDK initialization. All other SDKs have dedicated troubleshooting coverage. This addition brings parity by introducing guidance for iOS. Closes elastic#3046
1 parent 2a1a58e commit 611223f

File tree

1 file changed

+144
-5
lines changed
  • troubleshoot/ingest/opentelemetry/edot-sdks/ios

1 file changed

+144
-5
lines changed

troubleshoot/ingest/opentelemetry/edot-sdks/ios/index.md

Lines changed: 144 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
navigation_title: EDOT iOS
33
mapped_pages:
44
- https://www.elastic.co/guide/en/apm/agent/swift/current/troubleshooting.html
5-
description: Troubleshooting guide for the Elastic Distribution of OpenTelemetry (EDOT) iOS agent, covering connectivity, agent identification, and debugging.
5+
description: Troubleshooting guide for the Elastic Distribution of OpenTelemetry (EDOT) iOS agent, covering common issues.
66
applies_to:
77
stack:
88
serverless:
@@ -17,12 +17,151 @@ products:
1717

1818
# Troubleshooting the EDOT iOS agent [troubleshooting]
1919

20+
This page provides guidance for resolving common problems when instrumenting iOS applications with the {{edot}} (EDOT) SDK.
21+
2022
When troubleshooting the EDOT iOS agent, ensure your app is compatible with the agent’s [supported technologies](apm-agent-ios://reference/edot-ios/supported-technologies.md).
2123

22-
If you’re an existing Elastic customer with a support contract, create a ticket in the [Elastic Support portal](https://support.elastic.co/customers/s/login/). Other users can post in the [APM discuss forum](https://discuss.elastic.co/c/apm).
2324

24-
::::{important}
25-
**Upload your complete debug logs** to a service like [GitHub Gist](https://gist.github.com) so that we can analyze the problem. Logs should include everything from when the application starts up until the first request executes.
26-
::::
25+
## SDK fails to export data
26+
27+
If your app is running but no telemetry reaches Elastic, the SDK might be failing to send data to the configured endpoint.
28+
29+
### Symptoms [symptoms-fail-to-export]
30+
31+
You might notice the following signs when the SDK cannot export data:
32+
33+
* No telemetry appears in Elastic.
34+
* Application logs show errors such as:
35+
36+
```text
37+
[ElasticOtelExporter] Failed to send spans: Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server"
38+
```
39+
40+
* The OpenTelemetry Collector or Elastic endpoint shows no received data.
41+
42+
### Causes [causes-fail-to-export]
43+
44+
This usually happens if the iOS app cannot reach the configured OTLP endpoint due to:
45+
46+
* Incorrect endpoint URL or port.
47+
* TLS/HTTPS certificate issues.
48+
* Missing App Transport Security (ATS) configuration in `Info.plist`.
49+
50+
### Resolution [resolution-fail-to-export]
51+
52+
Try the following steps to resolve the issue:
53+
54+
* Verify the endpoint URL and port in your SDK configuration.
55+
* If using HTTPS with self-signed certificates, add the certificate to the iOS trust store or configure ATS exceptions.
56+
* Add required ATS exceptions to your app’s `Info.plist`. For example:
57+
58+
```xml
59+
<key>NSAppTransportSecurity</key>
60+
<dict>
61+
<key>NSAllowsArbitraryLoads</key>
62+
<true/>
63+
</dict>
64+
```
65+
66+
67+
## No data when app is in the background
68+
69+
If data only appears while the app is in the foreground, the issue might be related to iOS background execution limits.
70+
71+
### Symptoms [symptoms-no-data]
72+
73+
The following behavior indicates that telemetry stops when the app moves to the background:
74+
75+
* Telemetry appears only when the app is in the foreground.
76+
77+
* Spans or metrics are missing after backgrounding the app.
78+
79+
### Causes [causes-no-data]
80+
81+
This issue can occur because of how iOS manages background tasks and network activity:
82+
83+
* iOS aggressively suspends background network activity. The SDK cannot flush telemetry if the app is suspended.
84+
85+
### Resolution [resolution-no-data]
86+
87+
Use the following recommendations to ensure data export continues as expected:
88+
89+
* Ensure that export intervals are short enough to flush before suspension.
90+
91+
* Use iOS background modes if appropriate for your app (for example `Background fetch`, `Background processing`).
92+
93+
* For crash or cold-start telemetry, rely on batching and retry when the app next resumes.
94+
95+
96+
## Missing device or app metadata
97+
98+
If telemetry is sent but key attributes such as device model, OS version, or app version are missing, resource detection might not be working correctly.
99+
100+
### Symptoms [symptoms-missing-device]
101+
102+
You might encounter the following when resource detection is incomplete:
103+
104+
* Spans or metrics appear in Elastic, but expected resource attributes (for example device model, OS version, app version) are missing.
105+
106+
### Causes [causes-missing-device]
107+
108+
Common causes include turned off resource detectors or missing permissions:
109+
110+
* Resource detectors might not be enabled, or required permissions might not be granted.
111+
112+
### Resolution [resolution-missing-device]
113+
114+
To restore full metadata reporting, verify the following:
115+
116+
* Ensure the iOS resource detectors are enabled in the SDK initialization.
117+
118+
* Verify your build includes the `DeviceResourceDetector` and `OSResourceDetector`.
119+
120+
* Check privacy permissions (for example for network or device identifiers, if used).
121+
122+
123+
## Crashes or startup delays after SDK initialization
124+
125+
If the app crashes or slows down significantly after integrating the SDK, initialization or exporter configuration might be the cause.
126+
127+
### Symptoms [symptoms-crash]
128+
129+
The following symptoms can indicate SDK-related performance or initialization issues:
130+
131+
* App crashes immediately after launching with the SDK enabled.
132+
133+
* Noticeable delays before the first screen appears.
134+
135+
### Causes [causes-crash]
136+
137+
Crashes or slow startup typically occur for one of these reasons:
138+
139+
* The SDK is initialized on the main thread with heavy configuration.
140+
141+
* Exporters are misconfigured and blocking startup.
142+
143+
### Resolution [resolution-crash]
144+
145+
Try these steps to resolve initialization and startup issues:
146+
147+
* Initialize the SDK on a background thread when possible.
148+
149+
* Use asynchronous exporters.
150+
151+
* Start with minimal configuration and gradually add exporters to isolate the issue.
152+
153+
154+
## Next steps
155+
156+
If problems persist:
157+
158+
* Review the [iOS SDK reference documentation](apm-agent-ios://reference/edot-ios/index.md).
159+
160+
* [Enable debug logging for the Collector](../../edot-collector/enable-debug-logging.md) and [the SDKs](../enable-debug-logging.md).
161+
162+
::::{important}
163+
**Upload your complete debug logs** to a service like [GitHub Gist](https://gist.github.com) so that we can analyze the problem. Logs should include everything from when the application starts up until the first request executes.
164+
::::
27165

166+
* If you’re an existing Elastic customer with a support contract, create a ticket in the [Elastic Support portal](https://support.elastic.co/customers/s/login/). Other users can post in the [APM discuss forum](https://discuss.elastic.co/c/apm).
28167

0 commit comments

Comments
 (0)