You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2022/09/30 11:46:39 UTC

[GitHub] [hbase] lucakovacs opened a new pull request, #4807: HBASE-27395 Adding description to Prometheus metrics

lucakovacs opened a new pull request, #4807:
URL: https://github.com/apache/hbase/pull/4807

   You can access metrics description while using '/prometheus' endpoint via "description=true" URL parameter.
   Example: `http://HOSTNAME:16010/prometheus?description=true`
   
   Apache JIRA: https://issues.apache.org/jira/browse/HBASE-27395


-- 
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: issues-unsubscribe@hbase.apache.org

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


[GitHub] [hbase] Apache-HBase commented on pull request #4807: HBASE-27395 Adding description to Prometheus metrics

Posted by GitBox <gi...@apache.org>.
Apache-HBase commented on PR #4807:
URL: https://github.com/apache/hbase/pull/4807#issuecomment-1263498700

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   0m 47s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  No case conflicting files found.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  Patch does not have any anti-patterns.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any @author tags.  |
   ||| _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   2m 26s |  master passed  |
   | +1 :green_heart: |  compile  |   0m 21s |  master passed  |
   | +1 :green_heart: |  checkstyle  |   0m  9s |  master passed  |
   | +1 :green_heart: |  spotless  |   0m 38s |  branch has no errors when running spotless:check.  |
   | +1 :green_heart: |  spotbugs  |   0m 21s |  master passed  |
   ||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   2m  5s |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 18s |  the patch passed  |
   | +1 :green_heart: |  javac  |   0m 18s |  the patch passed  |
   | -0 :warning: |  checkstyle  |   0m  7s |  hbase-http: The patch generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace issues.  |
   | +1 :green_heart: |  hadoopcheck  |   8m  6s |  Patch does not cause any errors with Hadoop 3.2.4 3.3.4.  |
   | +1 :green_heart: |  spotless  |   0m 35s |  patch has no errors when running spotless:check.  |
   | +1 :green_heart: |  spotbugs  |   0m 25s |  the patch passed  |
   ||| _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m  9s |  The patch does not generate ASF License warnings.  |
   |  |   |  21m 32s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4807/1/artifact/yetus-general-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/4807 |
   | Optional Tests | dupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile |
   | uname | Linux 81b916881dc8 5.4.0-1083-aws #90~18.04.1-Ubuntu SMP Fri Aug 5 08:12:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / 23a56331db |
   | Default Java | Temurin-1.8.0_345-b01 |
   | checkstyle | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4807/1/artifact/yetus-general-check/output/diff-checkstyle-hbase-http.txt |
   | Max. process+thread count | 64 (vs. ulimit of 30000) |
   | modules | C: hbase-http U: hbase-http |
   | Console output | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4807/1/console |
   | versions | git=2.17.1 maven=3.6.3 spotbugs=4.7.2 |
   | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
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: issues-unsubscribe@hbase.apache.org

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


[GitHub] [hbase] Apache-HBase commented on pull request #4807: HBASE-27395 Adding description to Prometheus metrics

Posted by GitBox <gi...@apache.org>.
Apache-HBase commented on PR #4807:
URL: https://github.com/apache/hbase/pull/4807#issuecomment-1263493437

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   1m 16s |  Docker mode activated.  |
   | -0 :warning: |  yetus  |   0m  3s |  Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck  |
   ||| _ Prechecks _ |
   ||| _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   2m 28s |  master passed  |
   | +1 :green_heart: |  compile  |   0m 14s |  master passed  |
   | +1 :green_heart: |  shadedjars  |   3m 47s |  branch has no errors when building our shaded downstream artifacts.  |
   | +1 :green_heart: |  javadoc  |   0m 14s |  master passed  |
   ||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   2m 13s |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 15s |  the patch passed  |
   | +1 :green_heart: |  javac  |   0m 15s |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   3m 48s |  patch has no errors when building our shaded downstream artifacts.  |
   | +1 :green_heart: |  javadoc  |   0m 12s |  the patch passed  |
   ||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |   0m 38s |  hbase-http in the patch passed.  |
   |  |   |  15m 50s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4807/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/4807 |
   | Optional Tests | javac javadoc unit shadedjars compile |
   | uname | Linux 076ac4e79d26 5.4.0-124-generic #140-Ubuntu SMP Thu Aug 4 02:23:37 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / 23a56331db |
   | Default Java | Temurin-1.8.0_345-b01 |
   |  Test Results | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4807/1/testReport/ |
   | Max. process+thread count | 337 (vs. ulimit of 30000) |
   | modules | C: hbase-http U: hbase-http |
   | Console output | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4807/1/console |
   | versions | git=2.17.1 maven=3.6.3 |
   | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
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: issues-unsubscribe@hbase.apache.org

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


[GitHub] [hbase] Apache-HBase commented on pull request #4807: HBASE-27395 Adding description to Prometheus metrics

Posted by GitBox <gi...@apache.org>.
Apache-HBase commented on PR #4807:
URL: https://github.com/apache/hbase/pull/4807#issuecomment-1263493532

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   0m 39s |  Docker mode activated.  |
   | -0 :warning: |  yetus  |   0m  3s |  Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck  |
   ||| _ Prechecks _ |
   ||| _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   2m 41s |  master passed  |
   | +1 :green_heart: |  compile  |   0m 12s |  master passed  |
   | +1 :green_heart: |  shadedjars  |   3m 56s |  branch has no errors when building our shaded downstream artifacts.  |
   | +1 :green_heart: |  javadoc  |   0m 12s |  master passed  |
   ||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   2m 27s |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 12s |  the patch passed  |
   | +1 :green_heart: |  javac  |   0m 12s |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   3m 57s |  patch has no errors when building our shaded downstream artifacts.  |
   | +1 :green_heart: |  javadoc  |   0m 10s |  the patch passed  |
   ||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |   0m 39s |  hbase-http in the patch passed.  |
   |  |   |  15m 50s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4807/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/4807 |
   | Optional Tests | javac javadoc unit shadedjars compile |
   | uname | Linux bd1dc368a794 5.4.0-1071-aws #76~18.04.1-Ubuntu SMP Mon Mar 28 17:49:57 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / 23a56331db |
   | Default Java | Eclipse Adoptium-11.0.16.1+1 |
   |  Test Results | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4807/1/testReport/ |
   | Max. process+thread count | 267 (vs. ulimit of 30000) |
   | modules | C: hbase-http U: hbase-http |
   | Console output | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4807/1/console |
   | versions | git=2.17.1 maven=3.6.3 |
   | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
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: issues-unsubscribe@hbase.apache.org

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


[GitHub] [hbase] payert commented on a diff in pull request #4807: HBASE-27395 Adding description to Prometheus metrics

Posted by GitBox <gi...@apache.org>.
payert commented on code in PR #4807:
URL: https://github.com/apache/hbase/pull/4807#discussion_r985710610


##########
hbase-http/src/main/java/org/apache/hadoop/hbase/http/prometheus/PrometheusHadoopServlet.java:
##########
@@ -57,13 +60,19 @@ static String toPrometheusName(String metricRecordName, String metricName) {
    */
   @RestrictedApi(explanation = "Should only be called in tests or self", link = "",
       allowedOnPath = ".*/src/test/.*|.*/PrometheusHadoopServlet\\.java")
-  void writeMetrics(Writer writer) throws IOException {
+  void writeMetrics(Writer writer, boolean desc) throws IOException {

Review Comment:
   Maybe 'describe' is better argument name than 'desc'.



##########
hbase-http/src/main/java/org/apache/hadoop/hbase/http/prometheus/PrometheusHadoopServlet.java:
##########
@@ -41,7 +41,10 @@ public class PrometheusHadoopServlet extends HttpServlet {
 
   @Override
   protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
-    writeMetrics(resp.getWriter());
+    String tmpStr = req.getParameter("description");
+    boolean description = tmpStr != null && tmpStr.equals("true");
+
+    writeMetrics(resp.getWriter(), description);

Review Comment:
   This could be compacted like this:
   `writeMetrics(resp.getWriter(), "true".equals(req.getParameter("description"))); `



##########
hbase-http/src/main/java/org/apache/hadoop/hbase/http/prometheus/PrometheusHadoopServlet.java:
##########
@@ -57,13 +60,19 @@ static String toPrometheusName(String metricRecordName, String metricName) {
    */
   @RestrictedApi(explanation = "Should only be called in tests or self", link = "",
       allowedOnPath = ".*/src/test/.*|.*/PrometheusHadoopServlet\\.java")
-  void writeMetrics(Writer writer) throws IOException {
+  void writeMetrics(Writer writer, boolean desc) throws IOException {
     Collection<MetricsRecord> metricRecords = MetricsExportHelper.export();
     for (MetricsRecord metricsRecord : metricRecords) {
       for (AbstractMetric metrics : metricsRecord.metrics()) {
         if (metrics.type() == MetricType.COUNTER || metrics.type() == MetricType.GAUGE) {
 
           String key = toPrometheusName(metricsRecord.name(), metrics.name());
+
+          if (desc) {
+            String description = metrics.description();
+            if (!description.isEmpty()) writer.append("# HELP ").append(description).append("\n");

Review Comment:
   When you append a single char to the writer you can use the append(char c) instead if of append(CharSequence csq). I mean
   `.append('\n'`)
   instead of 
   `.append("\n")`
   Doesn't make much difference but slightly cheaper..



-- 
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: issues-unsubscribe@hbase.apache.org

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


[GitHub] [hbase] meszibalu merged pull request #4807: HBASE-27395 Adding description to Prometheus metrics

Posted by GitBox <gi...@apache.org>.
meszibalu merged PR #4807:
URL: https://github.com/apache/hbase/pull/4807


-- 
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: issues-unsubscribe@hbase.apache.org

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