<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # :-: cat-client配置 **1 被監控的三方應用所在的服務器上配置如下內容:** ~~~ mkdir /data/applogs/cat mkdir /data/appdatas/cat ~~~ **2在此目錄創建 client.xml** ~~~ // /data/appdatas/cat/client.xml 配置內容 <?xml version="1.0" encoding="utf-8"?> <config mode="client"> <servers>? ? ? ? <server ip="127.0.0.1" port="2280" http-port="8080" /> </servers> </config> ~~~ // ip 為監控服務端cat-home 地址 // http-port 為監控服務端cat-home 端口 // port2280 為固定值 ,jetty端口 **3 引入 `cat-client.xxx.jar` 包 【坑!!】** 若從maven repository上下載的 `cat-client.jar ` 包, 很有可能會報` 未找到 ModeContext異常 `, 所以一定要注意使用github下載的源碼編譯cat工程: ``` git clone https://github.com/dianping/cat.git mvn clean install -DskipTests ``` 到 ` \cat\cat-client\target `目錄 或者 `D:\workspace\java\cat\lib\java\jar` 把 `cat-client-3.0.0.jar` 安裝到本地maven倉庫或工程 ``` mvn install:install-file -Dfile=cat-client-3.0.0.jar -DgroupId=com.dianping.cat -DartifactId=cat- client -Dversion=3.0.0 -Dpackaging=jar ``` **官方文檔通知 :** 1. 根目錄下 cat-client 模塊以后不再維護,下個大版本更新計劃移除。新版Java客戶端參考:lib/java 2. 管理端、服務端、告警服務均使用 cat-home 模塊部署即可 ### 4cat-client部署步驟 假設工程啟動時模塊名application-context設置為:nic,即/nic/*** 在工程的`resources`下創建`META-INF ` ~~~ |--resources --META-INF --cat --client.xml --app.properties ~~~ 其中,`client.xml` 內容如下: ~~~ <?xml version="1.0" encoding="UTF-8"?> <config mode="client"> <domain id="nic"/> </config> // mode=client 客戶端 // <domain id="nic"/> 要監控的應用的domain 為 nic,CAT后臺 會自動添加一個名為 // nic的 transaction ~~~ `app.properties` 配置如下: ~~~ app.name=nic // 此需要監控的應用的名字為nic,需要與上文 <domain id="nic"/> 中的id一致 ~~~ ### 5配置埋點 攔截器模式配置: ~~~ public class CatInterceptor implements HandlerInterceptor { Logger logger = LoggerFactory.getLogger(CatInterceptor.class); private ThreadLocal<Transaction> tranLocal = new ThreadLocal<Transaction>(); private ThreadLocal<Transaction> pageLocal = new ThreadLocal<Transaction>(); @Override public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception { String uri = httpServletRequest.getRequestURI(); Transaction transaction = Cat.newTransaction("URL", uri); Cat.logEvent("URL.Method", httpServletRequest.getMethod(), Message.SUCCESS, httpServletRequest.getRequestURL().toString()); Cat.logEvent("URL.Host", httpServletRequest.getRemoteHost(), Message.SUCCESS, httpServletRequest.getRemoteHost()); tranLocal.set(transaction); return true; } @Override public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception { String viewName = modelAndView != null ? modelAndView.getViewName() : "NONE"; Transaction transaction = Cat.newTransaction("view", viewName); pageLocal.set(transaction); } @Override public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception { Transaction pt = pageLocal.get(); pt.setStatus(Transaction.SUCCESS); pt.complete(); Transaction t = tranLocal.get(); t.setStatus(Transaction.SUCCESS); t.complete(); } } ~~~ ### 6 spring-web.xml中添加攔截器 ~~~ <!--添加攔截器--> <mvc:interceptors> <mvc:interceptor> <mvc:mapping path="/**"/> <bean class="org.seckill.interceptor.CatInterceptor"></bean> </mvc:interceptor> </mvc:interceptors> ~~~ ## 7 cat-home 與 cat-client配置在同一服務器上的步驟 cat-home 與 cat-client可以共用 /data/appdatas/cat cat-client只需要在 /data/appdatas/cat下配置client.xml即可,如果已配置不需要再重復配置
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看