# Diagnose Spark connectivity

{% hint style="info" %}
If you are unsure about the `environment` parameter for your Spark to the Spark APIs, please see [FAQ](/support/faq.md#what-is-the-link-to-my-environment).
{% endhint %}

## Check server status

Every Spark environment has a health check endpoint. This can be accessed by visiting the address `https://excel.{environment}.coherent.global/health` in your web browser. If the environment is up, you should see the following response.

```json
{"status":"UP"}
```

## Time your connection to the Spark servers

To help diagnose any potential firewall or connectivity issues, you can use these [curl](https://curl.se/docs/manpage.html) commands to time the connection to Spark to see if there are significant lags or connectivity issues.

### Sample request

{% hint style="warning" %}
Make sure to replace `{environment}` with the environment that you are using.
{% endhint %}

<table><thead><tr><th>Bash</th><th>PowerShell</th></tr></thead><tbody><tr><td><pre class="language-sh" data-overflow="wrap"><code class="lang-sh">curl --silent --write-out "\n\n---Coherent Spark connection details---\nhttp_code: %{http_code}\nlocal_ip: %{local_ip}\nlocal_port: %{local_port}\nnum_connects: %{num_connects}\nnum_redirects: %{num_redirects}\nproxy_ssl_verify_result: %{proxy_ssl_verify_result}\nremote_ip: %{remote_ip}\nremote_port: %{remote_port}\nresponse_code: %{response_code}\nsize_download: %{size_download} B\nsize_header: %{size_header} B\nsize_request: %{size_request} B\nsize_upload: %{size_upload} B\nspeed_download: %{speed_download} Bps\nspeed_up: %{speed_upload} Bps\n---Coherent Spark connection time---\ntime_appconnect: %{time_appconnect}\ntime_connect: %{time_connect}\ntime_namelookup: %{time_namelookup}\ntime_pretransfer: %{time_pretransfer}\ntime_redirect: %{time_redirect}\ntime_starttransfer: %{time_starttransfer}\n---\ntime_total: %{time_total}\n" --location 'https://excel.{environment}.coherent.global/health'
</code></pre></td><td><pre class="language-powershell" data-overflow="wrap"><code class="lang-powershell">curl.exe --silent --write-out "\n\n---Coherent Spark connection details---\nhttp_code: %{http_code}\nlocal_ip: %{local_ip}\nlocal_port: %{local_port}\nnum_connects: %{num_connects}\nnum_redirects: %{num_redirects}\nproxy_ssl_verify_result: %{proxy_ssl_verify_result}\nremote_ip: %{remote_ip}\nremote_port: %{remote_port}\nresponse_code: %{response_code}\nsize_download: %{size_download} B\nsize_header: %{size_header} B\nsize_request: %{size_request} B\nsize_upload: %{size_upload} B\nspeed_download: %{speed_download} Bps\nspeed_up: %{speed_upload} Bps\n---Coherent Spark connection time---\ntime_appconnect: %{time_appconnect}\ntime_connect: %{time_connect}\ntime_namelookup: %{time_namelookup}\ntime_pretransfer: %{time_pretransfer}\ntime_redirect: %{time_redirect}\ntime_starttransfer: %{time_starttransfer}\n---\ntime_total: %{time_total}\n" --location 'https://excel.{environment}.coherent.global/health'
</code></pre></td></tr><tr><td></td><td>Note when using PowerShell, make sure you are using <code>curl.exe</code> and not <code>curl</code> which uses the <code>Invoke-WebRequest</code> command. </td></tr></tbody></table>

### Sample response

```sh
{"status":"UP"}

---Coherent Spark connection details---
http_code: 200
local_ip: 192.168.1.107
local_port: 59899
num_connects: 1
num_redirects: 0
proxy_ssl_verify_result: 0
remote_ip: 172.26.35.63
remote_port: 443
response_code: 200
size_download: 15 B
size_header: 204 B
size_request: 0 B
size_upload: 0 B
speed_download: 51 Bps
speed_up: 0 Bps
---Coherent Spark connection time---
time_appconnect: 0.229670
time_connect: 0.080042
time_namelookup: 0.021973
time_pretransfer: 0.229767
time_redirect: 0.000000
time_starttransfer: 0.288606
---
time_total: 0.289149
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.coherent.global/integrations/diagnose-spark-connectivity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
