Continuing from the previous session. I changed the title. Part 2, but the case number starts with 1.
Detailed explanation NewRelic monitoring & performance improvement-Part 1 Detailed explanation NewRelic monitoring & performance improvement-Part 2
It is a survival confirmation. If you try to do it right, you can make a request to a set of APIs and check the response. However, in reality, it is not necessary to do so, and I think that you can check whether the response is correct by throwing whether the application is running or not to one API for survival confirmation. At that time, what kind of API is created is important. Instead of just returning echo like the echo server, it is good to make a light query to connected services such as MySQL and Redis. By doing so, you can also check the existence of MySQL and Redis at the same time.
In New Relic, you can set it as follows.
After setting, you can see the result in Availability.
You can also set Alert mail etc., so if you set it, you can quickly notice when the system goes down. In the team to which you belong, you will be notified in the chat when the development environment becomes unreachable, so you can quickly notice and correct it.
The apps that are deployed worldwide depend on the response time from each country. In New Relic, you can check the response time from the following regions by setting SYNTHETICS. It will be sent at regular intervals.
In New Relic, the exceptions that occur are displayed in Errors, but they don't contain application-specific information unless you set them yourself. For example, if something that can identify a user such as player_id is recorded with an exception, you can search for that user from the application management screen etc. and find out more detailed status of the exception.
If you set it correctly in New Relic, it looks like the following.
It is set as follows on the source code. It's a common process, so it seems that it will make you feel good if you put it in the pre-process of decorator or view. (Story on Django)
Add player_id to #newrelic newrelic.agent.add_custom_parameter('player_id', player.id)
If it improves, it is meaningless unless you measure it and check if it is actually faster. You can also check that area with New Relic.
Last time, I said that I would like to introduce Key Transactions, X-Ray, but if I introduced other ones, the time has expired, so I will do it next time. Next time, I will introduce Key Transactions, X-Ray from the beginning.