{"id":389804,"date":"2024-06-29T08:50:10","date_gmt":"2024-06-29T08:50:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=389804"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=389804","title":{"rendered":"<span>\u042d\u043a\u043e\u043d\u043e\u043c\u043d\u044b\u0439 APM \u0434\u043b\u044f backend \u0438\u043b\u0438 \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Loki+Grafana+\u043b\u043e\u0433\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f APM<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h2>\n<p>API \u0441\u0442\u0430\u043b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437 \u0440\u0430\u0431\u043e\u0442\u044b, \u0438 \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e backend&#8217;\u0430. \u041e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0433\u043e backend&#8217;\u0430 \u043d\u0430 php \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442:<\/p>\n<ul>\n<li>\n<p>\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0411\u0414;<\/p>\n<\/li>\n<li>\n<p>\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u044d\u0448\u0435\u043c (\u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0435 hitrate, \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0451\u043c\u0430 \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445);<\/p>\n<\/li>\n<li>\n<p>\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432 backend (\u0432\u044b\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0442\u044f\u0436\u0451\u043b\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445)<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0451 \u044d\u0442\u043e \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043e, \u043d\u043e \u043d\u0435 \u0434\u0430\u0432\u0430\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0430 &#8212; API \u0431\u044b\u043b \u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u0432 \u043d\u0451\u043c \u0431\u044b\u043b\u043e \u043c\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0441 \u0440\u0430\u0437\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439, \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0441\u0432\u044f\u0437\u044f\u043c\u0438. \u0422\u043e\u0447\u0435\u0447\u043d\u044b\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0434\u0430\u0432\u0430\u043b\u0438 \u044d\u0444\u0444\u0435\u043a\u0442, \u043d\u043e \u0431\u044b\u043b\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0432\u0435\u0441\u044c backend \u0441\u0432\u0435\u0440\u0445\u0443 &#8212; \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0442\u043e\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449 (\u0411\u0414, \u043a\u044d\u0448, \u0441\u0435\u0440\u0432\u0438\u0441\u044b) \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0423\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 APM (newrelic, datadog, elastic apm agent, dynatrace, open tracing) \u0431\u044b\u043b\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b, \u043d\u043e \u043d\u0435 \u0431\u044b\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u044b \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f php, \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u044c \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044e \u0438\/\u0438\u043b\u0438 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0443\u0437\u043b\u044b. <\/p>\n<p>\u0421\u043e\u0433\u043b\u0430\u0448\u0443\u0441\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0439 APM \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043d\u0435 \u0430\u043d\u0430\u043b\u0438\u0437 \u043b\u043e\u0433\u043e\u0432, \u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0441 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 &#8212; \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c\u0438, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u0438 &#8212; \u044d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0434\u043e\u043b\u044c\u0448\u0435 \u0436\u0438\u0432\u0451\u0442 (\u043f\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0443 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c) \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b\u0441\u044f \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0441\u044f\u0446\u0435\u0432, \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c \u043c\u0435\u043d\u044f\u044f \u0430\u043a\u0446\u0435\u043d\u0442\u044b \u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u041e\u0442\u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e \u0431\u044b\u043b \u0435\u0449\u0451 \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442: <em>\u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0434\u0430\u0447\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u043d\u0430 \u043b\u043e\u0433\u0430\u0445 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0443\u0441\u0438\u043b\u0438\u044f\u043c\u0438<\/em>.<\/p>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0420\u0435\u0448\u0435\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0437 nginx \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (php-fpm \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435), \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u0432 loki, \u0434\u043b\u044f \u0441\u043a\u043b\u0430\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c-\u043e\u0442\u0432\u0435\u0442\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0443\u0442 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u044b grafana+loki \u0438 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0433\u0440\u0430\u0444\u0438\u043a\u0438.<\/p>\n<p>\u0412 \u043f\u043b\u0430\u043d\u0435:<\/p>\n<ol>\n<li>\n<p><strong>\u041c\u0435\u043d\u044f\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442 \u043b\u043e\u0433\u043e\u0432 nginx \u0438 php-fpm<\/strong> &#8212; \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432\u044b\u0432\u043e\u0434 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438 \u043c\u0435\u043d\u044f\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442 \u043d\u0430 json; <br \/><em>\u042d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e: \u0432\u0441\u0451 \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438: \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0430\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e log_format \u0438 access.format \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/em><\/p>\n<\/li>\n<li>\n<p><strong>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043b\u043e\u0433\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\/\u043a\u043e\u043c\u0430\u043d\u0434 \u0441 \u0442\u0430\u0439\u043c\u0438\u043d\u0433\u043e\u043c<\/strong> &#8212; \u043a \u0411\u0414 \u0438 \u043a\u044d\u0448\u0443 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<br \/><em>\u042d\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e, \u0432\u0435\u0434\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u043d\u043e \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (pdo, cache) \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 <\/em><code>$dbConnectionTime += $start_connection_time - microtime(true)<\/code><em>.<\/em><\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/strong> \u0432 \u043f\u0440\u043e\u043a\u043b\u0430\u0434\u043a\u0443 (\u043d\u0430\u0437\u0432\u0430\u043d\u043d\u0443\u044e <em>\u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440\u043e\u043c<\/em>), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b) \u043e\u0442\u0432\u0435\u0442\u0430 \u0438 \u043b\u043e\u0433\u0433\u0438\u0440\u0443\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u0430; <br \/><em>\u042d\u0442\u043e \u0431\u044b\u043b\u043e \u0434\u0430\u0436\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0432\u0435\u0434\u044c \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c (\u0430 \u0438\u0445 \u0443\u0436\u0435 \u043e\u043a\u043e\u043b\u043e 15) \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f, \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0438 \u043b\u043e\u0433\u0433\u0438\u0440\u0443\u044e\u0442\u0441\u044f.<\/em><\/p>\n<\/li>\n<\/ol>\n<h3>\u0424\u043e\u0440\u043c\u0430\u0442 \u043b\u043e\u0433\u043e\u0432 nginx \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>\u041b\u043e\u0433\u0438 nginx \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"json\">{     \"body_bytes_sent\": \"3186\",     \"client_ip\": \"10.***.***.***\",     \"client_req_id\": \"cad148c1-****-4819-****-035a4a9ace14\",     \"connection\": \"10186566\",     \"http_user_agent\": \"***\",     \"pid\": \"16\",     \"request_method\": \"POST\",     \"request_time\": \"0.102\",     \"request_uri\": \"\/***\/***\/***?***=***\",     \"request_uri_path\": \"\/***\/***\/***\",     \"status\": \"200\",     \"time_local\": \"10\/Apr\/2023:23:27:15 +0300\",     \"upstream_connect_time\": \"0.000\",     \"upstream_header_time\": \"0.101\",     \"upstream_response_time\": \"0.101\",     \"uri\": \"\/index.php\" }<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 nginx<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"nginx\">\/\/ \u043e\u0431\u0449\u0438\u0435 http {     \/\/ ...     log_format json_upstream_logs escape=json '{\"time_local\":\"$time_local\",\"client_req_id\":\"$client_req_id\",\"client_ip\":\"$client_ip\",\"request_method\":\"$request_method\",\"request_uri\":\"$request_uri\",\"request_uri_path\":\"$request_uri_path\",\"status\":\"$status\",\"body_bytes_sent\":\"$body_bytes_sent\",\"http_user_agent\":\"$http_user_agent\",\"request_time\":\"$request_time\",\"uri\":\"$uri\",\"upstream_connect_time\":\"$upstream_connect_time\",\"upstream_header_time\":\"$upstream_header_time\",\"upstream_response_time\":\"$upstream_response_time\",\"pid\":\"$pid\",\"connection\":\"$connection\"}';     \/\/ ...     map $request_uri $request_uri_path {         \"~^(?P&lt;path>[^?]*)(\\?.*)?$\"  $path;     } }  \/\/ \u0441\u0435\u0440\u0432\u0435\u0440\u0430 server {     #\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u043d\u0435\u0442 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 - \u0441\u043e\u0437\u0434\u0430\u0451\u043c     if ($arg_client_req_id !~ $arg_client_req_id) {         set $client_req_id $request_id;     }     if ($arg_request_id) {         set $client_req_id $arg_request_id;     }     if ($arg_client_req_id) {         set $client_req_id $arg_client_req_id;     }     #\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 ip \u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430     # \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0441 \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0442\u0430\u043a \u0447\u0442\u043e HTTP-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0435     if ($http_x_real_ip !~ $http_x_real_ip) {         set $client_ip $remote_addr;     }     if ($http_x_real_ip) {         set $client_ip $http_x_real_ip;     }       location ~ ^\/index\\.php$ {         \/\/ ..         access_log  \/var\/log\/nginx\/access.log  json_upstream_logs;         \/\/ ..     } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0417\u0430\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0435 \u043b\u043e\u0433\u0438 php-fpm \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0442\u043e\u0436\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"json\">{     \"C\": \"43.21\",     \"M\": \"2097152\",     \"P\": \"9\",     \"Q\": \"\",     \"R\": \"-\",     \"RequestId\": \"f894d70d5910***3772a94261f7c40ca\",     \"T\": \"20\/Apr\/2023:16:17:19 +0300\",     \"d\": \"0.023\",     \"f\": \"\/var\/www\/html\/web\/\/index.php\",     \"l\": \"42\",     \"m\": \"POST\",     \"n\": \"www\",     \"p\": \"17\",     \"q\": \"\",     \"r\": \"\/index.php\",     \"s\": \"200\",     \"t\": \"20\/Apr\/2023:16:17:19 +0300\",     \"u\": \"\" }<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 php-fpm<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>access.format = '{\"RequestId\":\"%{REQUEST_ID}e\",\"C\":\"%C\",\"d\":\"%d\",\"f\":\"%f\",\"l\":\"%l\",\"m\":\"%m\",\"M\":\"%M\",\"n\":\"%n\",\"P\":\"%P\",\"p\":\"%p\",\"q\":\"%q\",\"Q\":\"%Q\",\"r\":\"%r\",\"R\":\"%R\",\"s\":\"%s\",\"T\":\"%T\",\"t\":\"%t\",\"u\":\"%u\"}'<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h3>\u0422\u0430\u0439\u043c\u0438\u043d\u0433\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/h3>\n<p>\u041a\u043e \u0432\u0441\u0435\u043c \u043b\u043e\u0433\u0430\u043c \u0438\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0435\u0442\u0430-\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e (\u0434\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043b\u043e\u0433\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438):<\/p>\n<ul>\n<li>\n<p>id \u0437\u0430\u043f\u0440\u043e\u0441\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441;<\/p>\n<\/li>\n<li>\n<p>id \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0441\u0435\u0441\u0441\u0438\u044f;<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0451: \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u044b\/\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0411\u0414, \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u044b\/\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 \u043a\u044d\u0448\u0435, \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u044f\/\u043e\u0431\u044a\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0418\u0437 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0432\u0443\u044e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0443\u044e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 &#8212; <strong>timings,<\/strong> \u043e \u0445\u043e\u0434\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044e \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"json\">{     \"cacheCommands\": 14,     \"cacheCommandsTime\": 0.005800008773803711,     \"cacheConnectionTime\": 0.0006201267242431641,     \"cacheReads\": 7,     \"cacheReadsSize\": 7989,     \"cacheWrites\": 4,     \"cacheWritesSize\": 1480,     \"dbConnectionTime\": 0.0017120838165283203,     \"dbQueries\": 5,     \"dbQueriesTime\": 0.0563662052154541,     \"externalCalls\": 1,     \"externalCallsTime\": 0.03611111640930176 }<\/code><\/pre>\n<h3>\u0412\u044b\u0437\u043e\u0432\u044b \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/h3>\n<p>\u041e\u0431 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0432\u0442\u043e\u0440\u0443\u044e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f &#8212; <strong>external_calls<\/strong> &#8212; \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043f\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044e \u0432 \u043b\u043e\u0433\u0435.<\/p>\n<ul>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"json\">{     \"requestTime\": 0.03611111640930176,     \"requestUrl\": \"http:\/\/10.***.***.***\/***\/***\/***\/***\",     \"systemId\": \"***\" }<\/code><\/pre>\n<ul>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u044b\u0437\u043e\u0432\u0430:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"json\">{     \"error\": \"cURL error 28: Connection timeout after 1001 ms (see https:\/\/curl.haxx.se\/libcurl\/c\/libcurl-errors.html): 0\",     \"request\":     {         \"body\": \"\",         \"url\": \"http:\/\/***.***.***:8280\/***\/***\/***?***=***\"     },     \"requestTime\": 1.0022687911987305,     \"response\": null,     \"systemId\": \"***\" }<\/code><\/pre>\n<h2>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0432\u043e\u043e\u0440\u0443\u0436\u0438\u0442\u044c\u0441\u044f logql, \u0433\u0440\u0430\u0444\u0430\u043d\u043e\u0439 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432\u0435\u0440\u043d\u044b\u0435 \u043a \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0443.<\/p>\n<p>\u0417\u0430\u0432\u043e\u0434\u0438\u043c \u0434\u0432\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0431\u043e\u0438\u0445 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0430\u0445 (\u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0441\u043c\u0435\u043d\u0430 \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0443\u0440\u0430):<\/p>\n<ul>\n<li>\n<p>$nginx_source &#8212; logql-\u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u043b\u043e\u0433\u043e\u0432 nginx<\/p>\n<\/li>\n<li>\n<p>$fpm_source &#8212; logql-\u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u043b\u043e\u0433\u043e\u0432 php-fpm<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0435\u0441\u044c APM \u043f\u043e\u0434\u0435\u043b\u0451\u043d \u043d\u0430 \u0434\u0432\u0435 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u044b:<\/p>\n<ol>\n<li>\n<p><strong>Performance Status<\/strong>. \u0414\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 &#171;\u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0451 \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f&#187;.<\/p>\n<\/li>\n<li>\n<p><strong>Remote Calls<\/strong>. \u0414\u043b\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ol>\n<h3>Performance Status<\/h3>\n<p>\u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0431\u043b\u043e\u043a\u043e\u0432:<\/p>\n<p><strong>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 API \u0432 \u0440\u0430\u0437\u0440\u0435\u0437\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432\/\u043a\u043e\u0434\u043e\u0432 \u043e\u0442\u0432\u0435\u0442\u0430.<\/strong><\/p>\n<ol>\n<li>\n<p>RPS. <em>\u0421\u0447\u0451\u0442\u0447\u0438\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a\u043e \u0432\u0441\u0435\u043c\u0443 API, \u0441 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u043a\u043e\u0434\u0430\u043c \u043e\u0442\u0432\u0435\u0442\u0430 nginx.<\/em><\/p>\n<\/li>\n<li>\n<p>Summary for {code}. <em>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0437 \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 grafana \u043b\u044e\u0431\u044b\u0435 \u043a\u043e\u0434\u044b \u043e\u0442\u0432\u0435\u0442\u0430, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b:<\/em><\/p>\n<ol>\n<li>\n<p>Average Response time (nginx \/ fpm).<\/p>\n<\/li>\n<li>\n<p>Response time. <em>\u041f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c nginx.<\/em><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>Response count by path for {code}. <em>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c \u0434\u043b\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043e\u0442\u0432\u0435\u0442\u0430.<\/em><\/p>\n<\/li>\n<li>\n<p>Response size by path. <em>\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/em><\/p>\n<\/li>\n<li>\n<p>Response time by path. <em>\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/em><\/p>\n<\/li>\n<\/ol>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cf9\/688\/c53\/cf9688c5360e677bd5ac70490e5014b2.png\" alt=\"RPS \u043f\u043e \u0432\u0441\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c \u043a API\" title=\"RPS \u043f\u043e \u0432\u0441\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c \u043a API\" width=\"902\" height=\"501\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cf9\/688\/c53\/cf9688c5360e677bd5ac70490e5014b2.png\"\/><\/p>\n<div><figcaption>RPS \u043f\u043e \u0432\u0441\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c \u043a API<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p><em>{{status}}:<\/em> <code>sum by (status) (rate($nginx_source | json | error != \"JSONParserErr\"[1s]))<\/code><\/p>\n<\/div>\n<\/details>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a7a\/625\/8f0\/a7a6258f0c62e1052463333a292e2dd7.png\" alt=\"\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430 API\" title=\"\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430 API\" width=\"892\" height=\"750\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a7a\/625\/8f0\/a7a6258f0c62e1052463333a292e2dd7.png\"\/><\/p>\n<div><figcaption>\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430 API<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"269\" width=\"269\">\n<p align=\"left\">avg by nginx &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>avg_over_time( $nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap request_time | __error__=\"\"[1s] ) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"269\" width=\"269\">\n<p align=\"left\">connect_time &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>avg_over_time($nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap upstream_connect_time | __error__=\"\"[1s]) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"269\" width=\"269\">\n<p align=\"left\">header_time &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>avg_over_time($nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap upstream_header_time | __error__=\"\"[1s]) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"269\" width=\"269\">\n<p align=\"left\">response_time &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>avg_over_time($nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap upstream_response_time | __error__=\"\"[1s]) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"269\" width=\"269\">\n<p align=\"left\">avg by php-fpm &#8212; {{s}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>avg_over_time($fpm_source | json | __error__ != \"JSONParserErr\" | s=$http_code | unwrap d | __error__=\"\"[1s]) by (s)<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/details>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d6e\/943\/dd6\/d6e943dd6af56a7b7545186813d9b0c8.png\" alt=\"\u041f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0442\u0432\u0435\u0442\u0430\" title=\"\u041f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0442\u0432\u0435\u0442\u0430\" width=\"884\" height=\"712\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d6e\/943\/dd6\/d6e943dd6af56a7b7545186813d9b0c8.png\"\/><\/p>\n<div><figcaption>\u041f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0442\u0432\u0435\u0442\u0430<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"left\">max by nginx &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>max_over_time($nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap request_time | __error__=\"\"[1s]) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">95% by nginx &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>quantile_over_time(0.95, $nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap request_time | __error__=\"\"[1s]) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">90% by nginx &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>quantile_over_time(0.9, $nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap request_time | __error__=\"\"[1s]) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">70% by nginx &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>quantile_over_time(0.7, $nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap request_time | __error__=\"\"[1s]) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">50% by nginx &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>quantile_over_time(0.5, $nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap request_time | __error__=\"\"[1s]) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">30% by nginx &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>quantile_over_time(0.3, $nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap request_time | __error__=\"\"[1s]) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/details>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/924\/203\/af2\/924203af23e0f39cc9cb27c349c93c24.png\" alt=\"\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0443\" title=\"\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0443\" width=\"903\" height=\"337\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/924\/203\/af2\/924203af23e0f39cc9cb27c349c93c24.png\"\/><\/p>\n<div><figcaption>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0443<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p><em>{{request_uri_path}}:<\/em> <code>sum by (request_uri_path) (rate($nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code [1s]))<\/code><\/p>\n<\/div>\n<\/details>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/396\/d72\/030\/396d72030bd5e0ba6a4fbf79b9579b7a.png\" alt=\"\u0420\u0430\u0437\u043c\u0435\u0440 \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0443\" title=\"\u0420\u0430\u0437\u043c\u0435\u0440 \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0443\" width=\"903\" height=\"417\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/396\/d72\/030\/396d72030bd5e0ba6a4fbf79b9579b7a.png\"\/><\/p>\n<div><figcaption>\u0420\u0430\u0437\u043c\u0435\u0440 \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0443<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p><em>{{request_uri_path}}:<\/em> <code>avg_over_time($nginx_source | json | __error__ != \"JSONParserErr\" | unwrap body_bytes_sent | __error__=\"\"[1s]) by (request_uri_path)<\/code><\/p>\n<\/div>\n<\/details>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1e3\/b4d\/a35\/1e3b4da3555dc33bb47ce35137a1d9d5.png\" alt=\"\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\" title=\"\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\" width=\"903\" height=\"417\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1e3\/b4d\/a35\/1e3b4da3555dc33bb47ce35137a1d9d5.png\"\/><\/p>\n<div><figcaption>\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p><em>{{request_uri_path}}:<\/em> <code>avg_over_time($nginx_source | json | __error__ != \"JSONParserErr\" | unwrap request_time | __error__=\"\"[1s]) by (request_uri_path)<\/code><\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<p><strong>\u0421\u0432\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0440\u0430\u0437\u0440\u0435\u0437\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449 (\u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c fpm).<\/strong><\/p>\n<ol>\n<li>\n<p>DB\/cache\/calls summary. <em>\u0422\u0440\u0430\u0442\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438: \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0411\u0414, \u043a\u044d\u0448\u0435\u043c \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438.<\/em><\/p>\n<\/li>\n<li>\n<p>queries and commands. <em>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0447\u0442\u0435\u043d\u0438\u0439\/\u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0438\u0437 \u043a\u044d\u0448\u0430.<\/em><\/p>\n<\/li>\n<li>\n<p>cache size. <em>\u041e\u0431\u044a\u0451\u043c \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0445\/\u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u044d\u0448.<\/em><\/p>\n<\/li>\n<li>\n<p>External calls summary. <em>\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438.<\/em><\/p>\n<\/li>\n<\/ol>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/32c\/75c\/e1e\/32c75ce1e97badc5274b43f4cee7b5e7.png\" alt=\"\u0421\u0432\u043e\u0434\u043a\u0430 \u043f\u043e \u0437\u0430\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u043e\u043c\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438\" title=\"\u0421\u0432\u043e\u0434\u043a\u0430 \u043f\u043e \u0437\u0430\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u043e\u043c\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438\" width=\"898\" height=\"420\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/32c\/75c\/e1e\/32c75ce1e97badc5274b43f4cee7b5e7.png\"\/><\/p>\n<div><figcaption>\u0421\u0432\u043e\u0434\u043a\u0430 \u043f\u043e \u0437\u0430\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u043e\u043c\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"left\">connect to db time<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>sum(sum_over_time($fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_dbConnectionTime | __error__=\"\"[1s]))<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">db queries time<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>sum(sum_over_time($fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_dbQueriesTime | __error__=\"\"[1s]))<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">connect to cache time<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>sum(sum_over_time($fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_cacheConnectionTime | __error__=\"\"[1s]))<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">cache time<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>sum(sum_over_time($fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_cacheCommandsTime | __error__=\"\"[1s]))<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">external calls time<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>sum(sum_over_time($fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_externalCallsTime | __error__=\"\"[1s]))<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/details>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/02a\/439\/c1d\/02a439c1d5caa6aa114c02f3a3d1f3b2.png\" alt=\"\u0417\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u0411\u0414 \u0438 \u0432 \u043a\u044d\u0448\" title=\"\u0417\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u0411\u0414 \u0438 \u0432 \u043a\u044d\u0448\" width=\"895\" height=\"381\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/02a\/439\/c1d\/02a439c1d5caa6aa114c02f3a3d1f3b2.png\"\/><\/p>\n<div><figcaption>\u0417\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u0411\u0414 \u0438 \u0432 \u043a\u044d\u0448<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"left\">db queries<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>sum(sum_over_time($fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_dbQueries | __error__=\"\"[1s]))<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">cache commands<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>sum(sum_over_time($fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_cacheCommands | __error__=\"\"[1s]))<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">cache reads<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>sum(sum_over_time($fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_cacheReads | __error__=\"\"[1s]))<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">cache writes<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>sum(sum_over_time($fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_cacheWrites | __error__=\"\"[1s]))<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/details>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1ab\/326\/215\/1ab32621588643d752a996a859d4a41f.png\" alt=\"\u041e\u0431\u044a\u0451\u043c \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u0438\u0437 \u043a\u044d\u0448\u0430\" title=\"\u041e\u0431\u044a\u0451\u043c \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u0438\u0437 \u043a\u044d\u0448\u0430\" width=\"895\" height=\"381\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1ab\/326\/215\/1ab32621588643d752a996a859d4a41f.png\"\/><\/p>\n<div><figcaption>\u041e\u0431\u044a\u0451\u043c \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u0438\u0437 \u043a\u044d\u0448\u0430<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"left\">read from cache<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>sum(sum_over_time($fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_cacheReadsSize | __error__=\"\"[1s]))<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">write to cache<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>sum(sum_over_time($fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_cacheWritesSize | __error__=\"\"[1s]))<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/details>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6d5\/89f\/e03\/6d589fe039799b110dd5dd965a989c34.png\" alt=\"\u041f\u043e\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0432\u044b\u0437\u043e\u0432\u044b \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432\" title=\"\u041f\u043e\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0432\u044b\u0437\u043e\u0432\u044b \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432\" width=\"893\" height=\"416\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6d5\/89f\/e03\/6d589fe039799b110dd5dd965a989c34.png\"\/><\/p>\n<div><figcaption>\u041f\u043e\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0432\u044b\u0437\u043e\u0432\u044b \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p><em>{{request_uri_path}}<\/em>: <code>avg_over_time($fpm_source |=`:\"external_calls\"` | json | __error__ != \"JSONParserErr\" | unwrap message_requestTime | __error__=\"\"[1s]) by (message_systemId)<\/code><\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<p><strong>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0414 \u0432 \u0440\u0430\u0437\u0440\u0435\u0437\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/strong><\/p>\n<ol>\n<li>\n<p>DB time. <em>\u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0414 \u0441\u0440\u0435\u0434\u043d\u0435\u0435.<\/em><\/p>\n<\/li>\n<li>\n<p>DB queries count. <em>\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0411\u0414.<\/em><\/p>\n<\/li>\n<\/ol>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a91\/b71\/e35\/a91b71e35504e6220fe5a4d6f73d3e42.png\" alt=\"\u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0414 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\" title=\"\u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0414 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\" width=\"902\" height=\"405\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a91\/b71\/e35\/a91b71e35504e6220fe5a4d6f73d3e42.png\"\/><\/p>\n<div><figcaption>\u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0414 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p><em>{{request_uri_path}}:<\/em> <code>avg_over_time($fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_dbQueriesTime | __error__=\"\"[1s]) by (method)<\/code><\/p>\n<\/div>\n<\/details>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b8b\/9af\/af1\/b8b9afaf1de9ccc28320a8e6c8110f33.png\" alt=\"\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0411\u0414 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\" title=\"\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0411\u0414 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\" width=\"901\" height=\"374\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b8b\/9af\/af1\/b8b9afaf1de9ccc28320a8e6c8110f33.png\"\/><\/p>\n<div><figcaption>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0411\u0414 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p><em>{{request_uri_path}}: <\/em><code>avg_over_time($fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_dbQueries | __error__=\"\"[1s]) by (method)<\/code><\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<p><strong>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u044d\u0448\u0435\u043c \u0432 \u0440\u0430\u0437\u0440\u0435\u0437\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/strong><\/p>\n<ol>\n<li>\n<p>Cache commands time. <em>\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u044d\u0448\u0435\u043c.<\/em><\/p>\n<\/li>\n<li>\n<p>Cache commands count. <em>\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u0430\u043d\u0434 \u043a \u043a\u044d\u0448\u0443.<\/em><\/p>\n<\/li>\n<li>\n<p>Cache writes size. <em>\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043a\u044d\u0448.<\/em><\/p>\n<\/li>\n<li>\n<p>Cache reads size. <em>\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043a\u044d\u0448.<\/em><\/p>\n<\/li>\n<\/ol>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ddb\/ea5\/e72\/ddbea5e728d6ae71379e5df1a84ca26b.png\" alt=\"\u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u044d\u0448\u0435\u043c \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\" title=\"\u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u044d\u0448\u0435\u043c \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\" width=\"908\" height=\"408\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ddb\/ea5\/e72\/ddbea5e728d6ae71379e5df1a84ca26b.png\"\/><\/p>\n<div><figcaption>\u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u044d\u0448\u0435\u043c \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p><em>{{request_uri_path}}:<\/em> <code>avg_over_time($fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_cacheCommandsTime | __error__=\"\"[1s]) by (method)<\/code><\/p>\n<\/div>\n<\/details>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/37a\/67a\/677\/37a67a6773eafaf65a417218978b77e6.png\" alt=\"\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 \u043a\u044d\u0448 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\" title=\"\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 \u043a\u044d\u0448 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\" width=\"895\" height=\"384\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/37a\/67a\/677\/37a67a6773eafaf65a417218978b77e6.png\"\/><\/p>\n<div><figcaption>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 \u043a\u044d\u0448 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p><em>{{request_uri_path}}:<\/em> <code>avg_over_time($fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_cacheCommands | __error__=\"\"[1s]) by (method)<\/code><\/p>\n<\/div>\n<\/details>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/843\/877\/592\/843877592e23e979b9c2146ef546adf6.png\" alt=\"\u0420\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043a\u044d\u0448 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\" title=\"\u0420\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043a\u044d\u0448 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\" width=\"895\" height=\"384\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/843\/877\/592\/843877592e23e979b9c2146ef546adf6.png\"\/><\/p>\n<div><figcaption>\u0420\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043a\u044d\u0448 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p><em>{{request_uri_path}}:<\/em> <code>quantile_over_time(0.9, $fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_cacheWritesSize | __error__=\"\"[1s]) by (method)<\/code><\/p>\n<\/div>\n<\/details>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/da8\/594\/0a4\/da85940a4d6e69715473bacd4b4d0d2d.png\" alt=\"\u0420\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043a\u044d\u0448 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\" title=\"\u0420\u0430\u0437\u043c\u0435\u0440 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043a\u044d\u0448 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\" width=\"890\" height=\"371\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/da8\/594\/0a4\/da85940a4d6e69715473bacd4b4d0d2d.png\"\/><\/p>\n<div><figcaption>\u0420\u0430\u0437\u043c\u0435\u0440 \u0447\u0442\u0435\u043d\u0438\u044f \u0438\u0437 \u043a\u044d\u0448\u0430 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p><em>{{request_uri_path}}:<\/em> <code>quantile_over_time(0.9, $fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_cacheReadsSize | __error__=\"\"[1s]) by (method)<\/code><\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<p><strong>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 API \u0432 \u0440\u0430\u0437\u0440\u0435\u0437\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/strong><\/p>\n<ol>\n<li>\n<p>External calls time. <em>\u0412\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438.<\/em><\/p>\n<\/li>\n<\/ol>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c69\/109\/ec8\/c69109ec84612085a3dd8ab9b4e69c9f.png\" alt=\"\u041f\u043e\u0442\u0440\u0430\u0447\u0435\u043d\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0432\u044b\u0437\u043e\u0432\u044b \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\" title=\"\u041f\u043e\u0442\u0440\u0430\u0447\u0435\u043d\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0432\u044b\u0437\u043e\u0432\u044b \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\" width=\"886\" height=\"373\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c69\/109\/ec8\/c69109ec84612085a3dd8ab9b4e69c9f.png\"\/><\/p>\n<div><figcaption>\u041f\u043e\u0442\u0440\u0430\u0447\u0435\u043d\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0432\u044b\u0437\u043e\u0432\u044b \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p><em>{{request_uri_path}}:<\/em> <code>avg_over_time($fpm_source |=`:\"timings\"` | json | __error__ != \"JSONParserErr\" | unwrap message_externalCallsTime | __error__=\"\"[1s]) by (method)<\/code><\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<p><strong>\u0423\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f CPU \u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u043e\u0440\u043a\u0435\u0440\u0430\u043c\u0438.<\/strong><\/p>\n<ol>\n<li>\n<p>PHP avg memory &amp; CPU.<\/p>\n<\/li>\n<\/ol>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/207\/ef2\/9fe\/207ef29fec83d4819fb6e8d2a11fdb47.png\" width=\"907\" height=\"370\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/207\/ef2\/9fe\/207ef29fec83d4819fb6e8d2a11fdb47.png\"\/><\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"left\">php cpu cons. % &#8212; {{s}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>avg_over_time($fpm_source | json | __error__ != \"JSONParserErr\" | unwrap C | __error__=\"\"[1s]) by (s)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">php mem cons. &#8212; {{s}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>avg_over_time($fpm_source | json | __error__ != \"JSONParserErr\" | unwrap M | __error__=\"\"[1s]) by (s)<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<p><strong>\u041d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043b\u043e\u0433\u0438 nginx \/ fpm.<\/strong><\/p>\n<ol>\n<li>\n<p>nginx messages. <em>\u0412\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438\u0437 nginx, \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0435\u0441\u044f access-\u043b\u043e\u0433\u0430\u043c\u0438.<\/em><\/p>\n<\/li>\n<li>\n<p>php-fpm messages. <em>\u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f php.<\/em><\/p>\n<\/li>\n<\/ol>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/87b\/b3f\/b9f\/87bb3fb9f754c4cd6c07f9ca9f6ac397.png\" width=\"907\" height=\"634\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/87b\/b3f\/b9f\/87bb3fb9f754c4cd6c07f9ca9f6ac397.png\"\/><\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"179\" width=\"179\">\n<p align=\"left\">\u043b\u043e\u0433\u0438 nginx<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>$nginx_source !=`client_req_id`<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"179\" width=\"179\">\n<p align=\"left\">\u043b\u043e\u0433\u0438 php-fpm<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>$fpm_source !=`RequestId` !=`category` !=`executing too slow` !=`failed to ptrace`<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<p><strong>\u0421\u0432\u043e\u0434\u043a\u0430 \u043f\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/strong><\/p>\n<ol>\n<li>\n<p>Exceptions. <em>\u0412\u0441\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437 \u043b\u043e\u0433\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0435\u0441\u0442\u044c Exception.<\/em><\/p>\n<\/li>\n<li>\n<p>Exceptions messages. <em>\u0414\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0441\u0442\u0440\u043e\u043a\u0438 \u043b\u043e\u0433\u043e\u0432 \u0441 Exceptions, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u043d\u0430 \u043c\u0435\u0441\u0442\u0435.<\/em><\/p>\n<\/li>\n<\/ol>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f56\/968\/304\/f56968304f3d95f92718587c9f72f469.png\" width=\"847\" height=\"306\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f56\/968\/304\/f56968304f3d95f92718587c9f72f469.png\"\/><\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p><em>{{category}}:<\/em> <code>sum by (category) (rate($fpm_source |=`Exception` | json | __error__ != \"JSONParserErr\" [1s]))<\/code><\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<h2>External calls<\/h2>\n<p>\u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0431\u043b\u043e\u043a\u043e\u0432, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 <strong>\u0441\u0432\u043e\u0434\u043a\u0443 \u043f\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u0441 \u043e\u0434\u043d\u0438\u043c \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043c\u043e\u043d\u043e\u043b\u0438\u0442.<\/strong><\/p>\n<ol>\n<li>\n<p>\u0413\u0440\u0430\u0444\u0438\u043a RPS &amp; avg. time + \u043e\u0448\u0438\u0431\u043e\u043a. <em>\u0413\u0440\u0430\u0444\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442:<\/em><\/p>\n<ol>\n<li>\n<p>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0448\u0438\u0431\u043a\u0438 (\u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u043f\u043e \u0442\u0438\u043f\u0443) \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443, \u043f\u0440\u0438 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u0435 \u043e\u0442\u0432\u0435\u0442\u0430, \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u041b\u043e\u0433\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443. <em>\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0432\u0441\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u0445\u0440\u043e\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435.<\/em><\/p>\n<\/li>\n<\/ol>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3a0\/d04\/c15\/3a0d04c1540748ca66d01290a2b02b90.png\" alt=\"\u0413\u0440\u0430\u0444\u0438\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 - \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c, \u0438 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0435\/\u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435\" title=\"\u0413\u0440\u0430\u0444\u0438\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 - \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c, \u0438 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0435\/\u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435\" width=\"1095\" height=\"613\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3a0\/d04\/c15\/3a0d04c1540748ca66d01290a2b02b90.png\"\/><\/p>\n<div><figcaption>\u0413\u0440\u0430\u0444\u0438\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 &#8212; \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c, \u0438 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u0440\u0435\u0434\u043d\u0435\u0435\/\u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"left\">\u0423\u0441\u043f\u0435\u0448\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>{{message_systemId}}<\/em><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>sum by (message_systemId) (count_over_time($fpm_source |=`external_calls` |=`systemId\":\"$external_system` |=`info` | json | __error__ != \"JSONParserErr\" [10s]))<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>errored &#8212; {{message_systemId}} : {{message_error}}<\/em><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>sum by (message_systemId, message_error) (count_over_time($fpm_source |=`external_calls` |=`systemId\":\"$external_system` |=`error` | json | __error__ != \"JSONParserErr\" [10s]))<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>avg request time &#8212; {{message_systemId}}<\/em><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>avg_over_time($fpm_source |=`external_calls` |=`systemId\":\"$external_system` | json | __error__ != \"JSONParserErr\" | unwrap message_requestTime | __error__=\"\"[10s]) by (message_systemId)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/p>\n<\/td>\n<td>\n<p align=\"left\"><em>max request time &#8212; {{message_systemId}}<\/em><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>max_over_time($fpm_source |=`external_calls` |=`systemId\":\"$external_system` | json | __error__ != \"JSONParserErr\" | unwrap message_requestTime | __error__=\"\"[10s]) by (message_systemId)<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/details>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2e1\/02e\/d2c\/2e102ed2cf144219788e158bdf3daaae.png\" alt=\"\u0412\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\" title=\"\u0412\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\" width=\"410\" height=\"597\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2e1\/02e\/d2c\/2e102ed2cf144219788e158bdf3daaae.png\"\/><\/p>\n<div><figcaption>\u0412\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p><code>$fpm_source |=`external_calls` |=`systemId\":\"$external_system` | json | __error__ != \"JSONParserErr\" | line_format \"{{.timestamp}}: {{ printf \"%s\" .message_requestTime }} {{ .message_error }}\"<\/code><\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<h2>\u0412\u044b\u0432\u043e\u0434\u044b<\/h2>\n<p>\u041f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0432\u043e\u0439 APM \u0438\u0437 \u043f\u043e\u0434\u0440\u0443\u0447\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>\u0423 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u043c\u0438\u043d\u0443\u0441\u044b: <\/p>\n<ul>\n<li>\n<p><strong>\u041c\u0430\u043b\u044b\u0439 \u0441\u0440\u043e\u043a \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445; <\/strong>\u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0438 \u0431\u0435\u0437 \u0442\u043e\u0433\u043e \u0442\u044f\u0436\u0451\u043b\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043b\u043e\u0433\u043e\u0432 \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c\u0438;<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0435\u0434\u043b\u0435\u043d\u043d\u0430\u044f \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445;<\/strong><\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043c\u0435\u043d\u044f\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043b\u0438\u0431\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c (\u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c\u0441\u044f) \u0432 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0411\u0414\/\u043a\u044d\u0448\u0435\u043c\/\u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438.<br \/><em>\u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u043e &#171;\u0441\u043a\u0440\u044b\u0442\u044b\u0445&#187; \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f\u0445 \u043a \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430\u043c: \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0439 (s3, oauth2.0), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0434\u044f\u0442 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u0436\u0435 \u0441\u0442\u043e\u0438\u043b\u043e \u0431\u044b \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u043d\u0430\u0441 \u043d\u0430 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a oauth2 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u043e\u0436\u0435 \u0432\u0438\u0441\u0438\u0442 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 (\u0434\u0430 \u0435\u0449\u0451 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u0434\u0432\u0443\u0445\u043a\u0440\u0430\u0442\u043d\u044b\u043c \u0440\u0435\u0442\u0440\u0430\u0435\u043c) &#8212; \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0443 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043b\u043e\u0433\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/em><\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0435 \u043c\u0438\u043d\u0443\u0441\u044b, \u043a\u0440\u043e\u043c\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e, \u043c\u043e\u0436\u043d\u043e \u043d\u0438\u0432\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043f\u0435\u0440\u0435\u0439\u0434\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0438\u043b\u0438 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e APM.<\/p>\n<p>\u0415\u0441\u0442\u044c \u0438 \u043f\u043b\u044e\u0441\u044b:<\/p>\n<ul>\n<li>\n<p>\u0412\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u043c \u0441\u043e\u0444\u0442\u0435; \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0436\u0430\u043b\u043e\u0431 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430) \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u0436\u0435, \u043d\u0435 \u043e\u0442\u0445\u043e\u0434\u044f \u043e\u0442 \u043b\u043e\u0433\u043e\u0432 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438 \u0442\u0430\u0439\u043c\u0438\u043d\u0433\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0439; <br \/><em>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0433\u043e API \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0438\u0437-\u0437\u0430 \u0434\u043e\u043b\u0433\u0438\u0445 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0439 \u043a \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 nginx-\u043f\u0440\u043e\u043a\u0441\u0438 \u043f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u043c\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043b\u0438 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0438\u0437\u0434\u0435\u0440\u0436\u043a\u0438.<\/em><\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u043e \u043b\u043e\u0433\u0430\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 &#8212; \u0432\u0438\u0434\u043d\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043e\u043d \u0441\u0445\u043e\u0434\u0438\u043b \u0432 \u0411\u0414, \u0432 \u043a\u044d\u0448, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043a\u0430\u043a\u0438\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0431\u044b\u043b\u0438 \u0442\u044f\u0436\u0435\u043b\u0435\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445;<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/726260\/\"> https:\/\/habr.com\/ru\/articles\/726260\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h2>\n<p>API \u0441\u0442\u0430\u043b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437 \u0440\u0430\u0431\u043e\u0442\u044b, \u0438 \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e backend&#8217;\u0430. \u041e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0433\u043e backend&#8217;\u0430 \u043d\u0430 php \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442:<\/p>\n<ul>\n<li>\n<p>\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0411\u0414;<\/p>\n<\/li>\n<li>\n<p>\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u044d\u0448\u0435\u043c (\u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0435 hitrate, \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0451\u043c\u0430 \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445);<\/p>\n<\/li>\n<li>\n<p>\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432 backend (\u0432\u044b\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0442\u044f\u0436\u0451\u043b\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445)<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0451 \u044d\u0442\u043e \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043e, \u043d\u043e \u043d\u0435 \u0434\u0430\u0432\u0430\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0430 &#8212; API \u0431\u044b\u043b \u0431\u043e\u043b\u044c\u0448\u0438\u043c, \u0432 \u043d\u0451\u043c \u0431\u044b\u043b\u043e \u043c\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0441 \u0440\u0430\u0437\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439, \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u0441\u0432\u044f\u0437\u044f\u043c\u0438. \u0422\u043e\u0447\u0435\u0447\u043d\u044b\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0434\u0430\u0432\u0430\u043b\u0438 \u044d\u0444\u0444\u0435\u043a\u0442, \u043d\u043e \u0431\u044b\u043b\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0432\u0435\u0441\u044c backend \u0441\u0432\u0435\u0440\u0445\u0443 &#8212; \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0442\u043e\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449 (\u0411\u0414, \u043a\u044d\u0448, \u0441\u0435\u0440\u0432\u0438\u0441\u044b) \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0423\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 APM (newrelic, datadog, elastic apm agent, dynatrace, open tracing) \u0431\u044b\u043b\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b, \u043d\u043e \u043d\u0435 \u0431\u044b\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u044b \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f php, \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u044c \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044e \u0438\/\u0438\u043b\u0438 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0443\u0437\u043b\u044b. <\/p>\n<p>\u0421\u043e\u0433\u043b\u0430\u0448\u0443\u0441\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0439 APM \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043d\u0435 \u0430\u043d\u0430\u043b\u0438\u0437 \u043b\u043e\u0433\u043e\u0432, \u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0441 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 &#8212; \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c\u0438, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u0438 &#8212; \u044d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0434\u043e\u043b\u044c\u0448\u0435 \u0436\u0438\u0432\u0451\u0442 (\u043f\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0443 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c) \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b\u0441\u044f \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0435\u0441\u044f\u0446\u0435\u0432, \u0448\u0430\u0433 \u0437\u0430 \u0448\u0430\u0433\u043e\u043c \u043c\u0435\u043d\u044f\u044f \u0430\u043a\u0446\u0435\u043d\u0442\u044b \u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u041e\u0442\u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e \u0431\u044b\u043b \u0435\u0449\u0451 \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442: <em>\u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0434\u0430\u0447\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u043d\u0430 \u043b\u043e\u0433\u0430\u0445 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0443\u0441\u0438\u043b\u0438\u044f\u043c\u0438<\/em>.<\/p>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0420\u0435\u0448\u0435\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0437 nginx \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (php-fpm \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435), \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u0432 loki, \u0434\u043b\u044f \u0441\u043a\u043b\u0430\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c-\u043e\u0442\u0432\u0435\u0442\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0443\u0442 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u044b grafana+loki \u0438 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0433\u0440\u0430\u0444\u0438\u043a\u0438.<\/p>\n<p>\u0412 \u043f\u043b\u0430\u043d\u0435:<\/p>\n<ol>\n<li>\n<p><strong>\u041c\u0435\u043d\u044f\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442 \u043b\u043e\u0433\u043e\u0432 nginx \u0438 php-fpm<\/strong> &#8212; \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432\u044b\u0432\u043e\u0434 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438 \u043c\u0435\u043d\u044f\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442 \u043d\u0430 json; <br \/><em>\u042d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e: \u0432\u0441\u0451 \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438: \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0430\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e log_format \u0438 access.format \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/em><\/p>\n<\/li>\n<li>\n<p><strong>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043b\u043e\u0433\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\/\u043a\u043e\u043c\u0430\u043d\u0434 \u0441 \u0442\u0430\u0439\u043c\u0438\u043d\u0433\u043e\u043c<\/strong> &#8212; \u043a \u0411\u0414 \u0438 \u043a\u044d\u0448\u0443 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<br \/><em>\u042d\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e, \u0432\u0435\u0434\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u043d\u043e \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (pdo, cache) \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 <\/em><code>$dbConnectionTime += $start_connection_time - microtime(true)<\/code><em>.<\/em><\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/strong> \u0432 \u043f\u0440\u043e\u043a\u043b\u0430\u0434\u043a\u0443 (\u043d\u0430\u0437\u0432\u0430\u043d\u043d\u0443\u044e <em>\u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440\u043e\u043c<\/em>), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b) \u043e\u0442\u0432\u0435\u0442\u0430 \u0438 \u043b\u043e\u0433\u0433\u0438\u0440\u0443\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u0430; <br \/><em>\u042d\u0442\u043e \u0431\u044b\u043b\u043e \u0434\u0430\u0436\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0432\u0435\u0434\u044c \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c (\u0430 \u0438\u0445 \u0443\u0436\u0435 \u043e\u043a\u043e\u043b\u043e 15) \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f, \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0438 \u043b\u043e\u0433\u0433\u0438\u0440\u0443\u044e\u0442\u0441\u044f.<\/em><\/p>\n<\/li>\n<\/ol>\n<h3>\u0424\u043e\u0440\u043c\u0430\u0442 \u043b\u043e\u0433\u043e\u0432 nginx \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>\u041b\u043e\u0433\u0438 nginx \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"json\">{     \"body_bytes_sent\": \"3186\",     \"client_ip\": \"10.***.***.***\",     \"client_req_id\": \"cad148c1-****-4819-****-035a4a9ace14\",     \"connection\": \"10186566\",     \"http_user_agent\": \"***\",     \"pid\": \"16\",     \"request_method\": \"POST\",     \"request_time\": \"0.102\",     \"request_uri\": \"\/***\/***\/***?***=***\",     \"request_uri_path\": \"\/***\/***\/***\",     \"status\": \"200\",     \"time_local\": \"10\/Apr\/2023:23:27:15 +0300\",     \"upstream_connect_time\": \"0.000\",     \"upstream_header_time\": \"0.101\",     \"upstream_response_time\": \"0.101\",     \"uri\": \"\/index.php\" }<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 nginx<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"nginx\">\/\/ \u043e\u0431\u0449\u0438\u0435 http {     \/\/ ...     log_format json_upstream_logs escape=json '{\"time_local\":\"$time_local\",\"client_req_id\":\"$client_req_id\",\"client_ip\":\"$client_ip\",\"request_method\":\"$request_method\",\"request_uri\":\"$request_uri\",\"request_uri_path\":\"$request_uri_path\",\"status\":\"$status\",\"body_bytes_sent\":\"$body_bytes_sent\",\"http_user_agent\":\"$http_user_agent\",\"request_time\":\"$request_time\",\"uri\":\"$uri\",\"upstream_connect_time\":\"$upstream_connect_time\",\"upstream_header_time\":\"$upstream_header_time\",\"upstream_response_time\":\"$upstream_response_time\",\"pid\":\"$pid\",\"connection\":\"$connection\"}';     \/\/ ...     map $request_uri $request_uri_path {         \"~^(?P&lt;path>[^?]*)(\\?.*)?$\"  $path;     } }  \/\/ \u0441\u0435\u0440\u0432\u0435\u0440\u0430 server {     #\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u043d\u0435\u0442 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 - \u0441\u043e\u0437\u0434\u0430\u0451\u043c     if ($arg_client_req_id !~ $arg_client_req_id) {         set $client_req_id $request_id;     }     if ($arg_request_id) {         set $client_req_id $arg_request_id;     }     if ($arg_client_req_id) {         set $client_req_id $arg_client_req_id;     }     #\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 ip \u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430     # \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0441 \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0442\u0430\u043a \u0447\u0442\u043e HTTP-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0434\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u0435     if ($http_x_real_ip !~ $http_x_real_ip) {         set $client_ip $remote_addr;     }     if ($http_x_real_ip) {         set $client_ip $http_x_real_ip;     }       location ~ ^\/index\\.php$ {         \/\/ ..         access_log  \/var\/log\/nginx\/access.log  json_upstream_logs;         \/\/ ..     } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0417\u0430\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0435 \u043b\u043e\u0433\u0438 php-fpm \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0442\u043e\u0436\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"json\">{     \"C\": \"43.21\",     \"M\": \"2097152\",     \"P\": \"9\",     \"Q\": \"\",     \"R\": \"-\",     \"RequestId\": \"f894d70d5910***3772a94261f7c40ca\",     \"T\": \"20\/Apr\/2023:16:17:19 +0300\",     \"d\": \"0.023\",     \"f\": \"\/var\/www\/html\/web\/\/index.php\",     \"l\": \"42\",     \"m\": \"POST\",     \"n\": \"www\",     \"p\": \"17\",     \"q\": \"\",     \"r\": \"\/index.php\",     \"s\": \"200\",     \"t\": \"20\/Apr\/2023:16:17:19 +0300\",     \"u\": \"\" }<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 php-fpm<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>access.format = '{\"RequestId\":\"%{REQUEST_ID}e\",\"C\":\"%C\",\"d\":\"%d\",\"f\":\"%f\",\"l\":\"%l\",\"m\":\"%m\",\"M\":\"%M\",\"n\":\"%n\",\"P\":\"%P\",\"p\":\"%p\",\"q\":\"%q\",\"Q\":\"%Q\",\"r\":\"%r\",\"R\":\"%R\",\"s\":\"%s\",\"T\":\"%T\",\"t\":\"%t\",\"u\":\"%u\"}'<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h3>\u0422\u0430\u0439\u043c\u0438\u043d\u0433\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438<\/h3>\n<p>\u041a\u043e \u0432\u0441\u0435\u043c \u043b\u043e\u0433\u0430\u043c \u0438\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0435\u0442\u0430-\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e (\u0434\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043b\u043e\u0433\u043e\u0432 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438):<\/p>\n<ul>\n<li>\n<p>id \u0437\u0430\u043f\u0440\u043e\u0441\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441;<\/p>\n<\/li>\n<li>\n<p>id \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0441\u0435\u0441\u0441\u0438\u044f;<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0451: \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u044b\/\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0411\u0414, \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u044b\/\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 \u043a\u044d\u0448\u0435, \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u044f\/\u043e\u0431\u044a\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0418\u0437 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0432\u0443\u044e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0443\u044e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 &#8212; <strong>timings,<\/strong> \u043e \u0445\u043e\u0434\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044e \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"json\">{     \"cacheCommands\": 14,     \"cacheCommandsTime\": 0.005800008773803711,     \"cacheConnectionTime\": 0.0006201267242431641,     \"cacheReads\": 7,     \"cacheReadsSize\": 7989,     \"cacheWrites\": 4,     \"cacheWritesSize\": 1480,     \"dbConnectionTime\": 0.0017120838165283203,     \"dbQueries\": 5,     \"dbQueriesTime\": 0.0563662052154541,     \"externalCalls\": 1,     \"externalCallsTime\": 0.03611111640930176 }<\/code><\/pre>\n<h3>\u0412\u044b\u0437\u043e\u0432\u044b \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/h3>\n<p>\u041e\u0431 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0432\u0442\u043e\u0440\u0443\u044e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f &#8212; <strong>external_calls<\/strong> &#8212; \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043f\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044e \u0432 \u043b\u043e\u0433\u0435.<\/p>\n<ul>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"json\">{     \"requestTime\": 0.03611111640930176,     \"requestUrl\": \"http:\/\/10.***.***.***\/***\/***\/***\/***\",     \"systemId\": \"***\" }<\/code><\/pre>\n<ul>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u044b\u0437\u043e\u0432\u0430:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"json\">{     \"error\": \"cURL error 28: Connection timeout after 1001 ms (see https:\/\/curl.haxx.se\/libcurl\/c\/libcurl-errors.html): 0\",     \"request\":     {         \"body\": \"\",         \"url\": \"http:\/\/***.***.***:8280\/***\/***\/***?***=***\"     },     \"requestTime\": 1.0022687911987305,     \"response\": null,     \"systemId\": \"***\" }<\/code><\/pre>\n<h2>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0432\u043e\u043e\u0440\u0443\u0436\u0438\u0442\u044c\u0441\u044f logql, \u0433\u0440\u0430\u0444\u0430\u043d\u043e\u0439 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432\u0435\u0440\u043d\u044b\u0435 \u043a \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0443.<\/p>\n<p>\u0417\u0430\u0432\u043e\u0434\u0438\u043c \u0434\u0432\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0431\u043e\u0438\u0445 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0430\u0445 (\u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0441\u043c\u0435\u043d\u0430 \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0443\u0440\u0430):<\/p>\n<ul>\n<li>\n<p>$nginx_source &#8212; logql-\u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u043b\u043e\u0433\u043e\u0432 nginx<\/p>\n<\/li>\n<li>\n<p>$fpm_source &#8212; logql-\u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u043b\u043e\u0433\u043e\u0432 php-fpm<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0435\u0441\u044c APM \u043f\u043e\u0434\u0435\u043b\u0451\u043d \u043d\u0430 \u0434\u0432\u0435 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u044b:<\/p>\n<ol>\n<li>\n<p><strong>Performance Status<\/strong>. \u0414\u043b\u044f \u043e\u0446\u0435\u043d\u043a\u0438 &#171;\u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0451 \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f&#187;.<\/p>\n<\/li>\n<li>\n<p><strong>Remote Calls<\/strong>. \u0414\u043b\u044f \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438.<\/p>\n<\/li>\n<\/ol>\n<h3>Performance Status<\/h3>\n<p>\u0421\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0431\u043b\u043e\u043a\u043e\u0432:<\/p>\n<p><strong>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 API \u0432 \u0440\u0430\u0437\u0440\u0435\u0437\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432\/\u043a\u043e\u0434\u043e\u0432 \u043e\u0442\u0432\u0435\u0442\u0430.<\/strong><\/p>\n<ol>\n<li>\n<p>RPS. <em>\u0421\u0447\u0451\u0442\u0447\u0438\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a\u043e \u0432\u0441\u0435\u043c\u0443 API, \u0441 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u043a\u043e\u0434\u0430\u043c \u043e\u0442\u0432\u0435\u0442\u0430 nginx.<\/em><\/p>\n<\/li>\n<li>\n<p>Summary for {code}. <em>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0437 \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 grafana \u043b\u044e\u0431\u044b\u0435 \u043a\u043e\u0434\u044b \u043e\u0442\u0432\u0435\u0442\u0430, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b:<\/em><\/p>\n<ol>\n<li>\n<p>Average Response time (nginx \/ fpm).<\/p>\n<\/li>\n<li>\n<p>Response time. <em>\u041f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c nginx.<\/em><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>Response count by path for {code}. <em>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043f\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c \u0434\u043b\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043e\u0442\u0432\u0435\u0442\u0430.<\/em><\/p>\n<\/li>\n<li>\n<p>Response size by path. <em>\u0421\u0440\u0435\u0434\u043d\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/em><\/p>\n<\/li>\n<li>\n<p>Response time by path. <em>\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/em><\/p>\n<\/li>\n<\/ol>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\">\n<div><figcaption>RPS \u043f\u043e \u0432\u0441\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c \u043a API<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p><em>{{status}}:<\/em> <code>sum by (status) (rate($nginx_source | json | error != \"JSONParserErr\"[1s]))<\/code><\/p>\n<\/div>\n<\/details>\n<figure class=\"full-width\">\n<div><figcaption>\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0432\u0435\u0442\u0430 API<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"269\" width=\"269\">\n<p align=\"left\">avg by nginx &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>avg_over_time( $nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap request_time | __error__=\"\"[1s] ) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"269\" width=\"269\">\n<p align=\"left\">connect_time &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>avg_over_time($nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap upstream_connect_time | __error__=\"\"[1s]) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"269\" width=\"269\">\n<p align=\"left\">header_time &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>avg_over_time($nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap upstream_header_time | __error__=\"\"[1s]) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"269\" width=\"269\">\n<p align=\"left\">response_time &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>avg_over_time($nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap upstream_response_time | __error__=\"\"[1s]) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"269\" width=\"269\">\n<p align=\"left\">avg by php-fpm &#8212; {{s}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>avg_over_time($fpm_source | json | __error__ != \"JSONParserErr\" | s=$http_code | unwrap d | __error__=\"\"[1s]) by (s)<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/details>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0442\u0432\u0435\u0442\u0430<\/figcaption><\/div>\n<\/figure>\n<details class=\"spoiler\">\n<summary>\u041a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/summary>\n<div class=\"spoiler__content\">\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"left\">max by nginx &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>max_over_time($nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap request_time | __error__=\"\"[1s]) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">95% by nginx &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>quantile_over_time(0.95, $nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap request_time | __error__=\"\"[1s]) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">90% by nginx &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>quantile_over_time(0.9, $nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap request_time | __error__=\"\"[1s]) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">70% by nginx &#8212; {{status}}<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>quantile_over_time(0.7, $nginx_source | json | __error__ != \"JSONParserErr\" | status=$http_code | unwrap request_time | __error__=\"\"[1s]) by (status)<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">50%<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-389804","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/389804","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=389804"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/389804\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=389804"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=389804"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=389804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}