Sentry:修订间差异

来自Gea-Suan Lin's Wiki
跳到导航 跳到搜索
此页面具有访问限制。如果您看见此消息,则说明您没有权限访问此页面。
 
(未显示同一用户的29个中间版本)
第3行: 第3行:
== 硬體 ==
== 硬體 ==


 官方推估每天處理四百萬的事件,資料保留90天,大約需要1.5 TB的空間<ref>{{Cite web |url=https://docs.sentry.io/server/installation/ |title=Docs - Installation |accessdate=2019-04-22}}</ref>。
官方的GitHub頁面上會更新目前最新版本需要的硬體規格。
 
 官方推估每天處理四百萬的事件,資料保留90天,大約需要1.5 TB的空間<ref>{{Cite web |url=https://docs.sentry.io/server/installation/ |title=Docs - Installation |accessdate=2019-04-22}}</ref> 。目前測過的版本(23.9.1)在跑一陣子後大約需要9GB的記憶體空間


== 簡介 ==
== 簡介 ==
第11行: 第13行:
== 安裝 ==
== 安裝 ==


 這邊以[[Ubuntu]] 20.04為作業系統,需要先安裝[[Docker]] 與<code>docker-compose</code> (要注 意Ubuntu 20.04內 <code>docker-compose</code> 版本 可能會不夠新 ),並且設定權限:
 這邊以[[Ubuntu]] 22.04為作業系統,需要先安裝[[Docker]] 與Docker Compose (要注 意得安裝Ubuntu套件庫提供 的版本),並且設定權限:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo usermod -a -G docker www-data
sudo apt install docker-compose
</syntaxhighlight>
</syntaxhighlight>


 然後裝到<code>www-data</code>下:
<syntaxhighlight lang="bash">
sudo groupadd -g 9000 service-sentry
sudo useradd -g 9000 -G docker -m -s /bin/bash -u 9000 service-sentry
</syntaxhighlight>
 
 然後裝到<code>service-sentry</code>下:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo chsh -s /bin/bash www-data; sudo chown www-data:www-data ~www-data; sudo su - www-data -c "git clone https://github.com/getsentry/onpremise.git; cd onpremise; git checkout 21.8.0; docker volume create --name=sentry-data; ./install.sh; docker-compose up -d"
sudo su - service-sentry -c "git clone https://github.com/getsentry/self-hosted.git; cd self-hosted; git checkout 24.4.1; ./install.sh; docker compose up -d"
</syntaxhighlight>
 
裝完後會在Port 9000執行提供服務,可以透過[[nginx]]轉發對應的連線需求。
 
== 升級 ==
 
請務必先參考[https://develop.sentry.dev/self-hosted/releases/ Self-Hosted Releases & Upgrading]文件上的說明,有些版本是需要先升級到某個中間版本才能往後繼續升級,像是目前看到的說明:
 
<pre>
<your.sentry.version> -> 9.1.2 -> 21.5.0 -> 21.6.3 -> 23.6.2 -> latest
</pre>
 
升級的方式是切到<code>self-hosted</code>目錄下跑<code>./install.sh</code>:
 
<syntaxhighlight lang="bash">
cd self-hosted; docker compose down; git pull; git checkout 24.4.1; ./install.sh; docker compose up -d
</syntaxhighlight>
</syntaxhighlight>


== 設定 ==
== 設定 ==
=== Google OAuth ===
參考[https://develop.sentry.dev/self-hosted/sso/ Self-Hosted Single Sign-On (SSO)]這邊的設定:
* 需要先到Google端建立應用程式。
** 其中文章裡沒有提到的是Google端的<code>redirect_uri</code>設定需要設為<code>https://sentry.example.com/auth/sso/</code>。
* 再把應用程式對應的client id與client secret填到<code>sentry/config.yml</code>內,再重啟Sentry。
=== Slack ===
參考[https://develop.sentry.dev/integrations/slack/ Slack Integration]這邊的設定。


== 除錯 ==
== 除錯 ==
第40行: 第75行:


* {{Official|https://sentry.io/}} {{en}}
* {{Official|https://sentry.io/}} {{en}}
* [https://github.com/getsentry/onpremise Sentry On-Premise setup] {{en}}
* [https://github.com/getsentry/self-hosted Sentry On-Premise setup] {{en}}
* [https://docs.sentry.io/server/ Docs - Sentry Server] {{en}}
* [https://docs.sentry.io/server/ Docs - Sentry Server] {{en}}


[[Category:軟體]]
[[Category:軟體]]

2024年4月23日 (二) 16:41的最新版本

Sentry是一套搜集错误讯息的软件,或是对应的云端服务。

硬件

官方的GitHub页面上会更新目前最新版本需要的硬件规格。

官方推估每天处理四百万的事件,资料保留90天,大约需要1.5 TB的空间[1]。目前测过的版本(23.9.1)在跑一阵子后大约需要9GB的内存空间。

简介

Sentry提供SDK在用户端安装后就可以搜集错误资讯,并且在服务器上分类并提供界面让维护者可以确认情况。

安装

这边以Ubuntu 22.04为操作系统,需要先安装Docker与Docker Compose(要注意得安装Ubuntu套件库提供的版本),并且设定权限:

sudo apt install docker-compose
sudo groupadd -g 9000 service-sentry
sudo useradd -g 9000 -G docker -m -s /bin/bash -u 9000 service-sentry

然后装到service-sentry下:

sudo su - service-sentry -c "git clone https://github.com/getsentry/self-hosted.git; cd self-hosted; git checkout 24.4.1; ./install.sh; docker compose up -d"

装完后会在Port 9000执行提供服务,可以透过nginx转发对应的连线需求。

升级

请务必先参考Self-Hosted Releases & Upgrading文件上的说明,有些版本是需要先升级到某个中间版本才能往后继续升级,像是目前看到的说明:

<your.sentry.version> -> 9.1.2 -> 21.5.0 -> 21.6.3 -> 23.6.2 -> latest

升级的方式是切到self-hosted目录下跑./install.sh

cd self-hosted; docker compose down; git pull; git checkout 24.4.1; ./install.sh; docker compose up -d

设定

Google OAuth

参考Self-Hosted Single Sign-On (SSO)这边的设定:

  • 需要先到Google端建立应用程序。
  • 再把应用程序对应的client id与client secret填到sentry/config.yml内,再重启Sentry。

Slack

参考Slack Integration这边的设定。

除错

可以先用docker-composelogs -f看错误讯息:

docker-compose logs -f

参考文献

  1. Docs - Installation. [2019-04-22]. 

外部链接