Skip to content

Commit 32f6596

Browse files
committed
format
Signed-off-by: Gregor Zeitlinger <[email protected]>
1 parent 13c87ca commit 32f6596

File tree

23 files changed

+421
-152
lines changed

23 files changed

+421
-152
lines changed

.github/workflows/lint-rest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Acceptance Tests
33

44
on: [pull_request]
55

6-
permissions: { }
6+
permissions: {}
77

88
jobs:
99
acceptance-tests:

.github/workflows/native-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88
branches: ["main"]
99

10-
permissions: { }
10+
permissions: {}
1111

1212
jobs:
1313
native-tests:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
deploy:
1111
if: ${{ github.repository == 'prometheus/client_java' }}
1212
runs-on: ubuntu-24.04
13-
permissions: { }
13+
permissions: {}
1414

1515
steps:
1616
- name: Debug gpg key - remove after debugging

docs/content/_index.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,41 @@ The main new features of the 1.0.0 release are:
88

99
- **Prometheus native histograms:** Support for the new Prometheus histogram type.
1010
- **OpenTelemetry Exporter:** Push metrics in OTLP format to an OpenTelemetry endpoint.
11-
- **Runtime configuration:** Configure metrics, exporters, and more at runtime using a properties file or system properties.
11+
- **Runtime configuration:** Configure metrics, exporters, and more at runtime using a properties
12+
file or system properties.
1213

1314
**Documentation and Examples**
1415

15-
In addition to this documentation page we created an [examples/](https://github.com/prometheus/client_java/tree/main/examples) directory with end-to-end scenarios (Docker compose) illustrating new features.
16+
In addition to this documentation page we created an [examples/](https://github.com/prometheus/client_java/tree/main/examples) directory with end-to-end
17+
scenarios (Docker compose) illustrating new features.
1618

1719
**Performance Benchmarks**
1820

19-
Initial performance benchmarks are looking great: All core metric types (including native histograms) allow concurrent updates, so if you instrument a performance critical Web service that utilizes all processor cores in parallel the metrics library will not introduce additional synchronization. See Javadoc comments in [benchmarks/](https://github.com/prometheus/client_java/tree/main/benchmarks) for benchmark results.
21+
Initial performance benchmarks are looking great: All core metric types (including native
22+
histograms) allow concurrent updates, so if you instrument a performance critical Web service
23+
that utilizes all processor cores in parallel the metrics library will not introduce additional
24+
synchronization. See Javadoc comments in
25+
[benchmarks/](https://github.com/prometheus/client_java/tree/main/benchmarks) for benchmark results.
2026

2127
**More Info**
2228

23-
The Grafana Labs Blog has a post [Introducing the Prometheus Java Client 1.0.0](https://grafana.com/blog/2023/09/27/introducing-the-prometheus-java-client-1.0.0/) with a good overview of the release.
29+
The Grafana Labs Blog has a post [Introducing the Prometheus Java Client 1.0.0](https://grafana.com/blog/2023/09/27/introducing-the-prometheus-java-client-1.0.0/) with a
30+
good overview of the release.
2431

25-
There will also be a presentation at the [PromCon](https://promcon.io) conference on 29 Sep 2023. Tune in to the live stream on [https://promcon.io](https://promcon.io) or watch the recording on YouTube.
32+
There will also be a presentation at the [PromCon](https://promcon.io) conference on 29 Sep 2023.
33+
Tune in to the live stream on [https://promcon.io](https://promcon.io)
34+
or watch the recording on YouTube.
2635

2736
**For users of the 0.16.0 version and older**
2837

29-
Updating to the 1.0.0 version is a breaking change. However, there's a `prometheus-metrics-simpleclient-bridge` module available that allows you to use your existing simpleclient 0.16.0 metrics with the new 1.0.0 `PrometheusRegistry`. So you don't need to upgrade your instrumentation code, you can keep using your existing metrics. See the [compatibility > simpleclient](https://prometheus.github.io/client_java/migration/simpleclient/) in the menu on the left.
38+
Updating to the 1.0.0 version is a breaking change. However, there's a
39+
`prometheus-metrics-simpleclient-bridge` module available that allows you to use your existing
40+
simpleclient 0.16.0 metrics with the new 1.0.0 `PrometheusRegistry`.
41+
So you don't need to upgrade your instrumentation code, you can keep using your existing metrics.
42+
See the [compatibility > simpleclient](https://prometheus.github.io/client_java/migration/simpleclient/) in the menu on the left.
3043

3144
The pre 1.0.0 code is now maintained on the [simpleclient](https://github.com/prometheus/client_java/tree/simpleclient) feature branch.
3245

33-
Not all `simpleclient` modules from 0.16.0 are included in the initial 1.0.0 release. Over the next couple of weeks we will work on porting the remaining modules, starting with `pushgateway` and the Servlet filter.
46+
Not all `simpleclient` modules from 0.16.0 are included in the initial 1.0.0 release.
47+
Over the next couple of weeks we will work on porting the remaining modules,
48+
starting with `pushgateway` and the Servlet filter.

docs/content/config/config.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,26 @@ Example:
1818
io.prometheus.exporter.httpServer.port = 9401
1919
```
2020

21-
The property above changes the port for the [HTTPServer exporter]({{< relref "/exporters/httpserver.md" >}}) to _9401_.
21+
The property above changes the port for the
22+
[HTTPServer exporter]({{< relref "/exporters/httpserver.md" >}}) to _9401_.
2223

2324
- Properties file: Add the line above to the properties file.
24-
- System properties: Use the command line parameter `-Dio.prometheus.exporter.httpServer.port=9401` when starting your application.
25+
- System properties: Use the command line parameter `-Dio.prometheus.exporter.httpServer.port=9401`
26+
- when starting your application.
2527

2628
## Location of the Properties File
2729

2830
The properties file is searched in the following locations:
2931

30-
- `/prometheus.properties` in the classpath. This is for bundling a properties file with your application.
32+
- `/prometheus.properties` in the classpath. This is for bundling a properties file
33+
with your application.
3134
- System property `-Dprometheus.config=/path/to/prometheus.properties`.
3235
- Environment variable `PROMETHEUS_CONFIG=/path/to/prometheus.properties`.
3336

3437
## Metrics Properties
3538

3639
| Name | Javadoc | Note |
37-
| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
40+
|-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
3841
| io.prometheus.metrics.exemplarsEnabled | [Counter.Builder.withExemplars()](</client_java/api/io/prometheus/metrics/core/metrics/Counter.Builder.html#withExemplars()>) | (1) (2) |
3942
| io.prometheus.metrics.histogramNativeOnly | [Histogram.Builder.nativeOnly()](</client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html#nativeOnly()>) | (2) |
4043
| io.prometheus.metrics.histogramClassicOnly | [Histogram.Builder.classicOnly()](</client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html#classicOnly()>) | (2) |
@@ -51,13 +54,17 @@ The properties file is searched in the following locations:
5154

5255
**Notes**
5356

54-
(1) _withExemplars()_ and _withoutExemplars()_ are available for all metric types, not just for counters<br>
57+
(1) _withExemplars()_ and _withoutExemplars()_ are available for all metric types,
58+
not just for counters<br>
5559
(2) Boolean value. Format: `property=true` or `property=false`.<br>
5660
(3) Comma-separated list. Example: `.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10`.<br>
5761
(4) Comma-separated list. Example: `0.5, 0.95, 0.99`.<br>
58-
(5) Comma-separated list. If specified, the list must have the same length as `io.prometheus.metrics.summaryQuantiles`. Example: `0.01, 0.005, 0.005`.
62+
(5) Comma-separated list. If specified, the list must have the same length as
63+
`io.prometheus.metrics.summaryQuantiles`. Example: `0.01, 0.005, 0.005`.
5964

60-
There's one special feature about metric properties: You can set a property for one specific metric only by specifying the metric name. Example: Let's say you have a histogram named `latency_seconds`.
65+
There's one special feature about metric properties: You can set a property for one specific
66+
metric only by specifying the metric name. Example:
67+
Let's say you have a histogram named `latency_seconds`.
6168

6269
```
6370
io.prometheus.metrics.histogramClassicUpperBounds = 0.2, 0.4, 0.8, 1.0
@@ -76,15 +83,15 @@ This works for all Metrics properties.
7683
## Exemplar Properties
7784

7885
| Name | Javadoc | Note |
79-
| -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
86+
|----------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|------|
8087
| io.prometheus.exemplars.minRetentionPeriodSeconds | [ExemplarsProperties.getMinRetentionPeriodSeconds()](</client_java/api/io/prometheus/metrics/config/ExemplarsProperties.html#getMinRetentionPeriodSeconds()>) | |
8188
| io.prometheus.exemplars.maxRetentionPeriodSeconds | [ExemplarsProperties.getMaxRetentionPeriodSeconds()](</client_java/api/io/prometheus/metrics/config/ExemplarsProperties.html#getMaxRetentionPeriodSeconds()>) | |
8289
| io.prometheus.exemplars.sampleIntervalMilliseconds | [ExemplarsProperties.getSampleIntervalMilliseconds()](</client_java/api/io/prometheus/metrics/config/ExemplarsProperties.html#getSampleIntervalMilliseconds()>) | |
8390

8491
## Exporter Properties
8592

8693
| Name | Javadoc | Note |
87-
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
94+
|--------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|------|
8895
| io.prometheus.exporter.includeCreatedTimestamps | [ExporterProperties.getIncludeCreatedTimestamps()](</client_java/api/io/prometheus/metrics/config/ExporterProperties.html#getIncludeCreatedTimestamps()>) | (1) |
8996
| io.prometheus.exporter.exemplarsOnAllMetricTypes | [ExporterProperties.getExemplarsOnAllMetricTypes()](</client_java/api/io/prometheus/metrics/config/ExporterProperties.html#getExemplarsOnAllMetricTypes()>) | (1) |
9097

@@ -93,7 +100,7 @@ This works for all Metrics properties.
93100
## Exporter Filter Properties
94101

95102
| Name | Javadoc | Note |
96-
| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
103+
|----------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------|
97104
| io.prometheus.exporter.filter.metricNameMustBeEqualTo | [ExporterFilterProperties.getAllowedMetricNames()](</client_java/api/io/prometheus/metrics/config/ExporterFilterProperties.html#getAllowedMetricNames()>) | (1) |
98105
| io.prometheus.exporter.filter.metricNameMustNotBeEqualTo | [ExporterFilterProperties.getExcludedMetricNames()](</client_java/api/io/prometheus/metrics/config/ExporterFilterProperties.html#getExcludedMetricNames()>) | (2) |
99106
| io.prometheus.exporter.filter.metricNameMustStartWith | [ExporterFilterProperties.getAllowedMetricNamePrefixes()](</client_java/api/io/prometheus/metrics/config/ExporterFilterProperties.html#getAllowedMetricNamePrefixes()>) | (3) |
@@ -107,13 +114,13 @@ This works for all Metrics properties.
107114
## Exporter HTTPServer Properties
108115

109116
| Name | Javadoc | Note |
110-
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ---- |
117+
|----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|------|
111118
| io.prometheus.exporter.httpServer.port | [HTTPServer.Builder.port()](</client_java/api/io/prometheus/metrics/exporter/httpserver/HTTPServer.Builder.html#port(int)>) | |
112119

113120
## Exporter OpenTelemetry Properties
114121

115122
| Name | Javadoc | Note |
116-
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
123+
|---------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------|
117124
| io.prometheus.exporter.opentelemetry.protocol | [OpenTelemetryExporter.Builder.protocol()](</client_java/api/io/prometheus/metrics/exporter/opentelemetry/OpenTelemetryExporter.Builder.html#protocol(java.lang.String)>) | (1) |
118125
| io.prometheus.exporter.opentelemetry.endpoint | [OpenTelemetryExporter.Builder.endpoint()](</client_java/api/io/prometheus/metrics/exporter/opentelemetry/OpenTelemetryExporter.Builder.html#endpoint(java.lang.String)>) | |
119126
| io.prometheus.exporter.opentelemetry.headers | [OpenTelemetryExporter.Builder.headers()](</client_java/api/io/prometheus/metrics/exporter/opentelemetry/OpenTelemetryExporter.Builder.html#header(java.lang.String,java.lang.String)>) | (2) |
@@ -129,12 +136,15 @@ This works for all Metrics properties.
129136
(2) Format: `key1=value1,key2=value2`<br>
130137
(3) Format: `key1=value1,key2=value2`
131138

132-
Many of these attributes can alternatively be configured via OpenTelemetry environment variables, like `OTEL_EXPORTER_OTLP_ENDPOINT`. The Prometheus metrics library has support for OpenTelemetry environment variables. See Javadoc for details.
139+
Many of these attributes can alternatively be configured via OpenTelemetry environment variables,
140+
like `OTEL_EXPORTER_OTLP_ENDPOINT`.
141+
The Prometheus metrics library has support for OpenTelemetry environment variables.
142+
See Javadoc for details.
133143

134144
## Exporter PushGateway Properties
135145

136146
| Name | Javadoc | Note |
137-
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
147+
|--------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|------|
138148
| io.prometheus.exporter.pushgateway.address | [PushGateway.Builder.address()](</client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.Builder.html#address(java.lang.String)>) | |
139149
| io.prometheus.exporter.pushgateway.scheme | [PushGateway.Builder.scheme()](</client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.Builder.html#scheme(java.lang.String)>) | |
140150
| io.prometheus.exporter.pushgateway.job | [PushGateway.Builder.job()](</client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.Builder.html#job(java.lang.String)>) | |

docs/content/exporters/filter.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ weight: 2
66
All exporters support a `name[]` URL parameter for querying only specific metric names. Examples:
77

88
- `/metrics?name[]=jvm_threads_current` will query the metric named `jvm_threads_current`.
9-
- `/metrics?name[]=jvm_threads_current&name[]=jvm_threads_daemon` will query two metrics, `jvm_threads_current` and `jvm_threads_daemon`.
9+
- `/metrics?name[]=jvm_threads_current&name[]=jvm_threads_daemon` will query two metrics,
10+
`jvm_threads_current` and `jvm_threads_daemon`.
1011

11-
Add the following to the scape job configuration in `prometheus.yml` to make the Prometheus server send the `name[]` parameter:
12+
Add the following to the scape job configuration in `prometheus.yml`
13+
to make the Prometheus server send the `name[]` parameter:
1214

1315
```yaml
1416
params:

docs/content/exporters/httpserver.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ title: HTTPServer
33
weight: 3
44
---
55

6-
The `HTTPServer` is a standalone server for exposing a metric endpoint. A minimal example application for `HTTPServer` can be found in the [examples](https://github.com/prometheus/client_java/tree/1.0.x/examples) directory.
6+
The `HTTPServer` is a standalone server for exposing a metric endpoint. A minimal example
7+
application for `HTTPServer` can be found in the [examples](https://github.com/prometheus/client_java/tree/1.0.x/examples) directory.
78

89
```java
910
HTTPServer server = HTTPServer.builder()
1011
.port(9400)
1112
.buildAndStart();
1213
```
1314

14-
By default, `HTTPServer` binds to any IP address, you can change this with [hostname()](</client_java/api/io/prometheus/metrics/exporter/httpserver/HTTPServer.Builder.html#hostname(java.lang.String)>) or [inetAddress()](</client_java/api/io/prometheus/metrics/exporter/httpserver/HTTPServer.Builder.html#inetAddress(java.net.InetAddress)>).
15+
By default, `HTTPServer` binds to any IP address, you can change this with
16+
[hostname()](</client_java/api/io/prometheus/metrics/exporter/httpserver/HTTPServer.Builder.html#hostname(java.lang.String)>) or [inetAddress()](</client_java/api/io/prometheus/metrics/exporter/httpserver/HTTPServer.Builder.html#inetAddress(java.net.InetAddress)>).
1517

1618
`HTTPServer` is configured with three endpoints:
1719

docs/content/exporters/pushgateway.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,11 @@ PushGateway pushGateway = PushGateway.builder()
108108

109109
However, this requires that the JVM can validate the server certificate.
110110

111-
If you want to skip certificate verification, you need to provide your own [HttpConnectionFactory](/client_java/api/io/prometheus/metrics/exporter/pushgateway/HttpConnectionFactory.html).
111+
If you want to skip certificate verification, you need to provide your own
112+
[HttpConnectionFactory](/client_java/api/io/prometheus/metrics/exporter/pushgateway/HttpConnectionFactory.html).
112113
The `PushGatewayTestApp` in `integration-tests/it-pushgateway` has a complete example of this.
113114

114115
## Configuration Properties
115116

116-
The [PushGateway](/client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.html) supports a couple of properties that can be configured at runtime. See [config](../config/config.md).
117+
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).

0 commit comments

Comments
 (0)