Sentry
Sentry is written in Python and is open source with excellent performance (…)
- Sentry rewrites the window.onerror function to implement error monitoring logic, add runtime information to help locate errors, cross-browser compatibility for error handling, and more
Support multiple types of projects
- js
- vue
- node
- react
Real-time error reporting
When an error is caught, an error sends a request to the Sentry server,
The console will update the error log, support mailbox alarm configuration.
All collected data is saved for 90 days by default
The console
- Chinese is supported, but some are in English
- More types of data statistical presentation
Easy installation
At present, the whole set of code is open source, and the author’s integration, so that the majority of users quickly install, but part of the custom modification configuration is not clear
- Install using Python
- Install with Docker (recommended). Here is Docker
0. Preconditions
Please install the Docker environment firstCopy the code
1. Download the Github project file
git clone https://github.com/getsentry/onpremise.git
Copy the code
2. Execute the installation script (note that CD enters the project)
Sh Automatically installs all dependent environments and services for the projectCopy the code
3. Start the project in docker environment: the default port is 9000
docker-compose up -d
Copy the code
The advantages and disadvantages
No contrast, no harm
Although some API development, early use is a problem (of course you can not use) you can deploy, but how to change his source code, secondary development is a lot more difficult even if the advantages are also insufficient
advantages
- Free and open source (great advantage)
- The whole system is deployed and run in its own service without data passing through three parties
- More graphs and statistics on display
disadvantages
- Because this project is a foreign project, the document friendliness is low, and there are some differences in use
- Extended functions, secondary development is difficult, customization, customization poor
- Installation and running environments are required
The problem
- Currently stuck on the server deployment, IP, file configuration, etc., Kaiko is now unable to run. When external network access is allowed, the IP address of the project is still the default, but the service must be accessed using a public IP address, not a private IP address.
conclusion
Technology, ability, time
- Personal recommendations
Build > Sentry > fundebugCopy the code
- Specific situation analysis, the following comprehensive consideration
Requirement: strong customization please select
Front-end collection: global exception processing, asynchronous exception collection, Sourcemap parsing, zone.js, user behavior backtracking, Performance information collection, frame rate monitoring, network request interception, resource loading monitoring and other data cleaning: Kafka, Grafana, Kibana, Flink, Clickhouse, Prometheus server development: Java Redis SQL RocketMQCopy the code
Requirement: build on your own server
sentry
Copy the code
Requirement: fast project monitoring, low cost
Third-party platforms such as FundebugCopy the code
The appendix
Part of the docker directive
To generate the secret key
docker-compose run --rm web config generate-secret-key
Copy the code
Error handling – Docker installation environment required
docker volume create --name=sentry-data
docker volume create --name=sentry-postgres
docker volume create --name=sentry-redis
docker volume create --name=sentry-zookeeper
docker volume create --name=sentry-kafka
docker volume create --name=sentry-clickhouse
docker volume create --name=sentry-symbolicator
Copy the code
.env
SENTRY_EMAIL_HOST=smtp.mailgun.org
SENTRY_EMAIL_PORT=9000
SENTRY_SERVER_EMAIL=gongpengji@163.com
SENTRY_EMAIL_USER=gongpengji@163.com
SENTRY_EMAIL_PASSWORD=
SENTRY_EMAIL_USE_TLS=true
Copy the code
The service is started
docker-compose down && docker-compose up -d
Copy the code
Local 9000 port, view access