Skip to content

Commit c5b6fad

Browse files
committed
lint
Signed-off-by: Gregor Zeitlinger <[email protected]>
1 parent 87db322 commit c5b6fad

File tree

13 files changed

+48
-29
lines changed

13 files changed

+48
-29
lines changed

docs/content/_index.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
title: "client_java"
33
---
44

5-
This is the documentation for the [Prometheus Java client library](https://github.com/prometheus/client_java) version 1.0.0 and higher.
5+
This is the documentation for the
6+
[Prometheus Java client library](https://github.com/prometheus/client_java)
7+
version 1.0.0 and higher.
68

79
The main new features of the 1.0.0 release are:
810

@@ -28,7 +30,7 @@ synchronization. See Javadoc comments in
2830
**More Info**
2931

3032
The Grafana Labs Blog has a post
31-
[Introducing the Prometheus Java Client 1.0.0](https://grafana.com/blog/2023/09/27/introducing-the-prometheus-java-client-1.0.0/)
33+
[Introducing the Prometheus Java Client 1.0.0](https://grafana.com/blog/2023/09/27/introducing-the-prometheus-java-client-1.0.0/) <!-- editorconfig-checker-disable-line -->
3234
with a good overview of the release.
3335

3436
There will also be a presentation at the [PromCon](https://promcon.io) conference on 29 Sep 2023.
@@ -41,9 +43,12 @@ Updating to the 1.0.0 version is a breaking change. However, there's a
4143
`prometheus-metrics-simpleclient-bridge` module available that allows you to use your existing
4244
simpleclient 0.16.0 metrics with the new 1.0.0 `PrometheusRegistry`.
4345
So you don't need to upgrade your instrumentation code, you can keep using your existing metrics.
44-
See the [compatibility > simpleclient](https://prometheus.github.io/client_java/migration/simpleclient/) in the menu on the left.
46+
See the
47+
[compatibility > simpleclient](https://prometheus.github.io/client_java/migration/simpleclient/)
48+
in the menu on the left.
4549

46-
The pre 1.0.0 code is now maintained on the [simpleclient](https://github.com/prometheus/client_java/tree/simpleclient) feature branch.
50+
The pre 1.0.0 code is now maintained on the
51+
[simpleclient](https://github.com/prometheus/client_java/tree/simpleclient) feature branch.
4752

4853
Not all `simpleclient` modules from 0.16.0 are included in the initial 1.0.0 release.
4954
Over the next couple of weeks we will work on porting the remaining modules,

docs/content/config/config.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ The properties file is searched in the following locations:
3636

3737
## Metrics Properties
3838

39+
<!-- editorconfig-checker-disable -->
3940
| Name | Javadoc | Note |
4041
| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
4142
| io.prometheus.metrics.exemplarsEnabled | [Counter.Builder.withExemplars()](</client_java/api/io/prometheus/metrics/core/metrics/Counter.Builder.html#withExemplars()>) | (1) (2) |
@@ -51,6 +52,7 @@ The properties file is searched in the following locations:
5152
| io.prometheus.metrics.summaryQuantileErrors | [Summary.Builder.quantile(double, double)](</client_java/api/io/prometheus/metrics/core/metrics/Summary.Builder.html#quantile(double,double)>) | (5) |
5253
| io.prometheus.metrics.summaryMaxAgeSeconds | [Summary.Builder.maxAgeSeconds()](</client_java/api/io/prometheus/metrics/core/metrics/Summary.Builder.html#maxAgeSeconds(long)>) | |
5354
| io.prometheus.metrics.summaryNumberOfAgeBuckets | [Summary.Builder.numberOfAgeBuckets()](</client_java/api/io/prometheus/metrics/core/metrics/Summary.Builder.html#numberOfAgeBuckets(int)>) | |
55+
<!-- editorconfig-checker-enable -->
5456

5557
**Notes**
5658

@@ -82,29 +84,35 @@ This works for all Metrics properties.
8284

8385
## Exemplar Properties
8486

87+
<!-- editorconfig-checker-disable -->
8588
| Name | Javadoc | Note |
8689
| -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
8790
| io.prometheus.exemplars.minRetentionPeriodSeconds | [ExemplarsProperties.getMinRetentionPeriodSeconds()](</client_java/api/io/prometheus/metrics/config/ExemplarsProperties.html#getMinRetentionPeriodSeconds()>) | |
8891
| io.prometheus.exemplars.maxRetentionPeriodSeconds | [ExemplarsProperties.getMaxRetentionPeriodSeconds()](</client_java/api/io/prometheus/metrics/config/ExemplarsProperties.html#getMaxRetentionPeriodSeconds()>) | |
8992
| io.prometheus.exemplars.sampleIntervalMilliseconds | [ExemplarsProperties.getSampleIntervalMilliseconds()](</client_java/api/io/prometheus/metrics/config/ExemplarsProperties.html#getSampleIntervalMilliseconds()>) | |
93+
<!-- editorconfig-checker-enable -->
9094

9195
## Exporter Properties
9296

97+
<!-- editorconfig-checker-disable -->
9398
| Name | Javadoc | Note |
9499
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
95100
| io.prometheus.exporter.includeCreatedTimestamps | [ExporterProperties.getIncludeCreatedTimestamps()](</client_java/api/io/prometheus/metrics/config/ExporterProperties.html#getIncludeCreatedTimestamps()>) | (1) |
96101
| io.prometheus.exporter.exemplarsOnAllMetricTypes | [ExporterProperties.getExemplarsOnAllMetricTypes()](</client_java/api/io/prometheus/metrics/config/ExporterProperties.html#getExemplarsOnAllMetricTypes()>) | (1) |
102+
<!-- editorconfig-checker-enable -->
97103

98104
(1) Boolean value, `true` or `false`. Default see Javadoc.
99105

100106
## Exporter Filter Properties
101107

108+
<!-- editorconfig-checker-disable -->
102109
| Name | Javadoc | Note |
103110
| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
104111
| io.prometheus.exporter.filter.metricNameMustBeEqualTo | [ExporterFilterProperties.getAllowedMetricNames()](</client_java/api/io/prometheus/metrics/config/ExporterFilterProperties.html#getAllowedMetricNames()>) | (1) |
105112
| io.prometheus.exporter.filter.metricNameMustNotBeEqualTo | [ExporterFilterProperties.getExcludedMetricNames()](</client_java/api/io/prometheus/metrics/config/ExporterFilterProperties.html#getExcludedMetricNames()>) | (2) |
106113
| io.prometheus.exporter.filter.metricNameMustStartWith | [ExporterFilterProperties.getAllowedMetricNamePrefixes()](</client_java/api/io/prometheus/metrics/config/ExporterFilterProperties.html#getAllowedMetricNamePrefixes()>) | (3) |
107114
| io.prometheus.exporter.filter.metricNameMustNotStartWith | [ExporterFilterProperties.getExcludedMetricNamePrefixes()](</client_java/api/io/prometheus/metrics/config/ExporterFilterProperties.html#getExcludedMetricNamePrefixes()>) | (4) |
115+
<!-- editorconfig-checker-enable -->
108116

109117
(1) Comma sparated list of allowed metric names. Only these metrics will be exposed.<br/>
110118
(2) Comma sparated list of excluded metric names. These metrics will not be exposed.<br/>
@@ -113,12 +121,15 @@ This works for all Metrics properties.
113121

114122
## Exporter HTTPServer Properties
115123

124+
<!-- editorconfig-checker-disable -->
116125
| Name | Javadoc | Note |
117126
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ---- |
118127
| io.prometheus.exporter.httpServer.port | [HTTPServer.Builder.port()](</client_java/api/io/prometheus/metrics/exporter/httpserver/HTTPServer.Builder.html#port(int)>) | |
128+
<!-- editorconfig-checker-enable -->
119129

120130
## Exporter OpenTelemetry Properties
121131

132+
<!-- editorconfig-checker-disable -->
122133
| Name | Javadoc | Note |
123134
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
124135
| io.prometheus.exporter.opentelemetry.protocol | [OpenTelemetryExporter.Builder.protocol()](</client_java/api/io/prometheus/metrics/exporter/opentelemetry/OpenTelemetryExporter.Builder.html#protocol(java.lang.String)>) | (1) |
@@ -131,6 +142,7 @@ This works for all Metrics properties.
131142
| io.prometheus.exporter.opentelemetry.serviceInstanceId | [OpenTelemetryExporter.Builder.serviceInstanceId()](</client_java/api/io/prometheus/metrics/exporter/opentelemetry/OpenTelemetryExporter.Builder.html#serviceInstanceId(java.lang.String)>) | |
132143
| io.prometheus.exporter.opentelemetry.serviceVersion | [OpenTelemetryExporter.Builder.serviceVersion()](</client_java/api/io/prometheus/metrics/exporter/opentelemetry/OpenTelemetryExporter.Builder.html#serviceVersion(java.lang.String)>) | |
133144
| io.prometheus.exporter.opentelemetry.resourceAttributes | [OpenTelemetryExporter.Builder.resourceAttributes()](</client_java/api/io/prometheus/metrics/exporter/opentelemetry/OpenTelemetryExporter.Builder.html#resourceAttribute(java.lang.String,java.lang.String)>) | (3) |
145+
<!-- editorconfig-checker-enable -->
134146

135147
(1) Protocol can be `grpc` or `http/protobuf`.<br>
136148
(2) Format: `key1=value1,key2=value2`<br>
@@ -143,8 +155,10 @@ See Javadoc for details.
143155

144156
## Exporter PushGateway Properties
145157

158+
<!-- editorconfig-checker-disable -->
146159
| Name | Javadoc | Note |
147160
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
148161
| io.prometheus.exporter.pushgateway.address | [PushGateway.Builder.address()](</client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.Builder.html#address(java.lang.String)>) | |
149162
| io.prometheus.exporter.pushgateway.scheme | [PushGateway.Builder.scheme()](</client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.Builder.html#scheme(java.lang.String)>) | |
150163
| io.prometheus.exporter.pushgateway.job | [PushGateway.Builder.job()](</client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.Builder.html#job(java.lang.String)>) | |
164+
<!-- editorconfig-checker-enable -->

docs/content/exporters/formats.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@ Moreover, gzip encoding is supported for each of these formats.
1313

1414
## Scraping with a Prometheus server
1515

16-
The Prometheus server sends an `Accept` header to specify which format is requested. By default, the Prometheus server will scrape OpenMetrics text format with gzip encoding. If the Prometheus server is started with `--enable-feature=native-histograms`, it will scrape Prometheus protobuf format instead.
16+
The Prometheus server sends an `Accept` header to specify which format is requested. By default, the
17+
Prometheus server will scrape OpenMetrics text format with gzip encoding. If the Prometheus server
18+
is started with `--enable-feature=native-histograms`, it will scrape Prometheus protobuf format
19+
instead.
1720

1821
## Viewing with a Web Browser
1922

20-
If you view the `/metrics` endpoint with your Web browser you will see Prometheus text format. For quick debugging of the other formats, exporters provide a `debug` URL parameter:
23+
If you view the `/metrics` endpoint with your Web browser you will see Prometheus text format. For
24+
quick debugging of the other formats, exporters provide a `debug` URL parameter:
2125

2226
- `/metrics?debug=openmetrics`: View OpenMetrics text format.
2327
- `/metrics?debug=text`: View Prometheus text format.

docs/content/exporters/pushgateway.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ The `PushGatewayTestApp` in `integration-tests/it-pushgateway` has a complete ex
115115
## Configuration Properties
116116

117117
The [PushGateway](/client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.html) supports a couple of properties that can be configured at runtime.
118-
See [config](../config/config.md).
118+
See [config]({{< relref "../config/config.md" >}}).

docs/content/exporters/spring.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ Spring anyway. Maybe you want full support for all Prometheus metric types,
2626
or you want to use the new Prometheus native histograms.
2727

2828
The easiest way to use the Prometheus metrics library in Spring is to configure the
29-
[//]: editorconfig-checker-disable-next-line
30-
[PrometheusMetricsServlet](/client_java/api/io/prometheus/metrics/exporter/servlet/jakarta/PrometheusMetricsServlet.html)
29+
[PrometheusMetricsServlet](/client_java/api/io/prometheus/metrics/exporter/servlet/jakarta/PrometheusMetricsServlet.html) <!-- editorconfig-checker-disable-line -->
3130
to expose metrics.
3231

3332
Dependencies:
@@ -77,8 +76,7 @@ public class DemoApplication {
7776
```
7877

7978
The important part are the last three lines: They configure the
80-
[//]: # editorconfig-checker-disable-next-line
81-
[PrometheusMetricsServlet](/client_java/api/io/prometheus/metrics/exporter/servlet/jakarta/PrometheusMetricsServlet.html)
79+
[PrometheusMetricsServlet](/client_java/api/io/prometheus/metrics/exporter/servlet/jakarta/PrometheusMetricsServlet.html) <!-- editorconfig-checker-disable-line -->
8280
to expose metrics on `/metrics`:
8381

8482
```java

docs/content/getting-started/callbacks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Callbacks
33
weight: 5
44
---
55

6-
The section on [metric types](../metric-types) showed how to use metrics that actively maintain their state.
6+
The section on [metric types]({{< relref "metric-types.md" >}}) showed how to use metrics that actively maintain their state.
77

88
This section shows how to create callback-based metrics, i.e. metrics that invoke a callback
99
at scrape time to get the current values.

docs/content/getting-started/metric-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ most important options:
117117
See Javadoc
118118
for [Histogram.Builder](/client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html)
119119
for a complete list of options. Some options can be configured at runtime,
120-
see [config](../../config/config).
120+
see [config]({{< relref "../config/config.md" >}}).
121121

122122
Histograms and summaries are both used for observing distributions. Therefore, the both implement
123123
the `DistributionDataPoint` interface. Using the `DistributionDataPoint` interface directly gives
@@ -195,7 +195,7 @@ the precise values (error 0.0) with almost no memory overhead.
195195
Quantile values are calculated based on a 5 minutes moving time window. The default time window can
196196
be changed with `maxAgeSeconds()` and `numberOfAgeBuckets()`.
197197

198-
Some options can be configured at runtime, see [config](../../config/config).
198+
Some options can be configured at runtime, see [config]({{< relref "../config/config.md" >}}).
199199

200200
In general you should prefer histograms over summaries. The Prometheus query language has a
201201
function [histogram_quantile()](https://prometheus.io/docs/prometheus/latest/querying/functions/#histogram_quantile)

docs/content/getting-started/performance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ native representation, but not both.
5555
You can either configure this in code for each histogram by
5656
calling [classicOnly()](</client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html#classicOnly()>)
5757
or [nativeOnly()](</client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html#nativeOnly()>),
58-
or you use the corresponding [config options](../../config/config/).
58+
or you use the corresponding [config options]({{< relref "../config/config.md" >}}).
5959

6060
One way to do this is with system properties in the command line when you start your application
6161

docs/content/getting-started/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ standalone HTTP server.
5555
{{< hint type=note >}}
5656

5757
If you do not use the protobuf exposition format, you can
58-
[exclude](../../exporters/formats#exclude-protobuf-exposition-format)
58+
[exclude]({{< relref "quickstart.md#exclude-protobuf-exposition-format" >}})
5959
it from the dependencies.
6060

6161
{{< /hint >}}

docs/content/migration/simpleclient.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ used in Spring, Lombok, and so on. So naming the method `builder()` makes the Pr
113113
broader Java ecosystem.
114114

115115
If you are using the low level `Collector` API directly, you should have a look at the new callback metric types,
116-
see [/getting-started/callbacks/](../../getting-started/callbacks/). Chances are good that the new callback metrics have
116+
see [/getting-started/callbacks/]({{< relref "../getting-started/callbacks.md" >}}). Chances are good that the new callback metrics have
117117
an easier way to achieve what you need than the old 0.16.0 code.
118118

119119
## JVM Metrics
@@ -132,7 +132,7 @@ JvmMetrics.builder().register();
132132
```
133133

134134
A full list of the available JVM metrics can be found
135-
on [/instrumentation/jvm](../../instrumentation/jvm/).
135+
on [/instrumentation/jvm]({{< relref "../instrumentation/jvm.md" >}}).
136136

137137
Most JVM metric names remained the same, except for a few cases where the old 0.16.0 metric names
138138
were not compliant with the [OpenMetrics](https://openmetrics.io) specification. OpenMetrics

0 commit comments

Comments
 (0)