From 3689096b515c573eb793d6eb3b754dd332b25259 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 47933d35f0de160271d7a232cf8de648d78e2235 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 7f6eb7a71005098a39fb2652842d014804565c8c 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 441cffb76091902aef1b028403572ec2bb0613cb 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 44394718dbef207443e69c3f70ea3ba0e20423d0 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 ace33b3ca8120c50f694da3abb3d2e4060f7d41d 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 58631a57f399ec30ef52d17fee69975577863846 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 '{