{"id":332212,"date":"2022-04-21T09:00:30","date_gmt":"2022-04-21T09:00:30","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=332212"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=332212","title":{"rendered":"<span>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u043c Prometheus \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0432 Webflux<\/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<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/88c\/6e5\/fb1\/88c6e5fb1d3a7638a49f670b56815e6f.png\" width=\"556\" height=\"231\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/88c\/6e5\/fb1\/88c6e5fb1d3a7638a49f670b56815e6f.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0412 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u043c\u0435\u0442\u0440\u0438\u043a \u0432 Prometheus \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435 \u043d\u0430 Spring Webflux.<\/p>\n<p>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440:<\/p>\n<details class=\"spoiler\">\n<summary>Hidden text<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043d, \u0432\u0441\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b.<\/p>\n<\/div>\n<\/details>\n<p>\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b \u2013 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b Actuator, Micrometer, Prometheus \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043b \u0432 management \u043f\u0440\u043e\u043f\u0435\u0440\u0442\u044f\u0445 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a \u0438 \u0440\u0430\u0434\u0443\u0435\u0448\u044c\u0441\u044f \u0432\u044b\u0432\u043e\u0434\u0443 \u0432\u0441\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0434\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043f\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0440\u0435\u0441\u0442\u0443. \u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u043a\u0430\u0442\u0430 \u043c\u0435\u0442\u0440\u0438\u043a \u043d\u0430 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435, \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0435\u0433\u0440\u0430\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0433\u0440\u0430\u0444\u0430\u043d\u0443 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u043f\u0430\u043c\u0438\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043a\u043e\u043b\u043b\u0435\u0433\u0438 \u0438\u0437 QA \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u044e\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043e\u0442\u043a\u043b\u0438\u043a\u0430  \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0431\u044d\u043a\u0435\u043d\u0434\u0443, \u0441\u043e\u043e\u0442\u0432\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e \u043e\u0442\u043a\u0430\u0442\u0443 \u0444\u0438\u0447\u0438. <\/p>\n<p>\u041d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e, \u043d\u043e \u0431\u044b\u0432\u0430\u0435\u0442, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443\u0441\u043f\u0435\u043b\u043e \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432 \u0433\u0440\u0430\u0444\u0430\u043d\u0443 \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0443 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442\u0430,  \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:<\/p>\n<p><strong>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0448\u0430\u0433 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u2013 \u043d\u0430 \u0432\u044b\u0437\u043e\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u0442\u0430 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u0440\u0438\u043a, \u043d\u0443\u0436\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c!<\/strong><\/p>\n<p>\u0411\u043e\u043d\u0443\u0441\u043e\u043c \u043a\u043e\u043b\u043b\u0435\u0433\u0438 \u0438\u0437 \u0441\u043b\u0443\u0436\u0431\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0449\u0435\u0439:<\/p>\n<ol>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u043a\u0448\u043d, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0441\u0442\u0443\u0447\u0438\u0442\u0441\u044f \u0440\u0435\u0441\u0442 (\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u0440\u0435\u0441\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043a\u0443\u0434\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b), \u0442\u0438\u043f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u043d\u0430  \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f soap, \u043d\u043e \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b rest, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443), \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044b sla, \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u043f\u043e \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044f\u043c \u0438 \u0442.\u043f.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043a \u043d\u0430\u0448\u0435\u043c\u0443 API, \u043e\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u043a \u0434\u0440\u0443\u0433\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c. \u0422\u0443\u0442 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u044f\u0441\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 \u0431\u044b\u043b \u0433\u0435\u0439\u0442\u0432\u0435\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043b \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u0432\u044b\u0434\u0430\u0432\u0430\u043b \u0444\u0440\u043e\u043d\u0442\u0443 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 json \u0441\u043e \u0432\u0441\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0443 \u0447\u0442\u043e \u0436, \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b, \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u0440\u0438\u043a \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043d\u0430\u0448\u0435\u0433\u043e API \u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<p>\u0414\u043b\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0444\u0440\u043e\u043d\u0442\u043e\u043c API \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 http.server.requests \u043f\u0440\u043e\u043f\u0435\u0440\u0442\u0438 \u0430\u043a\u0442\u0443\u0430\u0442\u043e\u0440\u0430. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u0432 \u043d\u0438\u0445 \u043f\u0440\u043e\u043a\u0438\u043d\u0443\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0448\u043d, \u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u0430\u043f\u0438\u043b\u0441\u044f \u043f\u043e \u0443\u0440\u043b\u0443 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434\u0435.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043c\u0435\u0442\u0440\u0438\u043a \u0444\u0438\u043b\u044c\u0442\u0440 \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u044d\u043a\u0448\u043d \u0442\u0435\u0433:<\/p>\n<pre><code class=\"java\">@Component public class MetricCustomServerProvider implements WebFluxTagsContributor {      @Override     public Iterable&lt;Tag> httpRequestTags(ServerWebExchange exchange,                                          Throwable ex) {         Tag action = Tag.of(\"action\", \/* \u043a\u0430\u043a \u0441\u044e\u0434\u0430 \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 ? *\/);         return Collections.singletonList(action);     } }<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0432\u043e\u0437\u043d\u0438\u043a \u0432\u043e\u043f\u0440\u043e\u0441, \u0430 \u043a\u0430\u043a \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440, \u043e\u0442\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u043e\u0442 \u0431\u0438\u0437\u043d\u0435\u0441 \u043b\u043e\u0433\u0438\u043a\u0438? \u0420\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432 Webflux \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u0440\u0438\u043c\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0433\u043e \u0432 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0435 \u0432\u044b\u0439\u0434\u0435\u0442. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0448\u043b\u043e \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435: \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0443, \u043f\u043e\u0441\u043b\u0435 \u0434\u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u0432 \u0445\u0435\u0434\u0435\u0440\u044b \u043e\u0442\u0432\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440 \u043c\u0435\u0442\u0440\u0438\u043a \u0441\u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0438\u0437 ServerWebExchange \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0434 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0441\u0442\u0430\u043b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">@Component public class MetricCustomServerProvider implements WebFluxTagsContributor {      @Override     public Iterable&lt;Tag> httpRequestTags(ServerWebExchange exchange,                                          Throwable ex) {         Tag action = Tag.of(\"action\", createAction(exchange));         return Collections.singletonList(action);     }      private String createAction(ServerWebExchange exchange) {         final HttpHeaders headers = exchange.getResponse().getHeaders();          String action = null;                  if (headers.containsKey(ContextParameter.A\u0421TION_HEADER)) {             action = Optional.ofNullable(headers.get(ContextParameter.ACTION_HEADER))                     .map(h -> h.get(0))                     .orElse(null)                     ;         }                  return action;     } }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c, \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0445\u0435\u0434\u0435\u0440\u0430 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0436\u0435 \u0432 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0434\u0430\u043b\u0435\u0435.<\/p>\n<pre><code class=\"java\">public final class ContextParameter {     public final static String A\u0421TION_HEADER = \"sa\"; }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 \u0445\u0435\u0434\u0435\u0440 \u043e\u0442\u0432\u0435\u0442\u0430. \u0412 \u044d\u0442\u043e\u043c \u043f\u043b\u0430\u043d\u0435 \u043c\u043d\u0435 \u043f\u043e\u0432\u0435\u0437\u043b\u043e, \u0432\u0441\u0435 \u0440\u0435\u0441\u0442\u044b \u0441\u0442\u0443\u0447\u0430\u043b\u0438\u0441\u044c \u0447\u0435\u0440\u0435\u0437 ResponseWrapper, \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u043e\u0442\u0432\u0435\u0442 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 json. \u0412\u043e\u0442 \u043e\u043d \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0434\u043b\u044f \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0445\u0435\u0434\u0435\u0440\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u044d\u043a\u0448\u043d\u0430!<\/p>\n<pre><code class=\"java\">public interface CommonExchange {     default Mono&lt;ServerResponse> response(HttpStatus status,                                           Object body,                                           ErrorResponseModel error) {         AtomicReference&lt;String> actionValue = new AtomicReference&lt;>();         return Mono                 .subscriberContext(context -> {                     if (!context.hasKey(ContextParameter.A\u0421TION_HEADER)) {                         actionValue.set(\"\");                     } else {                         Map&lt;Object, Object> map = context.get(ContextParameter.A\u0421TION_HEADER);                         actionValue.set((String) map.get(ContextParameter.A\u0421TION_HEADER));                     }                     return context;                 })                .flatMap(ok -> ServerResponse                                 .status(status)                                 .header(ContextParameter.A\u0421TION_HEADER, actionValue.get())                                 .contentType(APPLICATION_JSON)                                 .syncBody(new ResponseModel(body, error))                 );      } }<\/code><\/pre>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0432 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u043e \u0445\u0435\u0434\u0435\u0440\u0443, \u043d\u043e \u043f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435, \u043d\u043e \u0432\u0430\u0436\u043d\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435:<\/p>\n<p><em>\u041d\u0430 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0438\u043b\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432. \u0414\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f WebClient (\u0412\u044b \u0436\u0435 \u0434\u0435\u0439\u0441\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u044b \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e ? \ud83d\ude42 ).<\/em>  <\/p>\n<p>\u0412 \u0440\u043e\u0443\u0442\u0435\u0440-\u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.<\/p>\n<p>\u0421\u043e\u043a\u0440\u0430\u0442\u0438\u043c \u043a\u043e\u0434 \u0434\u043e \u043f\u0430\u0440\u044b \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u043e \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e:<\/p>\n<pre><code class=\"java\">@EnableWebFlux @Configuration public class WebConfig implements WebFluxConfigurer {  @Autowired private ServerProperties serverProperties; \/\/ \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f   @Bean public RouterFunction&lt;ServerResponse> orderRoute(OrderHandler orderHandler) {     return route()             .GET(serverProperties.getUrl() + \"\/orders\", accept(APPLICATION_JSON), req -> InContextAction.process(\"getOrders\", req,  orderHandler.getOrders(req)))             .GET(serverProperties.getUrl() + \"\/orders\/active\", accept(APPLICATION_JSON), req -> InContextAction.process(\"getActiveOrders\", req,  orderHandler.getActiveOrders(req)))             \/\/ \u2026 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b             .build(); }<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 InContextAction, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0439 \u0440\u043e\u0443\u0442\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430, \u0442\u043e\u043b\u044c\u043a\u043e \u0445\u0435\u0448 \u0438 \u0442\u0438\u043f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c, \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u044f\u0432\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0439.<\/p>\n<pre><code class=\"java\">public class InContextAction {      public static Mono&lt;ServerResponse> process(String name,                                                ServerRequest request,                                                Mono&lt;ServerResponse> action) {         return action           .subscriberContext(ctx -> {             Map&lt;Object, Object> apiMethodMap = new HashMap&lt;>();             apiMethodMap.put(ContextParameter.A\u0421TION_HEADER, name);              request.exchange()  .getRequest()  .mutate()  .header(ContextParameter.A\u0421TION_HEADER,                            apiMethodMap.get(ContextParameter.A\u0421TION_HEADER)                            .toString()                    );              return ctx.put(ContextParameter.A\u0421TION_HEADER, apiMethodMap);         });     } }<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0451. \u0421 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u043e\u0439 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043e. \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0443\u044e, \u043d\u043e \u0442\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0431\u0435\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 WebClient.<\/p>\n<hr\/>\n<h2>\u041c\u0435\u0442\u0440\u0438\u043a\u0430 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043d\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<pre><code class=\"java\">public final class ContextParameter {     public final static String A\u0421TION_HEADER= \"sa\";     public final static String INNER_ACTION_HEADER = \"ca\"; }<\/code><\/pre>\n<p> \u0417\u0430\u0442\u0435\u043c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u043c\u0435\u0442\u0440\u0438\u043a\u0443 http.inner.requests:<\/p>\n<pre><code class=\"java\">@Configuration @EnableAsync @EnableScheduling public class MetricConfig {      @Bean     public MetricsWebClientFilterFunction clientMetric(PrometheusMeterRegistry registry,                                                        WebClientExchangeTagsProvider provider) {         return new MetricsWebClientFilterFunction(                 registry,                 provider,                 \"http.inner.requests\",                 AutoTimer.ENABLED         );     } }<\/code><\/pre>\n<p> \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440 \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u043c\u0435\u0442\u0440\u0438\u043a:<\/p>\n<pre><code class=\"java\">@Component public class MetricCustomClientProvider extends DefaultWebClientExchangeTagsProvider {      @Override     public Iterable&lt;Tag> customTags(ClientRequest request,                               ClientResponse response,                               Throwable throwable) {         Tag type = Tag.of(\"type\", \"rest\");         Tag host = Tag.of(\"host\", WebClientExchangeTags.clientName(request).getValue());         Tag action = Tag.of(\"action\", generateAction(request));                Tag method = WebClientExchangeTags.method(request);         Tag status = WebClientExchangeTags.status(response, throwable);         Tag outcome = WebClientExchangeTags.outcome(response);                  return Arrays.asList(method, status, outcome, type, host, action);     }      private String generateAction(ClientRequest request) {         return Optional.ofNullable(request.headers().get(ContextParameter.INNER_ACTION_HEADER))                 .map(headers -> headers.get(0))                 .orElse(\"\");     }  }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043d\u0435\u0434\u0440\u0438\u043c \u0432 \u0432\u044b\u0437\u043e\u0432 WebClient \u043d\u043e\u0432\u044b\u0439 \u0445\u0435\u0434\u0435\u0440 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u0438\u043a\u0438\u043c \u043c\u0435\u0442\u0440\u0438\u043a \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c:<\/p>\n<pre><code class=\"java\">@Autowired private MetricsWebClientFilterFunction clientMetricFilter;   \/\/ .. \u043a\u043e\u0434 \u0441\u0435\u0440\u0432\u0438\u0441\u0430  DefaultUriBuilderFactory encodedUriFactory = new DefaultUriBuilderFactory(\"http:\/\/localhost:8081\/actuator\/health\"); return WebClient.builder()         .codecs(configurer -> configurer                 .defaultCodecs()                 .maxInMemorySize(16 * 1024 * 1024)) \/\/ 16MB         .uriBuilderFactory(encodedUriFactory)         .filter(clientMetricFilter)         .build()         .get()         .header(ContextParameter.INNER_ACTION_HEADER, \"healthcheck\")         .exchange()         .flatMap(clientResponse -> clientResponse.bodyToMono(String.class));<\/code><\/pre>\n<p> \u0412 \u0444\u0438\u043d\u0430\u043b\u0435, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0448\u0430\u0433 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u0435\u0442\u0440\u0438\u043a, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 properties \u0430\u043a\u0442\u0443\u0430\u0442\u043e\u0440\u0430:<\/p>\n<pre><code class=\"bash\"># \u041c\u0435\u0442\u0440\u0438\u043a\u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043a API management.metrics.distribution.percentiles.http.server.requests=0.3,0.9 management.metrics.distribution.percentiles-histogram.http.server.requests=true management.metrics.distribution.sla.http.server.requests=250ms,500ms,1000ms,2500ms,5000ms,10000ms management.metrics.distribution.maximum-expected-value.http.server.requests=1 # \u041c\u0435\u0442\u0440\u0438\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 management.metrics.distribution.percentiles.http.inner.requests=0.3,0.9 management.metrics.distribution.percentiles-histogram.http.inner.requests=true management.metrics.distribution.sla.http.inner.requests=250ms,500ms,1000ms,2500ms,5000ms,10000ms management.metrics.distribution.maximum-expected-value.http.inner.requests=1<\/code><\/pre>\n<hr\/>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b<\/h2>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u043f\u0440\u0438\u043b\u0430\u0433\u0430\u044e \u0441\u043a\u0440\u0438\u043d\u044b \u0441 \u043c\u0435\u0442\u0440\u0438\u043a\u0430\u043c\u0438 Prometheus, \u043d\u0430 \u0445\u0435\u043b\u0441\u0447\u0435\u043a\u0435 \u0430\u043a\u0442\u0443\u0430\u0442\u043e\u0440\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ace\/af7\/2a3\/aceaf72a3d6c33a534eb7cc7e34d4dd5.png\" width=\"1229\" height=\"429\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ace\/af7\/2a3\/aceaf72a3d6c33a534eb7cc7e34d4dd5.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u044b\u0437\u043e\u0432 API, \u0431\u0435\u0437 \u0442\u043e\u043a\u0435\u043d\u0430 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0451\u0442 Spring Security, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043e\u0441\u0442\u0430\u043d\u0443\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u044b\u043c\u0438. <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0436\u0435 \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/81d\/7cc\/92b\/81d7cc92bd439987f724715b45aa942e.png\" width=\"1199\" height=\"836\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/81d\/7cc\/92b\/81d7cc92bd439987f724715b45aa942e.png\"\/><figcaption><\/figcaption><\/figure>\n<p> \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u043c\u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u0443:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5e7\/89b\/008\/5e789b00825076113334e60c58516e92.png\" width=\"1192\" height=\"676\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5e7\/89b\/008\/5e789b00825076113334e60c58516e92.png\"\/><figcaption><\/figcaption><\/figure>\n<hr\/>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435, \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u043b\u043e \u0432\u0441\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u0443\u0436\u0431\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u043d\u0435 \u0433\u0440\u0443\u0437\u0438\u043b\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c \u043d\u0443\u0436\u043d\u043e, \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u044b. \u041e\u0434\u043d\u0430\u043a\u043e, \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0433\u043b\u043e \u0438 \u043d\u0435 \u0441\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u0431\u044b \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u044f \u0437\u0430\u0434\u0430\u043b \u0442\u0440\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u043d\u043e\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438:<\/p>\n<ol>\n<li>\n<p>\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438 \u043f\u0440\u043e\u043a\u0438\u043d\u0443\u0442\u044c \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 &#171;\u043a\u0430\u043a \u0435\u0441\u0442\u044c&#187; ?<\/p>\n<\/li>\n<li>\n<p>\u0411\u0443\u0434\u0443\u0442 \u043b\u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438?<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a\u043e\u0432\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0430 \u0432 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0441\u043a\u0432\u043e\u0437\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0437 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430)?<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043d\u0430 Prometheus \u0432 Webflux \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b.<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0442\u0435\u043c, \u043a\u043e\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0432 \u043a\u0440\u0430\u0442\u043a\u0438\u0435 \u0441\u0440\u043e\u043a\u0438 \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 Prometheus \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Webflux. <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0412\u044b \u043d\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u044b \u0441 \u0442\u0435\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438, \u0447\u0442\u043e \u0431\u044b\u043b\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u044b \u0438 \u0435\u0441\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043f\u0440\u043e\u0449\u0435, \u0442\u043e \u0440\u0430\u0434 \u0431\u0443\u0434\u0443 \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c \u0412\u0430\u0448\u0438 \u043e\u0442\u0432\u0435\u0442\u044b \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/662177\/\"> https:\/\/habr.com\/ru\/post\/662177\/<\/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<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0412 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u043c\u0435\u0442\u0440\u0438\u043a \u0432 Prometheus \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0442\u0438\u043b\u0435 \u043d\u0430 Spring Webflux.<\/p>\n<p>\u0414\u0438\u0441\u043a\u043b\u0435\u0439\u043c\u0435\u0440:<\/p>\n<details class=\"spoiler\">\n<summary>Hidden text<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043d, \u0432\u0441\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b.<\/p>\n<\/div>\n<\/details>\n<p>\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b \u2013 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b Actuator, Micrometer, Prometheus \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043b \u0432 management \u043f\u0440\u043e\u043f\u0435\u0440\u0442\u044f\u0445 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0440\u0438\u043a \u0438 \u0440\u0430\u0434\u0443\u0435\u0448\u044c\u0441\u044f \u0432\u044b\u0432\u043e\u0434\u0443 \u0432\u0441\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0434\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043f\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u0440\u0435\u0441\u0442\u0443. \u041e\u0434\u043d\u0430\u043a\u043e, \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u043a\u0430\u0442\u0430 \u043c\u0435\u0442\u0440\u0438\u043a \u043d\u0430 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435, \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0435\u0433\u0440\u0430\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0433\u0440\u0430\u0444\u0430\u043d\u0443 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u043f\u0430\u043c\u0438\u0442\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043a\u043e\u043b\u043b\u0435\u0433\u0438 \u0438\u0437 QA \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u044e\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0437\u0430\u043c\u0435\u0434\u043b\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043e\u0442\u043a\u043b\u0438\u043a\u0430  \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0431\u044d\u043a\u0435\u043d\u0434\u0443, \u0441\u043e\u043e\u0442\u0432\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e \u043e\u0442\u043a\u0430\u0442\u0443 \u0444\u0438\u0447\u0438. <\/p>\n<p>\u041d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e, \u043d\u043e \u0431\u044b\u0432\u0430\u0435\u0442, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443\u0441\u043f\u0435\u043b\u043e \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432 \u0433\u0440\u0430\u0444\u0430\u043d\u0443 \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0443 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u043d\u0446\u0438\u0434\u0435\u043d\u0442\u0430,  \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:<\/p>\n<p><strong>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0448\u0430\u0433 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u2013 \u043d\u0430 \u0432\u044b\u0437\u043e\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u0442\u0430 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u0440\u0438\u043a, \u043d\u0443\u0436\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c!<\/strong><\/p>\n<p>\u0411\u043e\u043d\u0443\u0441\u043e\u043c \u043a\u043e\u043b\u043b\u0435\u0433\u0438 \u0438\u0437 \u0441\u043b\u0443\u0436\u0431\u044b \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u0435\u0449\u0451 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0449\u0435\u0439:<\/p>\n<ol>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u043a\u0448\u043d, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0441\u0442\u0443\u0447\u0438\u0442\u0441\u044f \u0440\u0435\u0441\u0442 (\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u0440\u0435\u0441\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043a\u0443\u0434\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b), \u0442\u0438\u043f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u043d\u0430  \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445 \u0438\u043d\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f soap, \u043d\u043e \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b rest, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443), \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044b sla, \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u043f\u043e \u043f\u0435\u0440\u0446\u0435\u043d\u0442\u0438\u043b\u044f\u043c \u0438 \u0442.\u043f.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043a \u043d\u0430\u0448\u0435\u043c\u0443 API, \u043e\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u043a \u0434\u0440\u0443\u0433\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c. \u0422\u0443\u0442 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u044f\u0441\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 \u0431\u044b\u043b \u0433\u0435\u0439\u0442\u0432\u0435\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043b \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u0432\u044b\u0434\u0430\u0432\u0430\u043b \u0444\u0440\u043e\u043d\u0442\u0443 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 json \u0441\u043e \u0432\u0441\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0443 \u0447\u0442\u043e \u0436, \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b, \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u0440\u0438\u043a \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043d\u0430\u0448\u0435\u0433\u043e API \u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<p>\u0414\u043b\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0444\u0440\u043e\u043d\u0442\u043e\u043c API \u0431\u044d\u043a\u0435\u043d\u0434\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 http.server.requests \u043f\u0440\u043e\u043f\u0435\u0440\u0442\u0438 \u0430\u043a\u0442\u0443\u0430\u0442\u043e\u0440\u0430. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u0432 \u043d\u0438\u0445 \u043f\u0440\u043e\u043a\u0438\u043d\u0443\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0448\u043d, \u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u0430\u043f\u0438\u043b\u0441\u044f \u043f\u043e \u0443\u0440\u043b\u0443 \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434\u0435.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u043c\u0435\u0442\u0440\u0438\u043a \u0444\u0438\u043b\u044c\u0442\u0440 \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u044d\u043a\u0448\u043d \u0442\u0435\u0433:<\/p>\n<pre><code class=\"java\">@Component public class MetricCustomServerProvider implements WebFluxTagsContributor {      @Override     public Iterable&lt;Tag> httpRequestTags(ServerWebExchange exchange,                                          Throwable ex) {         Tag action = Tag.of(\"action\", \/* \u043a\u0430\u043a \u0441\u044e\u0434\u0430 \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 ? *\/);         return Collections.singletonList(action);     } }<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0432\u043e\u0437\u043d\u0438\u043a \u0432\u043e\u043f\u0440\u043e\u0441, \u0430 \u043a\u0430\u043a \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440, \u043e\u0442\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u043e\u0442 \u0431\u0438\u0437\u043d\u0435\u0441 \u043b\u043e\u0433\u0438\u043a\u0438? \u0420\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432 Webflux \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u0440\u0438\u043c\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0433\u043e \u0432 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u043d\u0435 \u0432\u044b\u0439\u0434\u0435\u0442. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0448\u043b\u043e \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435: \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0443, \u043f\u043e\u0441\u043b\u0435 \u0434\u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u0432 \u0445\u0435\u0434\u0435\u0440\u044b \u043e\u0442\u0432\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440 \u043c\u0435\u0442\u0440\u0438\u043a \u0441\u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0438\u0437 ServerWebExchange \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0434 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0441\u0442\u0430\u043b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"java\">@Component public class MetricCustomServerProvider implements WebFluxTagsContributor {      @Override     public Iterable&lt;Tag> httpRequestTags(ServerWebExchange exchange,                                          Throwable ex) {         Tag action = Tag.of(\"action\", createAction(exchange));         return Collections.singletonList(action);     }      private String createAction(ServerWebExchange exchange) {         final HttpHeaders headers = exchange.getResponse().getHeaders();          String action = null;                  if (headers.containsKey(ContextParameter.A\u0421TION_HEADER)) {             action = Optional.ofNullable(headers.get(ContextParameter.ACTION_HEADER))                     .map(h -> h.get(0))                     .orElse(null)                     ;         }                  return action;     } }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c, \u0432\u044b\u043d\u0435\u0441\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0445\u0435\u0434\u0435\u0440\u0430 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0436\u0435 \u0432 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0434\u0430\u043b\u0435\u0435.<\/p>\n<pre><code class=\"java\">public final class ContextParameter {     public final static String A\u0421TION_HEADER = \"sa\"; }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 \u0445\u0435\u0434\u0435\u0440 \u043e\u0442\u0432\u0435\u0442\u0430. \u0412 \u044d\u0442\u043e\u043c \u043f\u043b\u0430\u043d\u0435 \u043c\u043d\u0435 \u043f\u043e\u0432\u0435\u0437\u043b\u043e, \u0432\u0441\u0435 \u0440\u0435\u0441\u0442\u044b \u0441\u0442\u0443\u0447\u0430\u043b\u0438\u0441\u044c \u0447\u0435\u0440\u0435\u0437 ResponseWrapper, \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u043e\u0442\u0432\u0435\u0442 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 json. \u0412\u043e\u0442 \u043e\u043d \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0434\u043b\u044f \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0445\u0435\u0434\u0435\u0440\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u044d\u043a\u0448\u043d\u0430!<\/p>\n<pre><code class=\"java\">public interface CommonExchange {     default Mono&lt;ServerResponse> response(HttpStatus status,                                           Object body,                                           ErrorResponseModel error) {         AtomicReference&lt;String> actionValue = new AtomicReference&lt;>();         return Mono                 .subscriberContext(context -> {                     if (!context.hasKey(ContextParameter.A\u0421TION_HEADER)) {                         actionValue.set(\"\");                     } else {                         Map&lt;Object, Object> map = context.get(ContextParameter.A\u0421TION_HEADER);                         actionValue.set((String) map.get(ContextParameter.A\u0421TION_HEADER));                     }                     return context;                 })                .flatMap(ok -> ServerResponse                                 .status(status)                                 .header(ContextParameter.A\u0421TION_HEADER, actionValue.get())                                 .contentType(APPLICATION_JSON)                                 .syncBody(new ResponseModel(body, error))                 );      } }<\/code><\/pre>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0432 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u043e \u0445\u0435\u0434\u0435\u0440\u0443, \u043d\u043e \u043f\u0435\u0440\u0435\u0434 \u044d\u0442\u0438\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435, \u043d\u043e \u0432\u0430\u0436\u043d\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435:<\/p>\n<p><em>\u041d\u0430 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0438\u043b\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432. \u0414\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f WebClient (\u0412\u044b \u0436\u0435 \u0434\u0435\u0439\u0441\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u044b \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e ? \ud83d\ude42 ).<\/em>  <\/p>\n<p>\u0412 \u0440\u043e\u0443\u0442\u0435\u0440-\u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.<\/p>\n<p>\u0421\u043e\u043a\u0440\u0430\u0442\u0438\u043c \u043a\u043e\u0434 \u0434\u043e \u043f\u0430\u0440\u044b \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u043e \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e:<\/p>\n<pre><code class=\"java\">@EnableWebFlux @Configuration public class WebConfig implements WebFluxConfigurer {  @Autowired private ServerProperties serverProperties; \/\/ \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f   @Bean public RouterFunction&lt;ServerResponse> orderRoute(OrderHandler orderHandler) {     return route()             .GET(serverProperties.getUrl() + \"\/orders\", accept(APPLICATION_JSON), req -> InContextAction.process(\"getOrders\", req,  orderHandler.getOrders(req)))             .GET(serverProperties.getUrl() + \"\/orders\/active\", accept(APPLICATION_JSON), req -> InContextAction.process(\"getActiveOrders\", req,  orderHandler.getActiveOrders(req)))             \/\/ \u2026 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b             .build(); }<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 InContextAction, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0448\u0435\u0439 \u0440\u043e\u0443\u0442\u0435\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430, \u0442\u043e\u043b\u044c\u043a\u043e \u0445\u0435\u0448 \u0438 \u0442\u0438\u043f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c, \u043a\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u044f\u0432\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0439.<\/p>\n<pre><code class=\"java\">public class InContextAction {      public static Mono&lt;ServerResponse> process(String name,                                                ServerRequest request,                                                Mono&lt;ServerResponse> action) {         return action           .subscriberContext(ctx -> {             Map&lt;Object, Object> apiMethodMap = new HashMap&lt;>();             apiMethodMap.put(ContextParameter.A\u0421TION_HEADER, name);              request.exchange()  .getRequest()  .mutate()  .header(ContextParameter.A\u0421TION_HEADER,                            apiMethodMap.get(ContextParameter.A\u0421TION_HEADER)                            .toString()                    );              return ctx.put(ContextParameter.A\u0421TION_HEADER, apiMethodMap);         });     } }<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0451. \u0421 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u043a\u043e\u0439 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043e. \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0443\u044e, \u043d\u043e \u0442\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0431\u0435\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 WebClient.<\/p>\n<hr\/>\n<h2>\u041c\u0435\u0442\u0440\u0438\u043a\u0430 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043d\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<pre><code class=\"java\">public final class ContextParameter {     public final static String A\u0421TION_HEADER= \"sa\";     public final static String INNER_ACTION_HEADER = \"ca\"; }<\/code><\/pre>\n<p> \u0417\u0430\u0442\u0435\u043c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u043c\u0435\u0442\u0440\u0438\u043a\u0443 http.inner.requests:<\/p>\n<pre><code class=\"java\">@Configuration @EnableAsync @EnableScheduling public class MetricConfig {      @Bean     public MetricsWebClientFilterFunction clientMetric(PrometheusMeterRegistry registry,                                                        WebClientExchangeTagsProvider provider) {         return new MetricsWebClientFilterFunction(                 registry,                 provider,                 \"http.inner.requests\",                 AutoTimer.ENABLED         );     } }<\/code><\/pre>\n<p> \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440 \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0445 \u043c\u0435\u0442\u0440\u0438\u043a:<\/p>\n<pre><code class=\"java\">@Component public class MetricCustomClientProvider extends DefaultWebClientExchangeTagsProvider {      @Override     public Iterable&lt;Tag> customTags(ClientRequest request,                               ClientResponse response,                               Throwable throwable) {         Tag type = Tag.of(\"type\", \"rest\");         Tag host = Tag.of(\"host\", WebClientExchangeTags.clientName(request).getValue());         Tag action = Tag.of(\"action\", generateAction(request));                Tag method = WebClientExchangeTags.method(request);         Tag status = WebClientExchangeTags.status(response, throwable);         Tag outcome = WebClientExchangeTags.outcome(response);                  return Arrays.asList(method, status, outcome, type, host, action);     }      private String generateAction(ClientRequest request) {         return Optional.ofNullable(request.headers().get(ContextParameter.INNER_ACTION_HEADER))                 .map(headers -> headers.get(0))                 .orElse(\"\");     }  }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043d\u0435\u0434\u0440\u0438\u043c \u0432 \u0432\u044b\u0437\u043e\u0432 WebClient \u043d\u043e\u0432\u044b\u0439 \u0445\u0435\u0434\u0435\u0440 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u0438\u043a\u0438\u043c \u043c\u0435\u0442\u0440\u0438\u043a \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u043c:<\/p>\n<pre><code class=\"java\">@Autowired private MetricsWebClientFilterFunction clientMetricFilter;   \/\/ .. \u043a\u043e\u0434 \u0441\u0435\u0440\u0432\u0438\u0441\u0430  DefaultUriBuilderFactory encodedUriFactory = new<\/code><\/pre>\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-332212","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/332212","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=332212"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/332212\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=332212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=332212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=332212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}