You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/08/15 05:47:42 UTC

[GitHub] [incubator-kyuubi] lightning-L opened a new pull request, #3233: [KYUUBI #3156] Expose REST frontend connection metrics

lightning-L opened a new pull request, #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233

   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
     2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
   -->
   
   ### _Why are the changes needed?_
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about the use case of it.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### _How was this patch tested?_
   - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [ ] Add screenshots for manual tests if appropriate
   
   - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei closed pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei closed pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics
URL: https://github.com/apache/incubator-kyuubi/pull/3233


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei commented on code in PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#discussion_r946542310


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/http/authentication/AuthenticationFilter.scala:
##########
@@ -125,6 +127,9 @@ class AuthenticationFilter(conf: KyuubiConf) extends Filter with Logging {
         }
       } catch {
         case e: AuthenticationException =>
+          MetricsSystem.tracing { ms =>
+            ms.incCount(REST_CONN_FAIL)
+          }

Review Comment:
   ```
     protected def doFilter(
         filterChain: FilterChain,
         request: HttpServletRequest,
         response: HttpServletResponse): Unit = {
      try {
             filterChain.doFilter(request, response)
       } catch {
          case e: Throwable =>  MetricsSystem.tracing(_.incCount(REST_CONN_FAIL)
             }
       }
   
     }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei commented on PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#issuecomment-1219280612

   merged to branch-1.6 as well


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei commented on code in PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#discussion_r946542310


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/http/authentication/AuthenticationFilter.scala:
##########
@@ -125,6 +127,9 @@ class AuthenticationFilter(conf: KyuubiConf) extends Filter with Logging {
         }
       } catch {
         case e: AuthenticationException =>
+          MetricsSystem.tracing { ms =>
+            ms.incCount(REST_CONN_FAIL)
+          }

Review Comment:
   ```
     protected def doFilter(
         filterChain: FilterChain,
         request: HttpServletRequest,
         response: HttpServletResponse): Unit = {
      try {
         filterChain.doFilter(request, response)
       } catch {
         case e: Throwable =>  MetricsSystem.tracing(_.incCount(REST_CONN_FAIL)
       }
     }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei commented on code in PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#discussion_r948576377


##########
kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/SessionsResourceSuite.scala:
##########
@@ -127,6 +130,13 @@ class SessionsResourceSuite extends KyuubiFunSuite with RestFrontendTestHelper {
   }
 
   test("get infoType") {
+    val totalConnections =
+      MetricsSystem.counterValue(MetricsConstants.REST_CONN_TOTAL).getOrElse(0L)
+    val openConnections =

Review Comment:
   just remove it



##########
kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/SessionsResourceSuite.scala:
##########
@@ -160,6 +170,15 @@ class SessionsResourceSuite extends KyuubiFunSuite with RestFrontendTestHelper {
     response = webTarget.path(s"api/v1/sessions/$sessionHandle/info/str")
       .request().get()
     assert(404 == response.getStatus)
+
+    eventually(timeout(3.seconds), interval(200.milliseconds)) {
+      assert(MetricsSystem.counterValue(
+        MetricsConstants.REST_CONN_TOTAL).getOrElse(0L) - totalConnections === 6)
+      assert(MetricsSystem.counterValue(
+        MetricsConstants.REST_CONN_OPEN).getOrElse(0L) - openConnections === 0)

Review Comment:
   ```
   assert(MetricsSystem.counterValue(MetricsConstants.REST_CONN_OPEN).getOrElse(0L) === 0)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei commented on code in PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#discussion_r948575407


##########
kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/SessionsResourceSuite.scala:
##########
@@ -160,6 +170,15 @@ class SessionsResourceSuite extends KyuubiFunSuite with RestFrontendTestHelper {
     response = webTarget.path(s"api/v1/sessions/$sessionHandle/info/str")
       .request().get()
     assert(404 == response.getStatus)
+
+    eventually(timeout(3.seconds), interval(200.milliseconds)) {
+      assert(MetricsSystem.counterValue(
+        MetricsConstants.REST_CONN_TOTAL).getOrElse(0L) - totalConnections === 6)
+      assert(MetricsSystem.counterValue(
+        MetricsConstants.REST_CONN_OPEN).getOrElse(0L) - openConnections === 0)

Review Comment:
   or we do not need check the openConnections ==0 above.
   
   ```
   assert(MetricsSystem.counterValue(MetricsConstants.REST_CONN_OPEN).getOrElse(0L) === 0)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei commented on code in PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#discussion_r946542310


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/http/authentication/AuthenticationFilter.scala:
##########
@@ -125,6 +127,9 @@ class AuthenticationFilter(conf: KyuubiConf) extends Filter with Logging {
         }
       } catch {
         case e: AuthenticationException =>
+          MetricsSystem.tracing { ms =>
+            ms.incCount(REST_CONN_FAIL)
+          }

Review Comment:
   ```
     protected def doFilter(
         filterChain: FilterChain,
         request: HttpServletRequest,
         response: HttpServletResponse): Unit = {
      try {
             filterChain.doFilter(request, response)
       } catch {
          case e: Throwable =>  MetricsSystem.tracing(_.incCount(REST_CONN_FAIL)
       }
      
   
     }
   ```



##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/http/authentication/AuthenticationFilter.scala:
##########
@@ -125,6 +127,9 @@ class AuthenticationFilter(conf: KyuubiConf) extends Filter with Logging {
         }
       } catch {
         case e: AuthenticationException =>
+          MetricsSystem.tracing { ms =>
+            ms.incCount(REST_CONN_FAIL)
+          }

Review Comment:
   ```
     protected def doFilter(
         filterChain: FilterChain,
         request: HttpServletRequest,
         response: HttpServletResponse): Unit = {
      try {
         filterChain.doFilter(request, response)
       } catch {
         case e: Throwable =>  MetricsSystem.tracing(_.incCount(REST_CONN_FAIL)
       }
      
   
     }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei commented on PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#issuecomment-1218880245

   ```
   SessionsResourceSuite:
   - open/close and count session
   - getSessionList
   - get session event
   - get infoType *** FAILED ***
     The code passed to eventually never returned normally. Attempted 25 times over 3.0176177319999997 seconds. Last failure message: -1 did not equal 0. 
   ```
   
   The metrics value is `-1`, seems that we decrease the open count two times?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei commented on code in PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#discussion_r946543758


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/http/authentication/AuthenticationFilter.scala:
##########
@@ -125,6 +127,9 @@ class AuthenticationFilter(conf: KyuubiConf) extends Filter with Logging {
         }
       } catch {
         case e: AuthenticationException =>
+          MetricsSystem.tracing { ms =>
+            ms.incCount(REST_CONN_FAIL)
+          }

Review Comment:
   we should also increase the REST_CONN_FAIL in L117



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei commented on code in PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#discussion_r946542310


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/http/authentication/AuthenticationFilter.scala:
##########
@@ -125,6 +127,9 @@ class AuthenticationFilter(conf: KyuubiConf) extends Filter with Logging {
         }
       } catch {
         case e: AuthenticationException =>
+          MetricsSystem.tracing { ms =>
+            ms.incCount(REST_CONN_FAIL)
+          }

Review Comment:
   ```
     protected def doFilter(
         filterChain: FilterChain,
         request: HttpServletRequest,
         response: HttpServletResponse): Unit = {
      try {
         filterChain.doFilter(request, response)
       } catch {
         case e: Throwable =>
              MetricsSystem.tracing(_.incCount(REST_CONN_FAIL)
              throw e
       }
     }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei commented on PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#issuecomment-1219229013

   thanks, merged to master
   please add related docs to docs/metrics.md later.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei commented on code in PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#discussion_r948574440


##########
kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/SessionsResourceSuite.scala:
##########
@@ -127,6 +130,13 @@ class SessionsResourceSuite extends KyuubiFunSuite with RestFrontendTestHelper {
   }
 
   test("get infoType") {
+    val totalConnections =
+      MetricsSystem.counterValue(MetricsConstants.REST_CONN_TOTAL).getOrElse(0L)
+    val openConnections =

Review Comment:
   adding a `eventually` and wait the openConnections == 0 to prevent flaky test?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei commented on code in PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#discussion_r948575638


##########
kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/BatchCliSuite.scala:
##########
@@ -74,6 +76,11 @@ class BatchCliSuite extends RestClientTestHelper with TestPrematureExit with Bat
   }
 
   test("basic batch rest client") {
+    val totalConnections =
+      MetricsSystem.counterValue(MetricsConstants.REST_CONN_TOTAL).getOrElse(0L)
+    val openConnections =
+      MetricsSystem.counterValue(MetricsConstants.REST_CONN_OPEN).getOrElse(0L)

Review Comment:
   remove it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei commented on PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#issuecomment-1217658206

   There is some failed UT.
   
   ```
   SessionsResourceSuite:
   - open/close and count session
   - getSessionList
   - get session event
   - get infoType *** FAILED ***
     1 did not equal 0 (SessionsResourceSuite.scala:174)
   
   
   BatchRestApiSuite:
   - basic batch rest client
   - basic batch rest client with invalid user *** FAILED ***
     -1 did not equal 0 (BatchRestApiSuite.scala:89)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] codecov-commenter commented on pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#issuecomment-1214783556

   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/3233?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#3233](https://codecov.io/gh/apache/incubator-kyuubi/pull/3233?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5b963c4) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/db0047d51c1d734c288635866934f2f316f2e5d0?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (db0047d) will **increase** coverage by `0.79%`.
   > The diff coverage is `88.23%`.
   
   > :exclamation: Current head 5b963c4 differs from pull request most recent head 0337ee6. Consider uploading reports for the commit 0337ee6 to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3233      +/-   ##
   ============================================
   + Coverage     50.93%   51.72%   +0.79%     
     Complexity       13       13              
   ============================================
     Files           469      465       -4     
     Lines         26121    25737     -384     
     Branches       3611     3562      -49     
   ============================================
   + Hits          13304    13313       +9     
   + Misses        11544    11152     -392     
   + Partials       1273     1272       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/3233?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...cala/org/apache/kyuubi/server/ui/JettyServer.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/3233/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXJ2ZXIvdWkvSmV0dHlTZXJ2ZXIuc2NhbGE=) | `84.90% <75.00%> (-2.06%)` | :arrow_down: |
   | [...a/org/apache/kyuubi/metrics/MetricsConstants.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/3233/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLW1ldHJpY3Mvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvbWV0cmljcy9NZXRyaWNzQ29uc3RhbnRzLnNjYWxh) | `100.00% <100.00%> (ø)` | |
   | [...ache/kyuubi/server/KyuubiRestFrontendService.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/3233/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXJ2ZXIvS3l1dWJpUmVzdEZyb250ZW5kU2VydmljZS5zY2FsYQ==) | `82.22% <100.00%> (+1.26%)` | :arrow_up: |
   | [...e/kyuubi/server/KyuubiTBinaryFrontendService.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/3233/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zZXJ2ZXIvS3l1dWJpVEJpbmFyeUZyb250ZW5kU2VydmljZS5zY2FsYQ==) | `84.84% <0.00%> (-3.25%)` | :arrow_down: |
   | [...n/scala/org/apache/kyuubi/engine/ProcBuilder.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/3233/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9lbmdpbmUvUHJvY0J1aWxkZXIuc2NhbGE=) | `82.60% <0.00%> (-0.63%)` | :arrow_down: |
   | [...in/scala/org/apache/kyuubi/config/KyuubiConf.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/3233/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9jb25maWcvS3l1dWJpQ29uZi5zY2FsYQ==) | `97.27% <0.00%> (-0.09%)` | :arrow_down: |
   | [...g/apache/kyuubi/operation/BatchJobSubmission.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/3233/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9vcGVyYXRpb24vQmF0Y2hKb2JTdWJtaXNzaW9uLnNjYWxh) | `74.40% <0.00%> (ø)` | |
   | [...yuubi/spark/connector/common/SemanticVersion.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/3233/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZW5zaW9ucy9zcGFyay9reXV1Ymktc3BhcmstY29ubmVjdG9yLWNvbW1vbi9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9zcGFyay9jb25uZWN0b3IvY29tbW9uL1NlbWFudGljVmVyc2lvbi5zY2FsYQ==) | `0.00% <0.00%> (ø)` | |
   | [.../java/org/apache/kyuubi/reflection/DynMethods.java](https://codecov.io/gh/apache/incubator-kyuubi/pull/3233/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUva3l1dWJpL3JlZmxlY3Rpb24vRHluTWV0aG9kcy5qYXZh) | | |
   | ... and [9 more](https://codecov.io/gh/apache/incubator-kyuubi/pull/3233/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei commented on code in PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#discussion_r946542310


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/http/authentication/AuthenticationFilter.scala:
##########
@@ -125,6 +127,9 @@ class AuthenticationFilter(conf: KyuubiConf) extends Filter with Logging {
         }
       } catch {
         case e: AuthenticationException =>
+          MetricsSystem.tracing { ms =>
+            ms.incCount(REST_CONN_FAIL)
+          }

Review Comment:
   ```
     protected def doFilter(
         filterChain: FilterChain,
         request: HttpServletRequest,
         response: HttpServletResponse): Unit = {
      try {
         filterChain.doFilter(request, response)
       } catch {
         case e: Throwable =>
            MetricsSystem.tracing(_.incCount(REST_CONN_FAIL)
            throw e
       }
     }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei commented on code in PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#discussion_r948575884


##########
kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/BatchRestApiSuite.scala:
##########
@@ -59,6 +62,13 @@ class BatchRestApiSuite extends RestClientTestHelper with BatchTestHelper {
   }
 
   test("basic batch rest client with invalid user") {
+    val totalConnections =
+      MetricsSystem.counterValue(MetricsConstants.REST_CONN_TOTAL).getOrElse(0L)
+    val openConnections =
+      MetricsSystem.counterValue(MetricsConstants.REST_CONN_OPEN).getOrElse(0L)

Review Comment:
   remove



##########
kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/BatchRestApiSuite.scala:
##########
@@ -75,6 +85,15 @@ class BatchRestApiSuite extends RestClientTestHelper with BatchTestHelper {
     assert(e.getCause.toString.contains(s"Error validating LDAP user: uid=${customUser}"))
 
     basicKyuubiRestClient.close()
+
+    eventually(timeout(3.seconds), interval(200.milliseconds)) {
+      assert(MetricsSystem.counterValue(
+        MetricsConstants.REST_CONN_TOTAL).getOrElse(0L) - totalConnections === 1)
+      assert(MetricsSystem.counterValue(
+        MetricsConstants.REST_CONN_OPEN).getOrElse(0L) - openConnections === 0)
+      assert(MetricsSystem.counterValue(

Review Comment:
   assert(MetricsSystem.counterValue(MetricsConstants.REST_CONN_OPEN).getOrElse(0L) === 0)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei commented on code in PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#discussion_r948575773


##########
kyuubi-server/src/test/scala/org/apache/kyuubi/server/rest/client/BatchCliSuite.scala:
##########
@@ -121,6 +128,13 @@ class BatchCliSuite extends RestClientTestHelper with TestPrematureExit with Bat
       "--password",
       ldapUserPasswd)
     result = testPrematureExitForControlCli(deleteArgs, "\"success\":true")
+
+    eventually(timeout(3.seconds), interval(200.milliseconds)) {
+      assert(MetricsSystem.counterValue(
+        MetricsConstants.REST_CONN_TOTAL).getOrElse(0L) - totalConnections === 5)
+      assert(MetricsSystem.counterValue(
+        MetricsConstants.REST_CONN_OPEN).getOrElse(0L) - openConnections === 0)

Review Comment:
   assert(MetricsSystem.counterValue(MetricsConstants.REST_CONN_OPEN).getOrElse(0L) === 0)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] turboFei commented on a diff in pull request #3233: [KYUUBI #3156] Expose REST frontend connection metrics

Posted by GitBox <gi...@apache.org>.
turboFei commented on code in PR #3233:
URL: https://github.com/apache/incubator-kyuubi/pull/3233#discussion_r948574440


##########
kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/SessionsResourceSuite.scala:
##########
@@ -127,6 +130,13 @@ class SessionsResourceSuite extends KyuubiFunSuite with RestFrontendTestHelper {
   }
 
   test("get infoType") {
+    val totalConnections =
+      MetricsSystem.counterValue(MetricsConstants.REST_CONN_TOTAL).getOrElse(0L)
+    val openConnections =

Review Comment:
   how about add a eventually and wait the openConnections == 0?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org