Skip to content

Commit 60cccb3

Browse files
MaBiContikarina-calma
authored andcommitted
Change links on front page to be relative
When the endpoint of the exporter is mapped to a subpath by a reverse proxy, absolute links would break. Relative links continue to work. Co-authored-by: Karina Calma <karina_calma@infobest.ro> Signed-off-by: Martin Bickel <martin.bickel@continental.com>
1 parent ac0a930 commit 60cccb3

File tree

1 file changed

+6
-6
lines changed
  • prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver

1 file changed

+6
-6
lines changed

prometheus-metrics-exporter-httpserver/src/main/java/io/prometheus/metrics/exporter/httpserver/DefaultHandler.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ public DefaultHandler() {
2121
"<body>\n" +
2222
"<h1>Prometheus Java Client</h1>\n" +
2323
"<h2>Metrics Path</h2>\n" +
24-
"The metrics path is <a href=\"/metrics\">/metrics</a>.\n" +
24+
"The metrics path is <a href=\"metrics\">/metrics</a>.\n" +
2525
"<h2>Name Filter</h2>\n" +
2626
"If you want to scrape only specific metrics, use the <tt>name[]</tt> parameter like this:\n" +
2727
"<ul>\n" +
28-
"<li><a href=\"/metrics?name[]=my_metric\">/metrics?name[]=my_metric</a></li>\n" +
28+
"<li><a href=\"metrics?name[]=my_metric\">/metrics?name[]=my_metric</a></li>\n" +
2929
"</ul>\n" +
3030
"You can also use multiple <tt>name[]</tt> parameters to query multiple metrics:\n" +
3131
"<ul>\n" +
32-
"<li><a href=\"/metrics?name[]=my_metric_a&name=my_metrics_b\">/metrics?name[]=my_metric_a&amp;name=[]=my_metric_b</a></li>\n" +
32+
"<li><a href=\"metrics?name[]=my_metric_a&name=my_metrics_b\">/metrics?name[]=my_metric_a&amp;name=[]=my_metric_b</a></li>\n" +
3333
"</ul>\n" +
3434
"The <tt>name[]</tt> parameter can be used by the Prometheus server for scraping. Add the following snippet to your scrape job configuration in <tt>prometheus.yaml</tt>:\n" +
3535
"<pre>\n" +
@@ -45,9 +45,9 @@ public DefaultHandler() {
4545
"in which case the default is Prometheus protobuf.\n" +
4646
"The Prometheus Java metrics library supports a <tt>debug</tt> query parameter for viewing the different formats in a Web browser:\n" +
4747
"<ul>\n" +
48-
"<li><a href=\"/metrics?debug=openmetrics\">/metrics?debug=openmetrics</a>: View OpenMetrics text format.</li>\n" +
49-
"<li><a href=\"/metrics?debug=text\">/metrics?debug=text</a>: View Prometheus text format (this is the default when accessing the <a href=\"/metrics\">/metrics</a> endpoint with a Web browser).</li>\n" +
50-
"<li><a href=\"/metrics?debug=prometheus-protobuf\">/metrics?debug=prometheus-protobuf</a>: View a text representation of the Prometheus protobuf format.</li>\n" +
48+
"<li><a href=\"metrics?debug=openmetrics\">/metrics?debug=openmetrics</a>: View OpenMetrics text format.</li>\n" +
49+
"<li><a href=\"metrics?debug=text\">/metrics?debug=text</a>: View Prometheus text format (this is the default when accessing the <a href=\"metrics\">/metrics</a> endpoint with a Web browser).</li>\n" +
50+
"<li><a href=\"metrics?debug=prometheus-protobuf\">/metrics?debug=prometheus-protobuf</a>: View a text representation of the Prometheus protobuf format.</li>\n" +
5151
"</ul>\n" +
5252
"Note that the <tt>debug</tt> parameter is only for viewing different formats in a Web browser, it should not be used by the Prometheus server for scraping. The Prometheus server uses the <tt>Accept</tt> header for indicating which format it accepts.\n" +
5353
"</body>\n" +

0 commit comments

Comments
 (0)