From d68e6af771963c4619165367321908436103d142 Mon Sep 17 00:00:00 2001 From: chrishart0 <64378248+chrishart0@users.noreply.github.com> Date: Sat, 15 Feb 2025 17:47:48 -0500 Subject: [PATCH 1/7] Basic guide to create some automated monitoring. --- .../advanced-topics/monitoring.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 docs/getting-started/advanced-topics/monitoring.md diff --git a/docs/getting-started/advanced-topics/monitoring.md b/docs/getting-started/advanced-topics/monitoring.md new file mode 100644 index 0000000..2187721 --- /dev/null +++ b/docs/getting-started/advanced-topics/monitoring.md @@ -0,0 +1,92 @@ +# Monitoring OpenWeb UI + +This guide covers different approaches to monitoring your OpenWeb UI instance. + +## Basic Health Check Endpoint + +OpenWeb UI exposes a health check endpoint at `/health` that returns a 200 OK status when the service is running properly. + + +```bash + # No auth needed for this endpoint + curl https://your-openweb-instance/health +``` + +### Using Uptime Kuma +[Uptime Kuma](https://github.com/louislam/uptime-kuma) is a great, easy to use, open source, self-hosted uptime monitoring tool. + +1. In your Uptime Kuma dashboard, click "Add New Monitor" +2. Set the following configuration: + - Monitor Type: HTTP(s) + - Name: OpenWeb UI + - URL: `http://your-openweb-instance:8080/health` + - Monitoring Interval: 60 seconds (or your preferred interval) + - Retry count: 3 (recommended) + +The health check will verify: +- The web server is responding +- The application is running +- Basic database connectivity + +## OpenWeb UI Model Connectivity + +To verify that OpenWeb UI can successfully connect to and list your configured models, you can monitor the models endpoint. This endpoint requires authentication and checks OpenWeb UI's ability to communicate with your model providers. + +See [API documentation](https://docs.openwebui.com/getting-started/api-endpoints/#-retrieve-all-models) for more details about the models endpoint. + + +```bash + # See steps below to get an API key + curl -H "Authorization: Bearer sk-adfadsflkhasdflkasdflkh" https://your-openweb-instance/api/models +``` + +### Authentication Setup + +1. Enable API Keys (Admin required): + - Go to Admin Settings > General + - Enable the "Enable API Key" setting + - Save changes + +2. Get your API key [docs](https://docs.openwebui.com/getting-started/api-endpoints): + - (Optional), consider making a non-admin user for the monitoring API key + - Go to Settings > Account in OpenWeb UI + - Generate a new API key specifically for monitoring + - Copy the API key for use in Uptime Kuma + +Note: If you don't see the option to generate API keys in your Settings > Account, check with your administrator to ensure API keys are enabled. + +### Using Uptime Kuma for Model Connectivity + +1. Create a new monitor in Uptime Kuma: + - Monitor Type: HTTP(s) - JSON Query + - Name: OpenWeb UI Model Connectivity + - URL: `http://your-openweb-instance:8080/api/models` + - Method: GET + - Expected Status Code: 200 + - JSON Query: `$count(data[*])>0` + - Expected Value: `true` + - Monitoring Interval: 300 seconds (5 minutes recommended) + +2. Configure Authentication: + - In the Headers section, add: + ``` + { + "Authorization": "Bearer sk-abc123adfsdfsdfsdfsfdsdf" + } + ``` + - Replace `YOUR_API_KEY` with the API key you generated + +Alternative JSON Queries: +``` +# At least 1 models by ollama provider +$count(data[owned_by='ollama'])>1 + +# Check if specific model exists (returns true/false) +$exists(data[id='gpt-4o']) + +# Check multiple models (returns true if ALL exist) +$count(data[id in ['gpt-4o', 'gpt-4o-mini']]) = 2 +``` + +You can test JSONata queries at [jsonata.org](https://try.jsonata.org/) to verify they work with your API response. + From c71fb45b4b124695beb59620c40a880ffa16d1fb Mon Sep 17 00:00:00 2001 From: chrishart0 <64378248+chrishart0@users.noreply.github.com> Date: Sat, 15 Feb 2025 18:12:25 -0500 Subject: [PATCH 2/7] Add an example for hitting a model with an API key in the new monitoring docs. --- .../getting-started/advanced-topics/monitoring.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/getting-started/advanced-topics/monitoring.md b/docs/getting-started/advanced-topics/monitoring.md index 2187721..cd6f39d 100644 --- a/docs/getting-started/advanced-topics/monitoring.md +++ b/docs/getting-started/advanced-topics/monitoring.md @@ -90,3 +90,18 @@ $count(data[id in ['gpt-4o', 'gpt-4o-mini']]) = 2 You can test JSONata queries at [jsonata.org](https://try.jsonata.org/) to verify they work with your API response. +## Model Response Testing + +To verify that models can actually process requests, you can monitor the chat completions endpoint. This provides a deeper health check by ensuring models can generate responses. + +```bash +# Test model response +curl -X POST https://your-openweb-instance/api/chat/completions \ + -H "Authorization: Bearer sk-adfadsflkhasdflkasdflkh" \ + -H "Content-Type: application/json" \ + -d '{ + "messages": [{"role": "user", "content": "Respond with the word HEALTHY"}], + "model": "llama3.1", + "temperature": 0 + }' +``` From d19fc8628e6fabc99b4b1e5e27ea41adddd1778e Mon Sep 17 00:00:00 2001 From: chrishart0 <64378248+chrishart0@users.noreply.github.com> Date: Sat, 15 Feb 2025 18:22:03 -0500 Subject: [PATCH 3/7] Add monitoring section to advanced topics index, re-ordered advanced topics to match sidebar, added header to new monitoring page --- docs/getting-started/advanced-topics/index.mdx | 18 +++++++++++++++--- .../advanced-topics/monitoring.md | 5 +++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/docs/getting-started/advanced-topics/index.mdx b/docs/getting-started/advanced-topics/index.mdx index 91f51ce..e0d39e0 100644 --- a/docs/getting-started/advanced-topics/index.mdx +++ b/docs/getting-started/advanced-topics/index.mdx @@ -9,9 +9,15 @@ Explore deeper concepts and advanced configurations of Open WebUI to enhance you --- -## 📊 Logging and Monitoring -Learn how to monitor, log, and troubleshoot your system effectively. -[Logging and Monitoring Guide](/getting-started/advanced-topics/logging) +## 🛠️ Development +Understand the development setup and contribute to OpenWeb UI. +[Development Guide](/getting-started/advanced-topics/development) + +--- + +## 📝 Logging +Learn how to configure and manage logs for troubleshooting your system. +[Logging Guide](/getting-started/advanced-topics/logging) --- @@ -21,4 +27,10 @@ Ensure secure communication by implementing HTTPS encryption in your deployment. --- +## 📊 Monitoring +Learn how to monitor your OpenWeb UI instance, including health checks, model connectivity, and response testing. +[Monitoring Guide](/getting-started/advanced-topics/monitoring) + +--- + Looking for installation instructions? Head over to our [Quick Start Guide](/getting-started/quick-start). \ No newline at end of file diff --git a/docs/getting-started/advanced-topics/monitoring.md b/docs/getting-started/advanced-topics/monitoring.md index cd6f39d..10118ba 100644 --- a/docs/getting-started/advanced-topics/monitoring.md +++ b/docs/getting-started/advanced-topics/monitoring.md @@ -1,3 +1,8 @@ +--- +sidebar_position: 6 +title: "📊 Monitoring" +--- + # Monitoring OpenWeb UI This guide covers different approaches to monitoring your OpenWeb UI instance. From 2ff921b06641dd42030504f5735c9b2de959de60 Mon Sep 17 00:00:00 2001 From: chrishart0 <64378248+chrishart0@users.noreply.github.com> Date: Sat, 15 Feb 2025 18:23:30 -0500 Subject: [PATCH 4/7] Improve intro to new monitoring page --- docs/getting-started/advanced-topics/monitoring.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/getting-started/advanced-topics/monitoring.md b/docs/getting-started/advanced-topics/monitoring.md index 10118ba..f622a88 100644 --- a/docs/getting-started/advanced-topics/monitoring.md +++ b/docs/getting-started/advanced-topics/monitoring.md @@ -5,7 +5,10 @@ title: "📊 Monitoring" # Monitoring OpenWeb UI -This guide covers different approaches to monitoring your OpenWeb UI instance. +Monitoring your OpenWeb UI instance is crucial for ensuring reliable service and quickly identifying issues. This guide covers three levels of monitoring: +- Basic health checks for service availability +- Model connectivity verification +- Deep health checks with model response testing ## Basic Health Check Endpoint From bf81ae597d00f3c465129eb6247d7cea56f5024a Mon Sep 17 00:00:00 2001 From: chrishart0 <64378248+chrishart0@users.noreply.github.com> Date: Mon, 17 Feb 2025 14:28:57 -0500 Subject: [PATCH 5/7] Update index.mdx Fix Openweb UI to Open WebUI --- docs/getting-started/advanced-topics/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/getting-started/advanced-topics/index.mdx b/docs/getting-started/advanced-topics/index.mdx index e0d39e0..24d7e1e 100644 --- a/docs/getting-started/advanced-topics/index.mdx +++ b/docs/getting-started/advanced-topics/index.mdx @@ -10,7 +10,7 @@ Explore deeper concepts and advanced configurations of Open WebUI to enhance you --- ## 🛠️ Development -Understand the development setup and contribute to OpenWeb UI. +Understand the development setup and contribute to Open WebUI. [Development Guide](/getting-started/advanced-topics/development) --- @@ -33,4 +33,4 @@ Learn how to monitor your OpenWeb UI instance, including health checks, model co --- -Looking for installation instructions? Head over to our [Quick Start Guide](/getting-started/quick-start). \ No newline at end of file +Looking for installation instructions? Head over to our [Quick Start Guide](/getting-started/quick-start). From 5bdd30aadf838b73b0df9420e7a4784c92bceaa4 Mon Sep 17 00:00:00 2001 From: chrishart0 <64378248+chrishart0@users.noreply.github.com> Date: Mon, 17 Feb 2025 14:29:46 -0500 Subject: [PATCH 6/7] Fix OpenWeb UI to OpenWeb UI --- docs/getting-started/advanced-topics/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started/advanced-topics/index.mdx b/docs/getting-started/advanced-topics/index.mdx index 24d7e1e..394fddd 100644 --- a/docs/getting-started/advanced-topics/index.mdx +++ b/docs/getting-started/advanced-topics/index.mdx @@ -28,7 +28,7 @@ Ensure secure communication by implementing HTTPS encryption in your deployment. --- ## 📊 Monitoring -Learn how to monitor your OpenWeb UI instance, including health checks, model connectivity, and response testing. +Learn how to monitor your Open WebUI instance, including health checks, model connectivity, and response testing. [Monitoring Guide](/getting-started/advanced-topics/monitoring) --- From 1db80f9760bc1dfe3b253fed705ec361a3ee8173 Mon Sep 17 00:00:00 2001 From: chrishart0 <64378248+chrishart0@users.noreply.github.com> Date: Mon, 17 Feb 2025 14:34:16 -0500 Subject: [PATCH 7/7] Fix final instances of OpenWeb UI to Open WebUI --- .../advanced-topics/monitoring.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/getting-started/advanced-topics/monitoring.md b/docs/getting-started/advanced-topics/monitoring.md index f622a88..5f89634 100644 --- a/docs/getting-started/advanced-topics/monitoring.md +++ b/docs/getting-started/advanced-topics/monitoring.md @@ -3,21 +3,21 @@ sidebar_position: 6 title: "📊 Monitoring" --- -# Monitoring OpenWeb UI +# Monitoring Open WebUI -Monitoring your OpenWeb UI instance is crucial for ensuring reliable service and quickly identifying issues. This guide covers three levels of monitoring: +Monitoring your Open WebUI instance is crucial for ensuring reliable service and quickly identifying issues. This guide covers three levels of monitoring: - Basic health checks for service availability - Model connectivity verification - Deep health checks with model response testing ## Basic Health Check Endpoint -OpenWeb UI exposes a health check endpoint at `/health` that returns a 200 OK status when the service is running properly. +Open WebUI exposes a health check endpoint at `/health` that returns a 200 OK status when the service is running properly. ```bash # No auth needed for this endpoint - curl https://your-openweb-instance/health + curl https://your-open-webuiinstance/health ``` ### Using Uptime Kuma @@ -26,8 +26,8 @@ OpenWeb UI exposes a health check endpoint at `/health` that returns a 200 OK st 1. In your Uptime Kuma dashboard, click "Add New Monitor" 2. Set the following configuration: - Monitor Type: HTTP(s) - - Name: OpenWeb UI - - URL: `http://your-openweb-instance:8080/health` + - Name: Open WebUI + - URL: `http://your-open-webuiinstance:8080/health` - Monitoring Interval: 60 seconds (or your preferred interval) - Retry count: 3 (recommended) @@ -36,16 +36,16 @@ The health check will verify: - The application is running - Basic database connectivity -## OpenWeb UI Model Connectivity +## Open WebUI Model Connectivity -To verify that OpenWeb UI can successfully connect to and list your configured models, you can monitor the models endpoint. This endpoint requires authentication and checks OpenWeb UI's ability to communicate with your model providers. +To verify that Open WebUI can successfully connect to and list your configured models, you can monitor the models endpoint. This endpoint requires authentication and checks Open WebUI's ability to communicate with your model providers. See [API documentation](https://docs.openwebui.com/getting-started/api-endpoints/#-retrieve-all-models) for more details about the models endpoint. ```bash # See steps below to get an API key - curl -H "Authorization: Bearer sk-adfadsflkhasdflkasdflkh" https://your-openweb-instance/api/models + curl -H "Authorization: Bearer sk-adfadsflkhasdflkasdflkh" https://your-open-webuiinstance/api/models ``` ### Authentication Setup @@ -57,7 +57,7 @@ See [API documentation](https://docs.openwebui.com/getting-started/api-endpoints 2. Get your API key [docs](https://docs.openwebui.com/getting-started/api-endpoints): - (Optional), consider making a non-admin user for the monitoring API key - - Go to Settings > Account in OpenWeb UI + - Go to Settings > Account in Open WebUI - Generate a new API key specifically for monitoring - Copy the API key for use in Uptime Kuma @@ -67,8 +67,8 @@ Note: If you don't see the option to generate API keys in your Settings > Accoun 1. Create a new monitor in Uptime Kuma: - Monitor Type: HTTP(s) - JSON Query - - Name: OpenWeb UI Model Connectivity - - URL: `http://your-openweb-instance:8080/api/models` + - Name: Open WebUI Model Connectivity + - URL: `http://your-open-webuiinstance:8080/api/models` - Method: GET - Expected Status Code: 200 - JSON Query: `$count(data[*])>0` @@ -104,7 +104,7 @@ To verify that models can actually process requests, you can monitor the chat co ```bash # Test model response -curl -X POST https://your-openweb-instance/api/chat/completions \ +curl -X POST https://your-open-webuiinstance/api/chat/completions \ -H "Authorization: Bearer sk-adfadsflkhasdflkasdflkh" \ -H "Content-Type: application/json" \ -d '{