Skip to content

Commit 7490dc3

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

File tree

12 files changed

+83
-78
lines changed

12 files changed

+83
-78
lines changed

.github/super-linter.env

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,28 @@ JAVA_FILE_NAME=google_checks.xml
55
VALIDATE_CHECKOV=false
66
VALIDATE_DOCKERFILE_HADOLINT=false
77
VALIDATE_GIT_COMMITLINT=false
8+
# done by maven
9+
VALIDATE_GOOGLE_JAVA_FORMAT=false
810
# times out
911
VALIDATE_GO_MODULES=false
12+
# done by checkstyle
13+
VALIDATE_JAVA=false
1014
# contradicting with prettier
1115
VALIDATE_JAVASCRIPT_STANDARD=false
1216
# we have many duplicate code in our codebase for demo purposes
1317
VALIDATE_JSCPD=false
18+
VALIDATE_PYTHON_PYINK=false
1419

15-
FILTER_REGEX_EXCLUDE=src/main/generated/.*|docs/themes/.*
20+
# FILTER_REGEX_EXCLUDE=src/main/generated/.*|docs/themes/.*
1621

1722
FIX_ENV=true
1823
FIX_GO=true
19-
FIX_GOOGLE_JAVA_FORMAT=true
2024
FIX_JAVASCRIPT_PRETTIER=true
2125
FIX_JSON=true
2226
FIX_JSONC=true
2327
FIX_JSONC_PRETTIER=true
2428
FIX_JSON_PRETTIER=true
2529
FIX_MARKDOWN=true
2630
FIX_MARKDOWN_PRETTIER=true
27-
FIX_PYTHON_BLACK=true
28-
FIX_PYTHON_ISORT=true
29-
FIX_PYTHON_PYINK=true
3031
FIX_SHELL_SHFMT=true
3132
FIX_YAML_PRETTIER=true

docs/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ ln -s ../api ./docs/static/client_java/api
3737

3838
## Update Geekdocs
3939

40-
The docs use the [Geekdocs](https://geekdocs.de/) theme. The theme is checked in to Github in the `./docs/themes/hugo-geekdoc/` folder. To update [Geekdocs](https://geekdocs.de/), remove the current folder and create a new one with the latest [release](https://github.com/thegeeklab/hugo-geekdoc/releases). There are no local modifications in `./docs/themes/hugo-geekdoc/`.
40+
The docs use the [Geekdocs](https://geekdocs.de/) theme. The theme is checked in to Github in the
41+
`./docs/themes/hugo-geekdoc/` folder. To update [Geekdocs](https://geekdocs.de/), remove the current
42+
folder and create a new one with the
43+
latest [release](https://github.com/thegeeklab/hugo-geekdoc/releases). There are no local
44+
modifications in `./docs/themes/hugo-geekdoc/`.
4145

4246
## Notes
4347

@@ -50,4 +54,5 @@ mkdir -p themes/hugo-geekdoc/
5054
curl -L https://github.com/thegeeklab/hugo-geekdoc/releases/download/v0.41.1/hugo-geekdoc.tar.gz | tar -xz -C themes/hugo-geekdoc/ --strip-components=1
5155
```
5256

53-
Create the initial `hugo.toml` file as described in [https://geekdocs.de/usage/getting-started/](https://geekdocs.de/usage/getting-started/).
57+
Create the initial `hugo.toml` file as described
58+
in [https://geekdocs.de/usage/getting-started/](https://geekdocs.de/usage/getting-started/).

docs/content/_index.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +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
11+
- **Runtime configuration:** Configure metrics, exporters, and more at runtime using a properties
1212
file or system properties.
1313

1414
**Documentation and Examples**
1515

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
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
1717
scenarios (Docker compose) illustrating new features.
1818

1919
**Performance Benchmarks**
2020

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
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
2525
[benchmarks/](https://github.com/prometheus/client_java/tree/main/benchmarks) for benchmark results.
2626

2727
**More Info**
2828

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
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
3030
good overview of the release.
3131

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)
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)
3434
or watch the recording on YouTube.
3535

3636
**For users of the 0.16.0 version and older**
3737

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.
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.
4242
See the [compatibility > simpleclient](https://prometheus.github.io/client_java/migration/simpleclient/) in the menu on the left.
4343

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

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,
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,
4848
starting with `pushgateway` and the Servlet filter.

docs/content/config/config.md

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

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

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

2828
## Location of the Properties File
2929

3030
The properties file is searched in the following locations:
3131

32-
- `/prometheus.properties` in the classpath. This is for bundling a properties file
32+
- `/prometheus.properties` in the classpath. This is for bundling a properties file
3333
with your application.
3434
- System property `-Dprometheus.config=/path/to/prometheus.properties`.
3535
- Environment variable `PROMETHEUS_CONFIG=/path/to/prometheus.properties`.
3636

3737
## Metrics Properties
3838

3939
| Name | Javadoc | Note |
40-
|-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
40+
| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
4141
| io.prometheus.metrics.exemplarsEnabled | [Counter.Builder.withExemplars()](</client_java/api/io/prometheus/metrics/core/metrics/Counter.Builder.html#withExemplars()>) | (1) (2) |
4242
| io.prometheus.metrics.histogramNativeOnly | [Histogram.Builder.nativeOnly()](</client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html#nativeOnly()>) | (2) |
4343
| io.prometheus.metrics.histogramClassicOnly | [Histogram.Builder.classicOnly()](</client_java/api/io/prometheus/metrics/core/metrics/Histogram.Builder.html#classicOnly()>) | (2) |
@@ -54,16 +54,16 @@ The properties file is searched in the following locations:
5454

5555
**Notes**
5656

57-
(1) _withExemplars()_ and _withoutExemplars()_ are available for all metric types,
58-
not just for counters<br>
57+
(1) _withExemplars()_ and _withoutExemplars()_ are available for all metric types,
58+
not just for counters<br>
5959
(2) Boolean value. Format: `property=true` or `property=false`.<br>
6060
(3) Comma-separated list. Example: `.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10`.<br>
6161
(4) Comma-separated list. Example: `0.5, 0.95, 0.99`.<br>
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`.
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`.
6464

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:
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:
6767
Let's say you have a histogram named `latency_seconds`.
6868

6969
```
@@ -83,15 +83,15 @@ This works for all Metrics properties.
8383
## Exemplar Properties
8484

8585
| Name | Javadoc | Note |
86-
|----------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|------|
86+
| -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
8787
| io.prometheus.exemplars.minRetentionPeriodSeconds | [ExemplarsProperties.getMinRetentionPeriodSeconds()](</client_java/api/io/prometheus/metrics/config/ExemplarsProperties.html#getMinRetentionPeriodSeconds()>) | |
8888
| io.prometheus.exemplars.maxRetentionPeriodSeconds | [ExemplarsProperties.getMaxRetentionPeriodSeconds()](</client_java/api/io/prometheus/metrics/config/ExemplarsProperties.html#getMaxRetentionPeriodSeconds()>) | |
8989
| io.prometheus.exemplars.sampleIntervalMilliseconds | [ExemplarsProperties.getSampleIntervalMilliseconds()](</client_java/api/io/prometheus/metrics/config/ExemplarsProperties.html#getSampleIntervalMilliseconds()>) | |
9090

9191
## Exporter Properties
9292

9393
| Name | Javadoc | Note |
94-
|--------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|------|
94+
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
9595
| io.prometheus.exporter.includeCreatedTimestamps | [ExporterProperties.getIncludeCreatedTimestamps()](</client_java/api/io/prometheus/metrics/config/ExporterProperties.html#getIncludeCreatedTimestamps()>) | (1) |
9696
| io.prometheus.exporter.exemplarsOnAllMetricTypes | [ExporterProperties.getExemplarsOnAllMetricTypes()](</client_java/api/io/prometheus/metrics/config/ExporterProperties.html#getExemplarsOnAllMetricTypes()>) | (1) |
9797

@@ -100,7 +100,7 @@ This works for all Metrics properties.
100100
## Exporter Filter Properties
101101

102102
| Name | Javadoc | Note |
103-
|----------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------|
103+
| -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
104104
| io.prometheus.exporter.filter.metricNameMustBeEqualTo | [ExporterFilterProperties.getAllowedMetricNames()](</client_java/api/io/prometheus/metrics/config/ExporterFilterProperties.html#getAllowedMetricNames()>) | (1) |
105105
| io.prometheus.exporter.filter.metricNameMustNotBeEqualTo | [ExporterFilterProperties.getExcludedMetricNames()](</client_java/api/io/prometheus/metrics/config/ExporterFilterProperties.html#getExcludedMetricNames()>) | (2) |
106106
| io.prometheus.exporter.filter.metricNameMustStartWith | [ExporterFilterProperties.getAllowedMetricNamePrefixes()](</client_java/api/io/prometheus/metrics/config/ExporterFilterProperties.html#getAllowedMetricNamePrefixes()>) | (3) |
@@ -114,13 +114,13 @@ This works for all Metrics properties.
114114
## Exporter HTTPServer Properties
115115

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

120120
## Exporter OpenTelemetry Properties
121121

122122
| Name | Javadoc | Note |
123-
|---------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------|
123+
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
124124
| io.prometheus.exporter.opentelemetry.protocol | [OpenTelemetryExporter.Builder.protocol()](</client_java/api/io/prometheus/metrics/exporter/opentelemetry/OpenTelemetryExporter.Builder.html#protocol(java.lang.String)>) | (1) |
125125
| io.prometheus.exporter.opentelemetry.endpoint | [OpenTelemetryExporter.Builder.endpoint()](</client_java/api/io/prometheus/metrics/exporter/opentelemetry/OpenTelemetryExporter.Builder.html#endpoint(java.lang.String)>) | |
126126
| 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) |
@@ -136,15 +136,15 @@ This works for all Metrics properties.
136136
(2) Format: `key1=value1,key2=value2`<br>
137137
(3) Format: `key1=value1,key2=value2`
138138

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.
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.
142142
See Javadoc for details.
143143

144144
## Exporter PushGateway Properties
145145

146146
| Name | Javadoc | Note |
147-
|--------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|------|
147+
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- | ---- |
148148
| io.prometheus.exporter.pushgateway.address | [PushGateway.Builder.address()](</client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.Builder.html#address(java.lang.String)>) | |
149149
| io.prometheus.exporter.pushgateway.scheme | [PushGateway.Builder.scheme()](</client_java/api/io/prometheus/metrics/exporter/pushgateway/PushGateway.Builder.html#scheme(java.lang.String)>) | |
150150
| 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ 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,
9+
- `/metrics?name[]=jvm_threads_current&name[]=jvm_threads_daemon` will query two metrics,
1010
`jvm_threads_current` and `jvm_threads_daemon`.
1111

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

1515
```yaml

docs/content/exporters/httpserver.md

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

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

99
```java
@@ -12,7 +12,7 @@ HTTPServer server = HTTPServer.builder()
1212
.buildAndStart();
1313
```
1414

15-
By default, `HTTPServer` binds to any IP address, you can change this with
15+
By default, `HTTPServer` binds to any IP address, you can change this with
1616
[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)>).
1717

1818
`HTTPServer` is configured with three endpoints:

0 commit comments

Comments
 (0)