ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅
Sentry β ΠΈΠ½ΡΡΡΡΠΌΠ΅Π½Ρ ΠΌΠΎΠ½ΠΈΡΠΎΡΠΈΠ½Π³Π° ΠΈΡΠΊΠ»ΡΡΠ΅Π½ΠΈΠΉ (exception), ΠΎΡΠΈΠ±ΠΎΠΊ Π² Π²Π°ΡΠΈΡ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡΡ .
ΠΡΠ½ΠΎΠ²Π½ΡΠ΅ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΠΈ:
- Π»Π΅Π³ΠΊΠΎ ΠΈΠ½ΡΠ΅Π³ΡΠΈΡΡΠ΅ΡΡΡ Π² ΠΏΡΠΎΠ΅ΠΊΡ,
- Π»ΠΎΠ²ΠΈΡ ΠΎΡΠΈΠ±ΠΊΠΈ ΠΈ Π² Π±ΡΠ°ΡΠ·Π΅ΡΠ΅ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ, ΠΈ Π½Π° Π²Π°ΡΠ΅ΠΌ ΡΠ΅ΡΠ²Π΅ΡΠ΅.
- ΠΠ΅ΡΠΏΠ»Π°ΡΠ΅Π½,
- Π‘ΠΏΠΈΡΠΎΠΊ ΠΎΡΠΈΠ±ΠΎΠΊ ΠΎΠ±Π½ΠΎΠ²Π»ΡΠ΅ΡΡΡ Π² ΡΠ΅ΠΆΠΈΠΌΠ΅ ΡΠ΅Π°Π»ΡΠ½ΠΎΠ³ΠΎ Π²ΡΠ΅ΠΌΠ΅Π½ΠΈ,
- ΠΡΠ»ΠΈ ΠΎΡΠΈΠ±ΠΊΠ° Π±ΡΠ»Π° ΠΏΠΎΠΌΠ΅ΡΠ΅Π½Π° ΠΊΠ°ΠΊ ΡΠ΅ΡΠ΅Π½Π½Π°Ρ ΠΈ ΠΏΠΎΡΠ²ΠΈΠ»Π°ΡΡ ΡΠ½ΠΎΠ²Π°, ΡΠΎ ΠΎΠ½Π° ΡΠ½ΠΎΠ²Π° ΡΠΎΠ·Π΄Π°Π΅ΡΡΡ ΠΈ ΡΡΠΈΡΡΠ²Π°Π΅ΡΡΡ Π² ΠΎΡΠ΄Π΅Π»ΡΠ½ΠΎΠΌ ΠΏΠΎΡΠΎΠΊΠ΅,
- ΠΡΠΈΠ±ΠΊΠΈ Π³ΡΡΠΏΠΏΠΈΡΡΡΡΡΡ ΠΈ ΠΎΡΠΎΠ±ΡΠ°ΠΆΠ°ΡΡΡΡ Π² ΠΏΠΎΡΡΠ΄ΠΊΠ΅ ΡΠ°ΡΡΠΎΡΡ ΠΏΠΎΡΠ²Π»Π΅Π½ΠΈΡ,
- ΠΡΠΈΠ±ΠΊΠΈ ΠΌΠΎΠΆΠ½ΠΎ ΡΠΈΠ»ΡΡΡΠΎΠ²Π°ΡΡ ΠΏΠΎ ΡΡΠ°ΡΡΡΠ°ΠΌ, ΠΈΡΡΠΎΡΠ½ΠΈΠΊΡ Π»ΠΎΠ³Π³ΠΈΡΠΎΠ²Π°Π½ΠΈΡ, ΡΡΠΎΠ²Π½Ρ Π»ΠΎΠ³Π³ΠΈΡΠΎΠ²Π°Π½ΠΈΡ, ΠΈΠΌΠ΅Π½ΠΈ ΡΠ΅ΡΠ²Π΅ΡΠ° ΠΈ Ρ.Π΄.
Π‘ΡΠ°Π²Π½Π΅Π½ΠΈΠ΅ Ρ Π»ΠΎΠ³Π°ΠΌΠΈ ELK: ΡΠ°ΠΌΠΎΠ΅ Π³Π»Π°Π²Π½ΠΎΠ΅ ΡΡΠΎ Π² ELK ΠΊΠ°ΠΆΠ΄ΡΠΉ Π½ΠΎΠ²ΡΠΉ ΠΎΠ΄Π½ΠΎΡΠΈΠΏΠ½ΡΠΉ Π»ΠΎΠ³ β ΡΡΠΎ ΠΎΡΠ΄Π΅Π»ΡΠ½Π°Ρ Π·Π°ΠΏΠΈΡΡ. Π° Π² sentry ΠΊΠ°ΠΆΠ΄ΡΠΉ Π½ΠΎΠ²ΡΠΉ ΠΎΠ΄Π½ΠΎΡΠΈΠΏΠ½ΡΠΉ exception β ΡΡΠΎ Π²ΡΠ΅Π³ΠΎ Π»ΠΈΡΡ + 1 ΠΊ count Π΅Π³ΠΎ Π·Π°ΠΏΠΈΡΠΈ
Sentry ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΈΠ²Π°Π΅Ρ Π±ΠΎΠ»ΡΡΡΡ ΡΠ°ΡΡΡ ΡΠ·ΡΠΊΠΎΠ² ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ. ΠΠΎΠ΄ΡΠΎΠ±Π½Π΅Π΅
ΠΠ°ΠΏΡΡΠΊ Sentry Ρ ΠΏΠΎΠΌΠΎΡΡΡ docker ΠΈ docker-compose
ΠΡ ΠΌΠΎΠΆΠ΅ΡΠ΅ Π·Π°ΠΏΡΡΡΠΈΡΡ Sentry Ρ ΠΏΠΎΠΌΠΎΡΡΡ docker ΠΈ docker-compose ΠΊΠ°ΠΊ ΠΎΠΏΠΈΡΠ°Π½ΠΎ Π·Π΄Π΅ΡΡ:
- data
- postgres
- redis
- zookeeper
- kafka
- clickhouse
- symbolicator
ΠΡΠ»ΠΈ Π²Π°ΠΌ Π½ΡΠΆΠ½Π° ΠΎΡΠΊΠ°Π·ΠΎΡΡΡΠΎΠΉΡΠΈΠ²ΠΎΡΡΡ, ΡΠΎ Π²Π°ΠΌ ΠΏΡΠΈΠ΄Π΅ΡΡΡ Π»ΠΈΠ±ΠΎ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡΡΡ ΠΏΠ»Π°Π½ΡΠΌ ΠΎΠ±Π»Π°ΡΠ½ΡΠΌ ΠΏΡΠΎΠ΄ΡΠΊΡΠΎΠΌ, Π»ΠΈΠ±ΠΎ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°ΡΡ Sentry Π±Π΅Π· ΡΡΠΎΠ³ΠΎ ΡΠΊΡΠΈΠΏΡΠ°.
Π ΡΡΠΎΠΌ ΠΏΠΎΡΡΠ΅ ΠΎΠΏΠΈΡΡΠ²Π°Π΅ΡΡΡ ΠΏΡΠΎΡΠ΅ΡΡ ΡΠ±ΠΎΡΠΊΠΈ Sentry ΠΈ Π΅Π³ΠΎ Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠ΅ΠΉ Π² rpm. ΠΡΠ»ΠΈ Π²Π°ΠΌ Π½ΡΠΆΠ½ΠΎ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ Sentry ΡΠ°ΠΌ Π³Π΄Π΅ Π½Π΅Ρ ΠΈΠ½ΡΠ΅ΡΠ½Π΅ΡΠ°, ΡΠΎ ΠΈΠ· ΠΏΠΎΠ»ΡΡΠ΅Π½Π½ΡΡ rpm ΠΌΠΎΠΆΠ½ΠΎ ΡΠ΄Π΅Π»Π°ΡΡ yum ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ.
ΠΠ°ΠΆΠ½ΠΎΠ΅ ΡΡΠΎΡΠ΅Π½ΠΈΠ΅ ΠΏΠΎ ΡΠ±ΠΎΡΠΊΠ΅ ΠΈ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠ΅ ΠΏΠ°ΠΊΠ΅ΡΠΎΠ²
ΠΠ΅ΠΊΠΎΡΠΎΡΡΠ΅ ΠΏΠ°ΠΊΠ΅ΡΡ Π·Π°Π²ΠΈΡΡΡ Π΄ΡΡΠ³ ΠΎΡ Π΄ΡΡΠ³Π°. ΠΠΎΡΡΠΎΠΌΡ ΠΏΡΠΎΡΠ΅ΡΡ ΡΠ±ΠΎΡΠΊΠΈ ΠΈ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ ΡΠ°Π·Π΄Π΅Π»Π΅Π½ Π½Π° Π½Π΅ΡΠΊΠΎΠ»ΡΠΊΠΎ ΡΡΠ°ΠΏΠΎΠ².
TODO:
Π ΡΡΠΎΠΌ ΠΏΠΎΡΡΠ΅ ΡΠ°ΡΠΌΠΎΡΡΠ΅Π½Π° ΡΠ±ΠΎΡΠΊΠΈ ΠΈ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠ° Sentry Π²Π΅ΡΡΠΈΠΈ 9.1.2. ΠΠΎΡΠ»Π΅ ΡΠΎΠ³ΠΎ ΠΊΠ°ΠΊ ΡΠ°Π·ΡΠ°Π±ΠΎΡΡΠΈΠΊΠΈ Π²ΡΠΏΡΡΡΡΡ ΠΏΠ°ΡΡ ΠΌΠΈΠ½ΠΎΡΠ½ΡΡ ΡΠ΅Π»ΠΈΠ·ΠΎΠ² ΠΌΠΎΠΆΠ½ΠΎ ΡΠΎΠ±ΠΈΡΠ°ΡΡ ΠΈ Π²Π΅ΡΡΠΈΡ Sentry 10.X.Y. ΠΠ½ΠΎΠ³ΠΈΠ΅ ΠΏΠΎΡΠ»Π΅Π΄Π½ΠΈΠ΅ ΠΊΠΎΠΌΠΌΠΈΡΡ Π² master β ΡΡΠΎ fix (ΠΈΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ).
Π’ΡΠ΅Π±ΠΎΠ²Π°Π½ΠΈΡ ΠΊ ΡΠ΅ΡΠ²Π΅ΡΡ Π΄Π»Ρ ΡΠ±ΠΎΡΠΊΠΈ rpm
Π§Π΅ΠΌ Π±ΠΎΠ»ΡΡΠ΅ Π¦ΠΠ£ Π±ΡΠ΄Π΅Ρ, ΡΠ΅ΠΌ Π±ΡΡΡΡΠ΅Π΅ Π±ΡΠ΄Π΅Ρ ΠΏΡΠΎΠΈΡΡ ΠΎΠ΄ΠΈΡΡ ΡΠ±ΠΎΡΠΊΠ° ΠΏΠ°ΠΊΠ΅ΡΠΎΠ² semaphore ΠΈ symbolic
ΠΡΠΊΠ»ΡΡΠ°Π΅ΠΌ Selinux
Π‘ΠΎΠΎΠ±ΡΠ΅ΡΡΠ²ΠΎ Π±ΡΠ΄Π΅Ρ ΡΠΎΠ»ΡΠΊΠΎ Π·Π°, Π΅ΡΠ»ΠΈ ΠΊΡΠΎ-Π½ΠΈΠ±ΡΠ΄Ρ Π½Π°ΠΏΠΈΡΠ΅Ρ ΠΏΠΎΠ»ΠΈΡΠΈΠΊΠΈ selinux Π΄Π»Ρ Sentry.
sudo sed -i s/^SELINUX=.*$/SELINUX=disabled/ /etc/selinux/config
sudo reboot
ΠΠΎΠ΄ΠΊΠ»ΡΡΠ°Π΅ΠΌ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ epel-release
sudo yum install -y epel-release git
Π‘ΠΎΠ±ΠΈΡΠ°Π΅ΠΌ Π² rpm pip Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ ΠΈ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΠΈΡ . Π€Π°ΠΉΠ» 1general_dependencies.sh
echo "Install dependencies"
sudo yum install -y cargo gcc gcc-c++ libffi-devel libjpeg-devel libxml2-devel
libxslt libxslt-devel make mc openssl-devel python-devel memcached
python-lxml python-nose python2-pip python34 rpm-build rpmdevtools
ruby-devel rubygems zlib-devel redis xmlsec1-openssl xmlsec1
libtool-ltdl-devel xmlsec1-devel xmlsec1-openssl-devel openldap-devel
echo "Build common pip dependencies to rpm by fpm"
gem install --no-document fpm
echo "For chardet==3.0.2 need setuptools>=12"
echo "For cryptography==2.8 need setuptools>=18.5"
fpm -s python -t rpm setuptools==18.5
sudo yum install -y python-setuptools-18.5-1.noarch.rpm
fpm -s python -t rpm --name python2-pip pip==20.0.2
sudo yum install -y python2-pip-20.0.2-1.noarch.rpm
Π£ΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΠΈ Π·Π°ΠΏΡΡΠΊΠ°Π΅ΠΌ PostgreSQL 9.6 Π΄Π»Ρ ΡΠ±ΠΎΡΠΊΠΈ python-psycopg2-binary. Π€Π°ΠΉΠ» 2psycopg2-binary.sh
ΠΠ΅ΡΡΠΈΡ PostgreSQL Π²Ρ ΠΌΠΎΠΆΠ΅ΡΠ΅ ΠΏΠΎΠΌΠ΅Π½ΡΡΡ Π² ΡΠΊΡΠΈΠΏΡΠ΅.
sudo yum install -y postgresql-devel
fpm -s python -t rpm psycopg2-binary==2.7.7
sudo yum install -y python-psycopg2-binary-2.7.7-1.x86_64.rpm
sudo yum remove -y postgresql-devel postgresql postgresql-libs
Π‘ΠΎΠ±ΠΈΡΠ°Π΅ΠΌ ΠΈ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ python-dateutil rpm. Π€Π°ΠΉΠ» 3dateutil.sh
#!/bin/bash
echo "Build and install python-dateutil rpm"
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SRPMS,SPECS}
spectool -g -R spec/python-dateutil.spec
wget https://raw.githubusercontent.com/patsevanton/sentry-rpm/master/spec/python-dateutil-system-zoneinfo.patch -P ~/rpmbuild/SOURCES
wget https://raw.githubusercontent.com/patsevanton/sentry-rpm/master/spec/python-dateutil-timelex-string.patch -P ~/rpmbuild/SOURCES
rpmbuild --bb spec/python-dateutil.spec
sudo yum install -y ~/rpmbuild/RPMS/noarch/python-dateutil-2.4.2-1.el7.noarch.rpm
Π‘ΠΎΠ±ΠΈΡΠ°Π΅ΠΌ ΠΈ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ python-urllib3 rpm. Π€Π°ΠΉΠ» 4urllib3.sh
ΠΠ°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ ΡΠΏΠΎΠΉΠ»Π΅ΡΠ°
echo "Build pip dependencies to rpm by fpm for urllib3"
fpm -s python -t rpm pycparser==2.19
sudo yum install -y python-pycparser-2.19-1.noarch.rpm
fpm -s python -t rpm cffi==1.14.0
sudo yum install -y python-cffi-1.14.0-1.x86_64.rpm
fpm -s python -t rpm cryptography==2.8
sudo yum install -y python-cryptography-2.8-1.x86_64.rpm
fpm -s python -t rpm idna==2.7
sudo yum install -y python-idna-2.7-1.noarch.rpm
sudo chmod +r /usr/lib/python2.7/site-packages/idna-2.7-py2.7.egg-info/PKG-INFO
fpm -s python -t rpm pyOpenSSL==19.1.0
sudo yum install -y python-pyopenssl-19.1.0-1.noarch.rpm
fpm -s python -t rpm pbr==5.4.4
sudo yum install -y python-pbr-5.4.4-1.noarch.rpm
fpm -s python -t rpm mock==2.0.0
sudo yum install -y python-mock-2.0.0-1.noarch.rpm
fpm -s python -t rpm py==1.8.1
sudo yum install -y python-py-1.8.1-1.noarch.rpm
fpm -s python -t rpm six==1.10.0
sudo yum install -y python-six-1.10.0-1.noarch.rpm
fpm -s python -t rpm pluggy==0.6.0
sudo yum install -y python-pluggy-0.6.0-1.noarch.rpm
fpm -s python -t rpm attrs==19.3.0
sudo yum install -y python-attrs-19.3.0-1.noarch.rpm
fpm -s python -t rpm more-itertools==5.0.0
sudo yum install -y python-more-itertools-5.0.0-1.noarch.rpm
fpm -s python -t rpm pytest==3.5.1
sudo yum install -y python-pytest-3.5.1-1.noarch.rpm
echo "Build urllib rpm"
spectool -g -R spec/urllib3-1.24.2.spec
sudo yum-builddep -y spec/urllib3-1.24.2.spec
rpmbuild --bb spec/urllib3-1.24.2.spec
sudo yum install -y ~/rpmbuild/RPMS/noarch/python-urllib3-1.24.2-1.el7.noarch.rpm
Π‘ΠΎΠ±ΠΈΡΠ°Π΅ΠΌ Π² rpm ΠΎΡΡΠ°Π»ΡΠ½ΡΠ΅ pip Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ ΠΈ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΠΈΡ . Π€Π°ΠΉΠ» 5other_dependencies.sh
ΠΠ°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ ΡΠΏΠΎΠΉΠ»Π΅ΡΠ°
echo "Build rpm by fpm"
fpm -s python -t rpm jmespath==0.9.5
sudo yum install -y python-jmespath-0.9.5-1.noarch.rpm
fpm -s python -t rpm amqp==1.4.9
sudo yum install -y python-amqp-1.4.9-1.noarch.rpm
fpm -s python -t rpm anyjson==0.3.3
sudo yum install -y python-anyjson-0.3.3-1.noarch.rpm
fpm -s python -t rpm billiard==3.3.0.23
sudo yum install -y python-billiard-3.3.0.23-1.x86_64.rpm
fpm -s python -t rpm docutils==0.16
sudo yum install -y python-docutils-0.16-1.noarch.rpm
fpm -s python -t rpm Pillow==4.2.1
sudo yum install -y python-pillow-4.2.1-1.x86_64.rpm
fpm -s python -t rpm botocore==1.5.70
sudo yum install -y python-botocore-1.5.70-1.noarch.rpm
fpm -s python -t rpm boto3==1.4.5
sudo yum install -y python-boto3-1.4.5-1.noarch.rpm
fpm -s python -t rpm chardet==3.0.2
sudo yum install -y python-chardet-3.0.2-1.noarch.rpm
fpm -s python -t rpm croniter==0.3.31
sudo yum install -y python-croniter-0.3.31-1.noarch.rpm
fpm -s python -t rpm cssselect==1.1.0
sudo yum install -y python-cssselect-1.1.0-1.noarch.rpm
fpm -s python -t rpm cssutils==0.9.10
sudo yum install -y python-cssutils-0.9.10-1.noarch.rpm
fpm -s python -t rpm django-crispy-forms==1.4.0
sudo yum install -y python-django-crispy-forms-1.4.0-1.noarch.rpm
fpm -s python -t rpm django-jsonfield==0.9.13
sudo yum install -y python-django-jsonfield-0.9.13-1.noarch.rpm
fpm -s python -t rpm django-picklefield==0.3.2
sudo yum install -y python-django-picklefield-0.3.2-1.noarch.rpm
fpm -s python -t rpm django-sudo==2.1.0
sudo yum install -y python-django-sudo-2.1.0-1.noarch.rpm
fpm -s python -t rpm django-templatetag-sugar==1.0
sudo yum install -y python-django-templatetag-sugar-1.0-1.noarch.rpm
fpm -s python -t rpm djangorestframework==2.4.8
sudo yum install -y python-djangorestframework-2.4.8-1.noarch.rpm
fpm -s python -t rpm email-reply-parser==0.2.0
sudo yum install -y python-email_reply_parser-0.2.0-1.noarch.rpm
fpm -s python -t rpm enum34==1.1.9
sudo yum install -y python-enum34-1.1.9-1.noarch.rpm
fpm -s python -t rpm functools32==3.2.3.post2
sudo yum install -y python-functools32-3.2.3_2-1.noarch.rpm
fpm -s python -t rpm futures==3.3.0
sudo yum install -y python-futures-3.3.0-1.noarch.rpm
fpm -s python -t rpm hiredis==0.1.6
sudo yum install -y python-hiredis-0.1.6-1.x86_64.rpm
fpm -s python -t rpm honcho==1.0.1
sudo yum install -y python-honcho-1.0.1-1.noarch.rpm
fpm -s python -t rpm httplib2==0.17.0
sudo yum install -y python-httplib2-0.17.0-1.noarch.rpm
fpm -s python -t rpm jsonschema==2.6.0
sudo yum install -y python-jsonschema-2.6.0-1.noarch.rpm
fpm -s python -t rpm kombu==3.0.35
sudo yum install -y python-kombu-3.0.35-1.noarch.rpm
fpm -s python -t rpm celery==3.1.18
sudo yum install -y python-celery-3.1.18-1.noarch.rpm
fpm -s python -t rpm loremipsum==1.0.5
sudo yum install -y python-loremipsum-1.0.5-1.noarch.rpm
fpm -s python -t rpm lxml==4.5.0
sudo yum install -y python-lxml-4.5.0-1.x86_64.rpm
fpm -s python -t rpm milksnake==0.1.5
sudo yum install -y python-milksnake-0.1.5-1.noarch.rpm
fpm -s python -t rpm mistune==0.8.4
sudo yum install -y python-mistune-0.8.4-1.noarch.rpm
fpm -s python -t rpm mmh3==2.3.1
sudo yum install -y python-mmh3-2.3.1-1.x86_64.rpm
fpm -s python -t rpm exam==0.10.6
sudo yum install -y python-exam-0.10.6-1.noarch.rpm
fpm -s python -t rpm msgpack==0.6.2
sudo yum install -y python-msgpack-0.6.2-1.x86_64.rpm
fpm -s python -t rpm oauth2==1.9.0.post1
sudo yum install -y python-oauth2-1.9.0.post1-1.noarch.rpm
fpm -s python -t rpm oauthlib==3.1.0
sudo yum install -y python-oauthlib-3.1.0-1.noarch.rpm
fpm -s python -t rpm parsimonious==0.8.0
sudo yum install -y python-parsimonious-0.8.0-1.noarch.rpm
fpm -s python -t rpm requests==2.20.1
sudo yum install -y python-requests-2.20.1-1.noarch.rpm
fpm -s python -t rpm petname==2.0
sudo yum install -y python-petname-2.0-1.noarch.rpm
fpm -s python -t rpm python-utils==2.3.0
sudo yum install -y python-utils-2.3.0-1.noarch.rpm
fpm -s python -t rpm progressbar2==3.10.1
sudo yum install -y python-progressbar2-3.10.1-1.noarch.rpm
fpm -s python -t rpm pytest-django==2.9.1
sudo yum install -y python-pytest-django-2.9.1-1.noarch.rpm
fpm -s python -t rpm pytest-html==1.9.0
sudo yum install -y python-pytest-html-1.9.0-1.noarch.rpm
fpm -s python -t rpm python-memcached==1.59
sudo yum install -y python-memcached-1.59-1.noarch.rpm
fpm -s python -t rpm python-openid==2.2.5
sudo yum install -y python-openid-2.2.5-1.noarch.rpm
fpm -s python -t rpm python-u2flib-server==4.0.1
sudo yum install -y python-u2flib-server-4.0.1-1.noarch.rpm
fpm -s python -t rpm qrcode==5.3
sudo yum install -y python-qrcode-5.3-1.noarch.rpm
fpm -s python -t rpm querystring-parser==1.2.4
sudo yum install -y python-querystring_parser-1.2.4-1.noarch.rpm
fpm -s python -t rpm redis==2.10.5
sudo yum install -y python-redis-2.10.5-1.noarch.rpm
fpm -s python -t rpm rb==1.7
sudo yum install -y python-rb-1.7-1.noarch.rpm
fpm -s python -t rpm redis-py-cluster==1.3.4
sudo yum install -y python-redis-py-cluster-1.3.4-1.noarch.rpm
fpm -s python -t rpm requests-oauthlib==0.3.3
sudo yum install -y python-requests-oauthlib-0.3.3-1.noarch.rpm
fpm -s python -t rpm percy==2.0.2
sudo yum install -y python-percy-2.0.2-1.noarch.rpm
fpm -s python -t rpm selenium==3.141.0
sudo yum install -y python-selenium-3.141.0-1.noarch.rpm
fpm -s python -t rpm semaphore==0.4.65
sudo yum install -y python-semaphore-0.4.65-1.x86_64.rpm
fpm -s python -t rpm sentry-sdk==0.14.1
sudo yum install -y python-sentry-sdk-0.14.1-1.noarch.rpm
fpm -s python -t rpm setproctitle==1.1.10
sudo yum install -y python-setproctitle-1.1.10-1.x86_64.rpm
fpm -s python -t rpm simplejson==3.8.2
sudo yum install -y python-simplejson-3.8.2-1.x86_64.rpm
fpm -s python -t rpm sqlparse==0.1.19
sudo yum install -y python-sqlparse-0.1.19-1.noarch.rpm
fpm -s python -t rpm statsd==3.1
sudo yum install -y python-statsd-3.1-1.noarch.rpm
fpm -s python -t rpm strict-rfc3339==0.7
sudo yum install -y python-strict-rfc3339-0.7-1.noarch.rpm
fpm -s python -t rpm structlog==16.1.0
sudo yum install -y python-structlog-16.1.0-1.noarch.rpm
fpm -s python -t rpm symbolic==6.1.4
sudo yum install -y python-symbolic-6.1.4-1.x86_64.rpm
fpm -s python -t rpm toronado==0.0.11
sudo yum install -y python-toronado-0.0.11-1.noarch.rpm
fpm -s python -t rpm ua-parser==0.7.3
sudo yum install -y python-ua-parser-0.7.3-1.noarch.rpm
fpm -s python -t rpm uwsgi==2.0.18
sudo yum install -y python-uwsgi-2.0.18-1.noarch.rpm
fpm -s python -t rpm -n PyYAML pyyaml==3.11
sudo yum install -y PyYAML-3.11-1.x86_64.rpm
fpm -s python -t rpm django-auth-ldap==1.2.17
sudo yum install -y python-django-auth-ldap-1.2.17-1.noarch.rpm
Π‘ΠΎΠ±ΠΈΡΠ°Π΅ΠΌ Π² rpm sentry ΠΈ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ Π΅Π³ΠΎ. Π€Π°ΠΉΠ» 6sentry.sh
echo "Install nodejs and yarn"
curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
sudo yum install -y nodejs
sudo sed -e '/nodesource-source/,+6d' -i /etc/yum.repos.d/nodesource-el7.repo
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
sudo yum install -y yarn
cp spec/config.yml spec/sentry.conf.py ~/rpmbuild/SOURCES
cp spec/sentry-cron.service spec/sentry-web.service spec/sentry-worker.service ~/rpmbuild/SOURCES
spectool -g spec/sentry-9.1.2.spec
sudo yum-builddep -y spec/sentry-9.1.2.spec
rpmbuild -bb spec/sentry-9.1.2.spec
sudo yum install -y ~/rpmbuild/RPMS/noarch/python-sentry-9.1.2-1.el7.noarch.rpm
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° sentry rpm Ρ Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΡΠΌΠΈ Π½Π° Π΄ΡΡΠ³ΠΎΠΌ ΡΠ΅ΡΠ²Π΅ΡΠ΅
ΠΡΠΊΠ»ΡΡΠ°Π΅ΠΌ Selinux
sudo sed -i s/^SELINUX=.*$/SELINUX=disabled/ /etc/selinux/config
#### sudo reboot
ΠΠΎΠ΄ΠΊΠ»ΡΡΠ°Π΅ΠΌ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ epel-release
sudo yum install -y epel-release git libjpeg-turbo redis
sudo systemctl start redis
Π£ΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΠΈ Π·Π°ΠΏΡΡΠΊΠ°Π΅ΠΌ PostgreSQL 9.6. Π€Π°ΠΉΠ» 7postgresql.sh
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum install -y postgresql96 postgresql96-server postgresql96-contrib
sudo /usr/pgsql-9.6/bin/postgresql96-setup initdb
sudo systemctl start postgresql-9.6
sudo -i -u postgres psql -c "create user sentry with password 'password';"
sudo -i -u postgres psql -c "create database sentry with owner sentry;"
sudo -i -u postgres psql -c "alter role sentry superuser;"
# TODO: ΠΡΠΎΠ²Π΅ΡΠΈΡΡ Π±Π΅Π· ΠΏΡΠ°Π² superuser Π΄Π»Ρ ΡΠΎΠ»ΠΈ sentry
#sudo -i -u postgres psql -c "alter role sentry nosuperuser;"
#sudo -i -u postgres psql -c "CREATE SCHEMA main AUTHORIZATION sentry;"
ΠΠ°ΠΏΡΡΠΊΠ°Π΅ΠΌ ΠΌΠΈΠ³ΡΠ°ΡΠΈΡ (ΡΠΎΠ·Π΄Π°Π½ΠΈΠ΅ ΡΡ Π΅ΠΌΡ ΠΠ) ΠΈ Π·Π°ΠΏΡΡΠΊΠ°Π΅ΠΌ ΡΠ΅ΡΠ²ΠΈΡΡ. Π€Π°ΠΉΠ» 8start_sentry.sh
sudo systemctl start redis
sudo -i -u sentry /usr/bin/sentry --config /etc/sentry/ upgrade
sudo systemctl start sentry-worker
sudo systemctl start sentry-cron
sudo systemctl start sentry-web
Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ Π²Π½ΡΡΡΠ΅Π½Π½Π΅Π³ΠΎ Π°Π΄ΠΌΠΈΠ½ΠΈΡΡΡΠ°ΡΠΎΡΠ° Sentry
sudo -i -u sentry /usr/bin/sentry --config /etc/sentry/ createuser
Π‘Π±ΠΎΡΠΊΠ° sentry Π² rpm, ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠ°, Π½Π°ΡΡΡΠΎΠΉΠΊΠ° Π΄Π»Ρ Π»Π΅Π½ΠΈΠ²ΡΡ
ΠΡΠΊΠ»ΡΡΠ°Π΅ΠΌ Selinux
sudo sed -i s/^SELINUX=.*$/SELINUX=disabled/ /etc/selinux/config
sudo reboot
ΠΠ°ΠΏΡΡΠΊΠ°Π΅ΠΌ ΡΠΊΡΠΈΠΏΡΡ Π΄Π»Ρ ΡΠ±ΠΎΡΠΊΠΈ ΠΈ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ sentry
sudo yum install -y epel-release git
git clone https://github.com/patsevanton/sentry-rpm.git
cd sentry-rpm
./1general_dependencies.sh
./2psycopg2-binary.sh
./3dateutil.sh
./4urllib3.sh
./5other_dependencies.sh
./6sentry.sh
ΠΠΎΠΏΠΈΡΡΠ΅ΠΌ rpm ΠΈΠ· rpmbuild/RPMS ΠΈ ΠΊΠΎΡΠ½Ρ sentry-rpm Π½Π° ΡΠ΅Π»Π΅Π²ΠΎΠΉ ΡΠ΅ΡΠ²Π΅Ρ. Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ yum ΡΠ΅ΠΏΠΎ. Π£ΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ Π²ΡΠ΅ ΡΠΎΠ±ΡΠ°Π½Π½ΡΠ΅ rpm ΠΏΠ°ΠΊΠ΅ΡΡ.
./7postgresql.sh
./8start_sentry.sh
Π‘ΠΎΠ·Π΄Π°Π΅ΠΌ Π²Π½ΡΡΡΠ΅Π½Π½Π΅Π³ΠΎ Π°Π΄ΠΌΠΈΠ½ΠΈΡΡΡΠ°ΡΠΎΡΠ° Sentry
sudo -i -u sentry /usr/bin/sentry --config /etc/sentry/ createuser
Π’Π΅ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΠΎΡΠΏΡΠ°Π²ΠΊΠΈ exception
Π’Π΅ΡΡΠΈΡΠΎΠ²Π°ΡΡ Π±ΡΠ΄Π΅ΠΌ Π½Π° java ΠΏΡΠΎΠ΅ΠΊΡΠ΅. Π‘ΠΊΠ°ΡΠΈΠ²Π°Π΅ΠΌ java ΠΈ maven.
sudo yum install -y java-1.8.0-openjdk-devel git
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo yum -y install apache-maven
git clone https://github.com/getsentry/examples.git
cd examples/java/basic
mvn compile exec:java
Π’Π΅ΠΏΠ΅ΡΡ Π½Π°ΠΌ Π½ΡΠΆΠ½ΠΎ Π·Π°ΠΏΡΡΡΠΈΡΡ java ΠΏΠ΅ΡΠ΅Π΄Π°Π² Π΅ΠΌΡ SENTRY_DSN
SENTRY_DSN=https://public:private@host:port/1 mvn exec:java
Π’Π΅ΠΏΠ΅ΡΡ Π½ΡΠΆΠ½ΠΎ Π½Π°ΠΉΡΠΈ ΡΠ³Π΅Π½Π΅ΡΠΈΡΠΎΠ²Π°Π½Π½ΡΠΉ ΠΏΠΎ ΡΠΌΠΎΠ»ΡΠ°Π½ΠΈΡ SENTRY_DSN.
ΠΠ°Ρ
ΠΎΠ΄ΠΈΠΌ Π² Sentry. ΠΠ΄Π΅ΠΌ Π² ΠΏΡΠΎΠ΅ΠΊΡ ΠΏΠΎ ΡΠΌΠΎΠ»ΡΠ°Π½ΠΈΡ internal.
ΠΈΠ»ΠΈ
ΠΠ΅ΡΠ΅Ρ ΠΎΠ΄ΠΈΠΌ Π² Π½Π°ΡΡΡΠΎΠΉΠΊΠΈ ΠΏΡΠΎΠ΅ΠΊΡΠ°.
ΠΠ΅ΡΠ΅Ρ ΠΎΠ΄ΠΈΠΌ Π² Client Keys (DSN).
ΠΠΎΠΏΠΈΡΡΠ΅ΠΌ DSN. ΠΡΠΎ ΠΈ Π΅ΡΡΡ SENTRY_DSN.
ΠΠ°ΠΏΡΡΠΊΠ°Π΅ΠΌ java Ρ ΡΡΠΈΠΌ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΠΎΠΌ.
SENTRY_DSN=http://[email protected]:9000/1 mvn exec:java
ΠΠΈΠ΄ΠΈΠΌ ΡΠ°ΠΊΡΡ ΠΊΠ°ΡΡΠΈΠ½Ρ.
ΠΡΠ»ΠΈ ΠΏΠ΅ΡΠ΅ΠΉΠ΄Π΅ΠΌ Π² UnsupportedOperationException
, ΡΠΎ ΡΠ²ΠΈΠ΄Π΅ΠΌ ΡΠ°ΡΡΠΈΡΠ΅Π½Π½ΡΡ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ.
Π‘ΠΎΠ·Π΄Π°Π» Telegram ΡΠ°Ρ ΠΏΠΎ Sentry
Π ΡΠ»Π΅Π΄ΡΡΡΠΈΡ ΡΠ΅ΡΠΈΡΡ :
- ΠΡΠΎΡΠ΅ΡΡΠΈΡΠΎΠ²Π°ΡΡ LDAP. Π‘ΠΊΡΠΈΠΏΡ ΡΠΆΠ΅ Π·Π°Π³ΠΎΡΠΎΠ²ΠΈΠ»
9sentry-ldap-auth.sh
- ΠΡΠΎΡΠ΅ΡΡΠΈΡΠΎΠ²Π°ΡΡ sentry Π²Π΅ΡΡΠΈΡ 10.0.X ΠΏΠΎΡΠ»Π΅ ΡΠΎΠ³ΠΎ ΠΊΠ°ΠΊ Π²ΡΠΊΠ°ΡΡΡ ΠΏΠ°ΡΡ ΠΌΠΈΠ½ΠΎΡΠ½ΡΡ ΡΠ΅Π»ΠΈΠ·ΠΎΠ².
Π Π΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ ΡΠΎ ΡΠΊΡΠΈΠΏΡΠ°ΠΌΠΈ:
ΠΡΡΠΎΡΠ½ΠΈΠΊ: habr.com