Skip to content

Commit f78d3be

Browse files
committed
fix: use block markdownlint suppression for MD036, fix tracking for github: backend
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
1 parent efee923 commit f78d3be

6 files changed

Lines changed: 52 additions & 47 deletions

File tree

.github/renovate-tracked-deps.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@
167167
"actionlint",
168168
"cargo:https://github.com/grafana/flint",
169169
"editorconfig-checker",
170+
"github:google/google-java-format",
170171
"go:github.com/gohugoio/hugo",
171172
"go:github.com/grafana/oats",
172173
"java",
@@ -179,8 +180,7 @@
179180
"pipx:ruff",
180181
"protoc",
181182
"shellcheck",
182-
"shfmt",
183-
"ubi:google/google-java-format"
183+
"shfmt"
184184
]
185185
},
186186
"mvnw": {

docs/content/_index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ The main new features of the 1.0.0 release are:
1313
- **Runtime configuration:** Configure metrics, exporters, and more at runtime using a properties
1414
file or system properties.
1515

16-
<!-- markdownlint-disable-next-line MD036 -->
16+
<!-- markdownlint-disable MD036 -->
17+
1718
**Documentation and Examples**
1819

1920
In addition to this documentation page we created an
2021
[examples/](https://github.com/prometheus/client_java/tree/main/examples) directory with end-to-end
2122
scenarios (Docker compose) illustrating new features.
2223

23-
<!-- markdownlint-disable-next-line MD036 -->
2424
**Performance Benchmarks**
2525

2626
Initial performance benchmarks are looking great: All core metric types (including native
@@ -29,7 +29,6 @@ that utilizes all processor cores in parallel the metrics library will not intro
2929
synchronization. See Javadoc comments in
3030
[benchmarks/](https://github.com/prometheus/client_java/tree/main/benchmarks) for benchmark results.
3131

32-
<!-- markdownlint-disable-next-line MD036 -->
3332
**More Info**
3433

3534
The Grafana Labs Blog has a post
@@ -40,9 +39,10 @@ There will also be a presentation at the [PromCon](https://promcon.io) conferenc
4039
Tune in to the live stream on [https://promcon.io](https://promcon.io)
4140
or watch the recording on YouTube.
4241

43-
<!-- markdownlint-disable-next-line MD036 -->
4442
**For users of the 0.16.0 version and older**
4543

44+
<!-- markdownlint-enable MD036 -->
45+
4646
Updating to the 1.0.0 version is a breaking change. However, there's a
4747
`prometheus-metrics-simpleclient-bridge` module available that allows you to use your existing
4848
simpleclient 0.16.0 metrics with the new 1.0.0 `PrometheusRegistry`.

docs/content/config/config.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,12 @@ When the same property is defined in multiple sources, the following precedence
9292

9393
<!-- editorconfig-checker-enable -->
9494

95-
<!-- markdownlint-disable-next-line MD036 -->
95+
<!-- markdownlint-disable MD036 -->
96+
9697
**Notes**
9798

99+
<!-- markdownlint-enable MD036 -->
100+
98101
(1) _withExemplars()_ and _withoutExemplars()_ are available for all metric types,
99102
not just for counters<br>
100103
(2) Boolean value. Format: `property=true` or `property=false`.<br>

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ The default bucket boundaries are designed for measuring request durations in se
127127
use cases, you may want to define custom bucket boundaries. The histogram builder provides three
128128
methods for this:
129129

130-
<!-- markdownlint-disable-next-line MD036 -->
130+
<!-- markdownlint-disable MD036 -->
131+
131132
**1. Arbitrary Custom Boundaries**
132133

133134
Use `classicUpperBounds(...)` to specify arbitrary bucket boundaries:
@@ -140,7 +141,6 @@ Histogram responseSize = Histogram.builder()
140141
.register();
141142
```
142143

143-
<!-- markdownlint-disable-next-line MD036 -->
144144
**2. Linear Boundaries**
145145

146146
Use `classicLinearUpperBounds(start, width, count)` for equal-width buckets:
@@ -153,9 +153,10 @@ Histogram queueSize = Histogram.builder()
153153
.register();
154154
```
155155

156-
<!-- markdownlint-disable-next-line MD036 -->
157156
**3. Exponential Boundaries**
158157

158+
<!-- markdownlint-enable MD036 -->
159+
159160
Use `classicExponentialUpperBounds(start, factor, count)` for exponential growth:
160161

161162
```java

integration-tests/it-exporter/it-exporter-test/src/test/java/io/prometheus/metrics/it/exporter/test/DuplicateMetricsIT.java

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ void testDuplicateMetricsInPrometheusTextFormat() throws IOException {
2525

2626
String expected =
2727
"""
28-
# HELP active_connections Active connections
29-
# TYPE active_connections gauge
30-
active_connections{pool="primary",type="read"} 30.0
31-
active_connections{pool="replica",type="write"} 10.0
32-
active_connections{protocol="http",region="us-east"} 42.0
33-
active_connections{protocol="http",region="us-west"} 38.0
34-
active_connections{protocol="https",region="eu-west"} 55.0
35-
# HELP http_requests_total Total HTTP requests by status
36-
# TYPE http_requests_total counter
37-
http_requests_total{endpoint="/api",status="error"} 5.0
38-
http_requests_total{endpoint="/health",status="error"} 2.0
39-
http_requests_total{method="GET",status="success"} 150.0
40-
http_requests_total{method="POST",status="success"} 45.0
41-
# HELP unique_metric_bytes_total A unique metric for reference
42-
# TYPE unique_metric_bytes_total counter
43-
unique_metric_bytes_total 1024.0
44-
""";
28+
# HELP active_connections Active connections
29+
# TYPE active_connections gauge
30+
active_connections{pool="primary",type="read"} 30.0
31+
active_connections{pool="replica",type="write"} 10.0
32+
active_connections{protocol="http",region="us-east"} 42.0
33+
active_connections{protocol="http",region="us-west"} 38.0
34+
active_connections{protocol="https",region="eu-west"} 55.0
35+
# HELP http_requests_total Total HTTP requests by status
36+
# TYPE http_requests_total counter
37+
http_requests_total{endpoint="/api",status="error"} 5.0
38+
http_requests_total{endpoint="/health",status="error"} 2.0
39+
http_requests_total{method="GET",status="success"} 150.0
40+
http_requests_total{method="POST",status="success"} 45.0
41+
# HELP unique_metric_bytes_total A unique metric for reference
42+
# TYPE unique_metric_bytes_total counter
43+
unique_metric_bytes_total 1024.0
44+
""";
4545

4646
assertThat(response.stringBody()).isEqualTo(expected);
4747
}
@@ -59,25 +59,25 @@ void testDuplicateMetricsInOpenMetricsTextFormat() throws IOException {
5959
// OpenMetrics format should have UNIT for unique_metric_bytes (base name without _total)
6060
String expected =
6161
"""
62-
# TYPE active_connections gauge
63-
# HELP active_connections Active connections
64-
active_connections{pool="primary",type="read"} 30.0
65-
active_connections{pool="replica",type="write"} 10.0
66-
active_connections{protocol="http",region="us-east"} 42.0
67-
active_connections{protocol="http",region="us-west"} 38.0
68-
active_connections{protocol="https",region="eu-west"} 55.0
69-
# TYPE http_requests counter
70-
# HELP http_requests Total HTTP requests by status
71-
http_requests_total{endpoint="/api",status="error"} 5.0
72-
http_requests_total{endpoint="/health",status="error"} 2.0
73-
http_requests_total{method="GET",status="success"} 150.0
74-
http_requests_total{method="POST",status="success"} 45.0
75-
# TYPE unique_metric_bytes counter
76-
# UNIT unique_metric_bytes bytes
77-
# HELP unique_metric_bytes A unique metric for reference
78-
unique_metric_bytes_total 1024.0
79-
# EOF
80-
""";
62+
# TYPE active_connections gauge
63+
# HELP active_connections Active connections
64+
active_connections{pool="primary",type="read"} 30.0
65+
active_connections{pool="replica",type="write"} 10.0
66+
active_connections{protocol="http",region="us-east"} 42.0
67+
active_connections{protocol="http",region="us-west"} 38.0
68+
active_connections{protocol="https",region="eu-west"} 55.0
69+
# TYPE http_requests counter
70+
# HELP http_requests Total HTTP requests by status
71+
http_requests_total{endpoint="/api",status="error"} 5.0
72+
http_requests_total{endpoint="/health",status="error"} 2.0
73+
http_requests_total{method="GET",status="success"} 150.0
74+
http_requests_total{method="POST",status="success"} 45.0
75+
# TYPE unique_metric_bytes counter
76+
# UNIT unique_metric_bytes bytes
77+
# HELP unique_metric_bytes A unique metric for reference
78+
unique_metric_bytes_total 1024.0
79+
# EOF
80+
""";
8181

8282
assertThat(response.stringBody()).isEqualTo(expected);
8383
}

prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics/CounterTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ void testTotalStrippedFromName(String name) {
122122
new PrometheusProtobufWriterImpl().convert(counter.collect(), EscapingScheme.ALLOW_UTF8);
123123
assertThat(ProtobufUtil.shortDebugString(protobufData))
124124
.matches(
125-
"^name: \"my_counter_seconds_total\" type: COUNTER metric \\{ counter \\{ value: 0.0 created_timestamp \\{ seconds: \\d+ nanos: \\d+ } } }$");
125+
"^name: \"my_counter_seconds_total\" type: COUNTER metric \\{ counter \\{ value: 0.0"
126+
+ " created_timestamp \\{ seconds: \\d+ nanos: \\d+ } } }$");
126127
}
127128

128129
@Test

0 commit comments

Comments
 (0)