Skip to content

Commit 3892f74

Browse files
committed
lint
Signed-off-by: Gregor Zeitlinger <[email protected]>
1 parent 6906efc commit 3892f74

File tree

10 files changed

+58
-38
lines changed

10 files changed

+58
-38
lines changed

docs/content/exporters/formats.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ quick debugging of the other formats, exporters provide a `debug` URL parameter:
2525

2626
- `/metrics?debug=openmetrics`: View OpenMetrics text format.
2727
- `/metrics?debug=text`: View Prometheus text format.
28-
- `/metrics?debug=prometheus-protobuf`: View a text representation of the Prometheus protobuf format.
28+
- `/metrics?debug=prometheus-protobuf`: View a text representation of the Prometheus protobuf
29+
format.
2930

3031
## Exclude protobuf exposition format
3132

docs/content/exporters/httpserver.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ with [defaultHandler()](</client_java/api/io/prometheus/metrics/exporter/httpser
2828

2929
## Authentication and HTTPS
3030

31-
- [authenticator()](</client_java/api/io/prometheus/metrics/exporter/httpserver/HTTPServer.Builder.html#authenticator(com.sun.net.httpserver.Authenticator)>)
31+
- [authenticator()](</client_java/api/io/prometheus/metrics/exporter/httpserver/HTTPServer.Builder.html#authenticator(com.sun.net.httpserver.Authenticator)>) <!-- editorconfig-checker-disable-line -->
3232
is for configuring authentication.
33-
- [httpsConfigurator()](</client_java/api/io/prometheus/metrics/exporter/httpserver/HTTPServer.Builder.html#httpsConfigurator(com.sun.net.httpserver.HttpsConfigurator)>)
33+
- [httpsConfigurator()](</client_java/api/io/prometheus/metrics/exporter/httpserver/HTTPServer.Builder.html#httpsConfigurator(com.sun.net.httpserver.HttpsConfigurator)>) <!-- editorconfig-checker-disable-line -->
3434
is for configuring HTTPS.
3535

36-
You can find an example of authentication and SSL in the [jmx_exporter](https://github.com/prometheus/jmx_exporter). <!-- editorconfig-checker-disable-line -->
36+
You can find an example of authentication and SSL in the
37+
[jmx_exporter](https://github.com/prometheus/jmx_exporter).
3738

3839
## Properties
3940

docs/content/exporters/pushgateway.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ public class ExampleBatchJob {
7474

7575
## Basic Auth
7676

77-
The [PushGateway](/client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.html) supports basic authentication.
77+
The [PushGateway](/client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.html)
78+
supports basic authentication.
7879

7980
```java
8081
PushGateway pushGateway = PushGateway.builder()
@@ -87,7 +88,8 @@ The `PushGatewayTestApp` in `integration-tests/it-pushgateway` has a complete ex
8788

8889
## Bearer token
8990

90-
The [PushGateway](/client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.html) supports Bearer token authentication.
91+
The [PushGateway](/client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.html)
92+
supports Bearer token authentication.
9193

9294
```java
9395
PushGateway pushGateway = PushGateway.builder()

docs/content/getting-started/callbacks.md

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

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

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

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ the Prometheus server.
8484
format and ingest both, the classic and the native flavor. This is great for migrating from
8585
classic histograms to native histograms.
8686

87-
See [examples/example-native-histogram](https://github.com/prometheus/client_java/tree/1.0.x/examples/example-native-histogram) for an example.
87+
See [examples/example-native-histogram](https://github.com/prometheus/client_java/tree/1.0.x/examples/example-native-histogram) <!-- editorconfig-checker-disable-line -->
88+
for an example.
8889

8990
```java
9091
Histogram duration = Histogram.builder()

docs/content/getting-started/performance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ native representation, but not both.
5454

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()>) <!-- editorconfig-checker-disable-line -->
57-
or [nativeOnly()](</client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html#nativeOnly()>),
57+
or [nativeOnly()](</client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html#nativeOnly()>), <!-- editorconfig-checker-disable-line -->
5858
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

docs/content/getting-started/quickstart.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ it from the dependencies.
6363
## Dependency management
6464

6565
A Bill of Material
66-
([BOM](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#bill-of-materials-bom-poms))
66+
([BOM](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#bill-of-materials-bom-poms)) <!-- editorconfig-checker-disable-line -->
6767
ensures that versions of dependencies (including transitive ones) are aligned.
6868
This is especially important when using Spring Boot, which manages some of the dependencies of the
6969
project.
@@ -175,7 +175,8 @@ public class App {
175175
.port(9400)
176176
.buildAndStart();
177177

178-
System.out.println("HTTPServer listening on port http://localhost:" + server.getPort() + "/metrics");
178+
System.out.println("HTTPServer listening on port http://localhost:" +
179+
server.getPort() + "/metrics");
179180

180181
Thread.currentThread().join(); // sleep forever
181182
}

docs/content/getting-started/registry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Counter eventsTotal1 = Counter.builder()
7575
Counter eventsTotal2 = Counter.builder()
7676
.name("events_total")
7777
.help("Total number of events")
78-
.register(); // <-- IllegalArgumentException, because a metric with that name is already registered
78+
.register(); // IllegalArgumentException, because a metric with that name is already registered
7979
```
8080

8181
## Unregistering a Metric

docs/content/instrumentation/jvm.md

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ register all JVM metrics, you can register each of these classes individually ra
4444
## JVM Buffer Pool Metrics
4545

4646
JVM buffer pool metrics are provided by
47-
the [JvmBufferPoolMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmBufferPoolMetrics.html)
47+
the [JvmBufferPoolMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmBufferPoolMetrics.html) <!-- editorconfig-checker-disable-line -->
4848
class. The data is coming from
49-
the [BufferPoolMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/BufferPoolMXBean.html).
49+
the [BufferPoolMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/BufferPoolMXBean.html). <!-- editorconfig-checker-disable-line -->
5050
Example metrics:
5151

5252
```text
@@ -67,11 +67,12 @@ jvm_buffer_pool_used_bytes{pool="mapped"} 0.0
6767
## JVM Class Loading Metrics
6868

6969
JVM class loading metrics are provided by
70-
the [JvmClassLoadingMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmClassLoadingMetrics.html)
70+
the [JvmClassLoadingMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmClassLoadingMetrics.html) <!-- editorconfig-checker-disable-line -->
7171
class. The data is coming from
72-
the [ClassLoadingMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/ClassLoadingMXBean.html).
72+
the [ClassLoadingMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/ClassLoadingMXBean.html). <!-- editorconfig-checker-disable-line -->
7373
Example metrics:
7474

75+
<!-- editorconfig-checker-disable -->
7576
```text
7677
# HELP jvm_classes_currently_loaded The number of classes that are currently loaded in the JVM
7778
# TYPE jvm_classes_currently_loaded gauge
@@ -83,27 +84,30 @@ jvm_classes_loaded_total 1109.0
8384
# TYPE jvm_classes_unloaded_total counter
8485
jvm_classes_unloaded_total 0.0
8586
```
87+
<!-- editorconfig-checker-enable -->
8688

8789
## JVM Compilation Metrics
8890

8991
JVM compilation metrics are provided by
90-
the [JvmCompilationMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmCompilationMetrics.html)
92+
the [JvmCompilationMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmCompilationMetrics.html) <!-- editorconfig-checker-disable-line -->
9193
class. The data is coming from
92-
the [CompilationMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/CompilationMXBean.html).
94+
the [CompilationMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/CompilationMXBean.html). <!-- editorconfig-checker-disable-line -->
9395
Example metrics:
9496

97+
<!-- editorconfig-checker-disable -->
9598
```text
9699
# HELP jvm_compilation_time_seconds_total The total time in seconds taken for HotSpot class compilation
97100
# TYPE jvm_compilation_time_seconds_total counter
98101
jvm_compilation_time_seconds_total 0.152
99102
```
103+
<!-- editorconfig-checker-enable -->
100104

101105
## JVM Garbage Collector Metrics
102106

103107
JVM garbage collector metrics are provided by
104-
the [JvmGarbageCollectorMetric](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmGarbageCollectorMetrics.html)
108+
the [JvmGarbageCollectorMetric](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmGarbageCollectorMetrics.html) <!-- editorconfig-checker-disable-line -->
105109
class. The data is coming from
106-
the [GarbageCollectorMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/GarbageCollectorMXBean.html).
110+
the [GarbageCollectorMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/GarbageCollectorMXBean.html). <!-- editorconfig-checker-disable-line -->
107111
Example metrics:
108112

109113
```text
@@ -118,13 +122,13 @@ jvm_gc_collection_seconds_sum{gc="PS Scavenge"} 0.0
118122
## JVM Memory Metrics
119123

120124
JVM memory metrics are provided by
121-
the [JvmMemoryMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmMemoryMetrics.html)
125+
the [JvmMemoryMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmMemoryMetrics.html) <!-- editorconfig-checker-disable-line -->
122126
class. The data is coming from
123-
the [MemoryMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/MemoryMXBean.html)
124-
and
125-
the [MemoryPoolMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html).
127+
the [MemoryMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/MemoryMXBean.html) <!-- editorconfig-checker-disable-line -->
128+
and the [MemoryPoolMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html). <!-- editorconfig-checker-disable-line -->
126129
Example metrics:
127130

131+
<!-- editorconfig-checker-disable -->
128132
```text
129133
# HELP jvm_memory_committed_bytes Committed (bytes) of a given JVM memory area.
130134
# TYPE jvm_memory_committed_bytes gauge
@@ -198,17 +202,19 @@ jvm_memory_pool_used_bytes{pool="PS Survivor Space"} 0.0
198202
jvm_memory_used_bytes{area="heap"} 9051232.0
199203
jvm_memory_used_bytes{area="nonheap"} 1.1490688E7
200204
```
205+
<!-- editorconfig-checker-enable -->
206+
201207

202208
## JVM Memory Pool Allocation Metrics
203209

204210
JVM memory pool allocation metrics are provided by
205-
the [JvmMemoryPoolAllocationMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmMemoryPoolAllocationMetrics.html)
211+
the [JvmMemoryPoolAllocationMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmMemoryPoolAllocationMetrics.html) <!-- editorconfig-checker-disable-line -->
206212
class. The data is obtained by adding
207-
a [NotificationListener](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/javax/management/NotificationListener.html)
208-
to
209-
the [GarbageCollectorMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/GarbageCollectorMXBean.html).
213+
a [NotificationListener](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/javax/management/NotificationListener.html) <!-- editorconfig-checker-disable-line -->
214+
to the [GarbageCollectorMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/GarbageCollectorMXBean.html). <!-- editorconfig-checker-disable-line -->
210215
Example metrics:
211216

217+
<!-- editorconfig-checker-disable -->
212218
```text
213219
# HELP jvm_memory_pool_allocated_bytes_total Total bytes allocated in a given JVM memory pool. Only updated after GC, not continuously.
214220
# TYPE jvm_memory_pool_allocated_bytes_total counter
@@ -219,28 +225,32 @@ jvm_memory_pool_allocated_bytes_total{pool="PS Eden Space"} 1.79232824E8
219225
jvm_memory_pool_allocated_bytes_total{pool="PS Old Gen"} 1428888.0
220226
jvm_memory_pool_allocated_bytes_total{pool="PS Survivor Space"} 4115280.0
221227
```
228+
<!-- editorconfig-checker-enable -->
222229

223230
## JVM Runtime Info Metric
224231

225232
The JVM runtime info metric is provided by
226-
the [JvmRuntimeInfoMetric](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmRuntimeInfoMetric.html)
233+
the [JvmRuntimeInfoMetric](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmRuntimeInfoMetric.html) <!-- editorconfig-checker-disable-line -->
227234
class. The data is obtained via system properties and will not change throughout the lifetime of the
228235
application. Example metric:
229236

237+
<!-- editorconfig-checker-disable -->
230238
```text
231239
# TYPE jvm_runtime info
232240
# HELP jvm_runtime JVM runtime info
233241
jvm_runtime_info{runtime="OpenJDK Runtime Environment",vendor="Oracle Corporation",version="1.8.0_382-b05"} 1
234242
```
243+
<!-- editorconfig-checker-enable -->
235244

236245
## JVM Thread Metrics
237246

238247
JVM thread metrics are provided by
239-
the [JvmThreadsMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmThreadsMetrics.html)
248+
the [JvmThreadsMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/JvmThreadsMetrics.html) <!-- editorconfig-checker-disable-line -->
240249
class. The data is coming from
241-
the [ThreadMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/ThreadMXBean.html).
250+
the [ThreadMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/ThreadMXBean.html). <!-- editorconfig-checker-disable-line -->
242251
Example metrics:
243252

253+
<!-- editorconfig-checker-disable -->
244254
```text
245255
# HELP jvm_threads_current Current thread count of a JVM
246256
# TYPE jvm_threads_current gauge
@@ -270,19 +280,20 @@ jvm_threads_state{state="TIMED_WAITING"} 2.0
270280
jvm_threads_state{state="UNKNOWN"} 0.0
271281
jvm_threads_state{state="WAITING"} 3.0
272282
```
283+
<!-- editorconfig-checker-enable -->
273284

274285
## Process Metrics
275286

276287
Process metrics are provided by
277288
the [ProcessMetrics](/client_java/api/io/prometheus/metrics/instrumentation/jvm/ProcessMetrics.html)
278289
class. The data is coming from
279-
the [OperatingSystemMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/OperatingSystemMXBean.html),
280-
the [RuntimeMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/RuntimeMXBean.html),
290+
the [OperatingSystemMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/OperatingSystemMXBean.html), <!-- editorconfig-checker-disable-line -->
291+
the [RuntimeMXBean](https://docs.oracle.com/en/java/javase/21/docs/api/java.management/java/lang/management/RuntimeMXBean.html), <!-- editorconfig-checker-disable-line -->
281292
and from the `/proc/self/status` file on Linux. The metrics with prefix `process_` are not specific
282293
to Java, but should be provided by every Prometheus client library,
283294
see [Process Metrics](https://prometheus.io/docs/instrumenting/writing_clientlibs/#process-metrics)
284295
in the
285-
Prometheus [writing client libraries](https://prometheus.io/docs/instrumenting/writing_clientlibs/#process-metrics)
296+
Prometheus [writing client libraries](https://prometheus.io/docs/instrumenting/writing_clientlibs/#process-metrics) <!-- editorconfig-checker-disable-line -->
286297
documentation. Example metrics:
287298

288299
```text

docs/content/internals/model.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ The illustration below shows the internal architecture of the Prometheus Java cl
1010
## prometheus-metrics-core
1111

1212
This is the user facing metrics library, implementing the core metric types,
13-
like [Counter](/client_java/api/io/prometheus/metrics/core/metrics/Counter.html), [Gauge](/client_java/api/io/prometheus/metrics/core/metrics/Gauge.html) [Histogram](/client_java/api/io/prometheus/metrics/core/metrics/Histogram.html),
13+
like [Counter](/client_java/api/io/prometheus/metrics/core/metrics/Counter.html),
14+
[Gauge](/client_java/api/io/prometheus/metrics/core/metrics/Gauge.html)
15+
[Histogram](/client_java/api/io/prometheus/metrics/core/metrics/Histogram.html),
1416
and so on.
1517

1618
All metric types implement
@@ -23,14 +25,14 @@ method to produce snapshots.
2325

2426
The model is an internal library, implementing read-only immutable snapshots. These snapshots are
2527
returned by
26-
the [Collector.collect()](</client_java/api/io/prometheus/metrics/model/registry/Collector.html#collect()>)
28+
the [Collector.collect()](</client_java/api/io/prometheus/metrics/model/registry/Collector.html#collect()>) <!-- editorconfig-checker-disable-line -->
2729
method.
2830

2931
There is no need for users to use `prometheus-metrics-model` directly. Users should use the API
3032
provided by `prometheus-metrics-core`, which includes the core metrics as well as callback metrics.
3133

32-
However, maintainers of third-party metrics libraries might want to use `prometheus-metrics-model` if
33-
they want to add Prometheus exposition formats to their metrics library.
34+
However, maintainers of third-party metrics libraries might want to use `prometheus-metrics-model`
35+
if they want to add Prometheus exposition formats to their metrics library.
3436

3537
## Exporters and exposition formats
3638

0 commit comments

Comments
 (0)