This is an automated email from the ASF dual-hosted git repository.

smolnar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git


The following commit(s) were added to refs/heads/master by this push:
     new 2227873b1 KNOX-2855:Added Hbase UI proxying for prometheus end points 
(#704)
2227873b1 is described below

commit 2227873b1eb8e6c45a3908aab7735c1c348eded0
Author: Vaibhav Joshi <[email protected]>
AuthorDate: Mon Dec 19 14:29:07 2022 +0530

    KNOX-2855:Added Hbase UI proxying for prometheus end points (#704)
---
 .../src/main/resources/services/hbaseui/2.1.0/rewrite.xml         | 8 ++++++++
 .../src/main/resources/services/hbaseui/2.1.0/service.xml         | 4 ++++
 2 files changed, 12 insertions(+)

diff --git 
a/gateway-service-definitions/src/main/resources/services/hbaseui/2.1.0/rewrite.xml
 
b/gateway-service-definitions/src/main/resources/services/hbaseui/2.1.0/rewrite.xml
index 0bb434fe6..d132f31c0 100644
--- 
a/gateway-service-definitions/src/main/resources/services/hbaseui/2.1.0/rewrite.xml
+++ 
b/gateway-service-definitions/src/main/resources/services/hbaseui/2.1.0/rewrite.xml
@@ -214,6 +214,14 @@
     <rewrite 
template="{$frontend[url]}/hbase/webui/jmx?host={$inboundurl[host]}?port={$inboundurl[port]}?{**}"/>
   </rule>
 
+  <!-- Prometheus metrics -->
+  <rule dir="IN" name="HBASEUI/hbase/inbound/prometheus" 
pattern="*://*:*/**/hbase/webui/prometheus?{host}?{port}?{**}">
+    <rewrite 
template="{$serviceScheme[HBASEUI]}://{host}:{port}/prometheus?{**}"/>
+  </rule>
+  <rule dir="OUT" name="HBASEUI/hbase/outbound/prometheus" 
pattern="/prometheus?{**}">
+    <rewrite 
template="{$frontend[url]}/hbase/webui/prometheus?host={$inboundurl[host]}?port={$inboundurl[port]}?{**}"/>
+  </rule>
+
   <!-- Static file serving -->
   <rule dir="IN" name="HBASEUI/hbase/inbound/static" 
pattern="*://*:*/**/hbase/webui/static/{**}">
     <rewrite template="{$serviceUrl[HBASEUI]}/static/{**}"/>
diff --git 
a/gateway-service-definitions/src/main/resources/services/hbaseui/2.1.0/service.xml
 
b/gateway-service-definitions/src/main/resources/services/hbaseui/2.1.0/service.xml
index d23bc6f9f..0ccb5b030 100644
--- 
a/gateway-service-definitions/src/main/resources/services/hbaseui/2.1.0/service.xml
+++ 
b/gateway-service-definitions/src/main/resources/services/hbaseui/2.1.0/service.xml
@@ -63,6 +63,10 @@
           <rewrite apply="HBASEUI/hbase/inbound/jmx" to="request.url"/>
           <rewrite apply="HBASEUI/hbase/outbound/jmx" to="response.body"/>
         </route>
+        <route path="/hbase/webui/prometheus?{**}">
+            <rewrite apply="HBASEUI/hbase/inbound/prometheus" 
to="request.url"/>
+            <rewrite apply="HBASEUI/hbase/outbound/prometheus" 
to="response.body"/>
+        </route>
         <route path="/hbase/webui/prof?{**}">
           <rewrite apply="HBASEUI/hbase/inbound/profiler" to="request.url"/>
           <rewrite apply="HBASEUI/hbase/outbound/profiler" to="response.body"/>

Reply via email to