Skip to content

Commit f08dab8

Browse files
authored
fix gh pages, add super linter (#1338)
Signed-off-by: Gregor Zeitlinger <[email protected]>
1 parent 8f75de4 commit f08dab8

File tree

290 files changed

+171271
-7905
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

290 files changed

+171271
-7905
lines changed

.editorconfig

+10
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,15 @@ root = true
44
max_line_length = 100
55
indent_size = 2
66

7+
[{version-rules.xml,maven-wrapper.properties,checkstyle.xml,docker-compose.yaml,docker-compose.yml,Dockerfile,example_target_info.json,mise.toml,mise.lock,mvnm,mvnw.cmd,generate-protobuf.sh,super-linter.env,.gitleaksignore}]
8+
max_line_length = 200
9+
10+
[{grafana-dashboard-*.json,.editorconfig}]
11+
max_line_length = 300
12+
713
[pom.xml]
14+
max_line_length = 110
15+
16+
[*.py]
17+
# checked by black
818
indent_size = 4

.github/dependabot.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
---
12
version: 2
23
updates:
34
- package-ecosystem: "github-actions"
45
directory: "/"
56
schedule:
67
interval: weekly
78
- package-ecosystem: maven
8-
# excluding simpleclient_archive from the update is not possible, only includes are supported
9-
# when we use includes, we run into https://github.com/dependabot/dependabot-core/issues/10415 -
9+
# excluding simpleclient_archive from the update is not possible,
10+
# only includes are supported
11+
# when we use includes,
12+
# we run into https://github.com/dependabot/dependabot-core/issues/10415
1013
# even if we limit to 1 PR at a time
1114
# therefore we just rename pom.xml in simpleclient_archive for now
1215
# if this becomes a problem, we can move to renovate

.github/super-linter.env

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FILTER_REGEX_EXCLUDE=mvnw|src/main/generated/.*|docs/themes/.*|keystore.pkcs12|.*.java|prometheus-metrics-exporter-opentelemetry-shaded/pom.xml
2+
IGNORE_GITIGNORED_FILES=true
3+
JAVA_FILE_NAME=google_checks.xml
4+
# disable kubernetes linter - complains about resource limits, etc
5+
VALIDATE_CHECKOV=false
6+
VALIDATE_CSS=false
7+
VALIDATE_CSS_PRETTIER=false
8+
VALIDATE_DOCKERFILE_HADOLINT=false
9+
VALIDATE_GIT_COMMITLINT=false
10+
# done by maven
11+
VALIDATE_GOOGLE_JAVA_FORMAT=false
12+
# times out
13+
VALIDATE_GO_MODULES=false
14+
VALIDATE_HTML=false
15+
# done by checkstyle
16+
VALIDATE_JAVA=false
17+
# contradicting with prettier
18+
VALIDATE_JAVASCRIPT_STANDARD=false
19+
# we have many duplicate code in our codebase for demo purposes
20+
VALIDATE_JSCPD=false
21+
VALIDATE_PYTHON_PYLINT=false
22+
23+
FIX_ENV=true
24+
FIX_GO=true
25+
FIX_JAVASCRIPT_PRETTIER=true
26+
FIX_JSON=true
27+
FIX_JSONC=true
28+
FIX_JSONC_PRETTIER=true
29+
FIX_JSON_PRETTIER=true
30+
FIX_MARKDOWN=true
31+
FIX_MARKDOWN_PRETTIER=true
32+
FIX_PYTHON_BLACK=true
33+
FIX_SHELL_SHFMT=true
34+
FIX_YAML_PRETTIER=true

.github/workflows/acceptance-tests.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
---
12
name: OpenTelemetry Acceptance Tests
23

34
on:
45
push:
5-
branches: [ "main" ]
6+
branches: ["main"]
67
pull_request:
7-
branches: [ "main" ]
8+
branches: ["main"]
89

910
permissions: {}
1011

.github/workflows/build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
---
12
name: Build
23

34
on:
45
push:
5-
branches: [ "main" ]
6+
branches: ["main"]
67
pull_request:
7-
branches: [ "main" ]
8+
branches: ["main"]
89

910
permissions: {}
1011

@@ -25,4 +26,3 @@ jobs:
2526
${{ runner.os }}-maven-
2627
- name: Run the Maven verify phase
2728
run: mise run ci
28-

.github/workflows/github-pages.yaml

+6-8
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ on:
1313

1414
permissions: {}
1515

16-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
17-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
16+
# Allow only one concurrent deployment, skipping runs queued between
17+
# the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow
19+
# these production deployments to complete.
1820
concurrency:
1921
group: "pages"
2022
cancel-in-progress: false
@@ -32,22 +34,18 @@ jobs:
3234
- uses: actions/checkout@v4
3335
with:
3436
persist-credentials: false
35-
fetch-tags: 'true'
37+
fetch-tags: "true"
3638
fetch-depth: 0
3739
- uses: jdx/mise-action@7a111ead46986ccad89a74ad013ba2a7c08c9e67 # v2.1.1
3840
with:
39-
cache: 'false'
41+
cache: "false"
4042
- name: Prepare GitHub Pages
4143
run: mise run prepare-gh-pages
42-
with:
43-
permissions: block
4444
- name: Setup Pages
4545
id: pages
4646
uses: actions/configure-pages@v5
4747
- name: Build GitHub Pages
4848
run: mise run build-gh-pages
49-
with:
50-
permissions: block
5149
- name: Upload artifact
5250
uses: actions/upload-pages-artifact@v3
5351
with:

.github/workflows/lint.yml renamed to .github/workflows/lint-rest.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ permissions: {}
77

88
jobs:
99
acceptance-tests:
10-
permissions: {}
1110
runs-on: ubuntu-24.04
1211
steps:
1312
- name: Check out
@@ -16,5 +15,4 @@ jobs:
1615
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1716
- uses: jdx/mise-action@7a111ead46986ccad89a74ad013ba2a7c08c9e67 # v2.1.1
1817
- name: Lint
19-
run: mise run lint-all
20-
18+
run: mise run lint-rest

.github/workflows/native-tests.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
---
12
name: GraalVM Native Tests
23

34
on:
45
push:
5-
branches: [ "main" ]
6+
branches: ["main"]
67
pull_request:
7-
branches: [ "main" ]
8+
branches: ["main"]
89

910
permissions: {}
1011

.github/workflows/release.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Deploy to Maven Central
23

34
on:
@@ -14,10 +15,10 @@ jobs:
1415
steps:
1516
- name: Debug gpg key - remove after debugging
1617
env:
17-
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
18+
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
1819
run: |
19-
echo "$GPG_SIGNING_KEY" | wc -c
20-
echo "$GPG_SIGNING_KEY" | gpg --batch --import-options import-show --import
20+
echo "${#GPG_SIGNING_KEY}"
21+
echo "${GPG_SIGNING_KEY}" | gpg --batch --import-options import-show --import
2122
- name: Checkout Plugin Repository
2223
uses: actions/checkout@v4
2324
with:
@@ -37,8 +38,8 @@ jobs:
3738
- name: Set up Apache Maven Central
3839
uses: actions/setup-java@v4
3940
with:
40-
distribution: 'temurin'
41-
java-version: '17'
41+
distribution: "temurin"
42+
java-version: "17"
4243
server-id: ossrh
4344
server-username: MAVEN_USERNAME
4445
server-password: MAVEN_CENTRAL_TOKEN

.github/workflows/super-linter.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Lint
3+
4+
on:
5+
pull_request:
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-24.04
10+
11+
permissions:
12+
contents: read
13+
packages: read
14+
# To report GitHub Actions status checks
15+
statuses: write
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
persist-credentials: false
22+
fetch-depth: 0
23+
24+
- name: Load super-linter configuration
25+
run: grep -v '^#' .github/super-linter.env | grep -v 'FIX_' >> "$GITHUB_ENV"
26+
27+
- name: Super-linter
28+
uses: super-linter/super-linter@4e8a7c2bf106c4c766c816b35ec612638dc9b6b2 # v7.3.0
29+
env:
30+
# To report GitHub Actions status checks
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ dependency-reduced-pom.xml
1818
**/.classpath
1919
**.project
2020
**/.settings/
21+
docs/public
22+
.lycheecache

.gitleaksignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/tmp/lint/integration-tests/it-pushgateway/src/test/resources/pushgateway-ssl.yaml:private-key:36
2+
/github/workspace/integration-tests/it-pushgateway/src/test/resources/pushgateway-ssl.yaml:private-key:36

.yaml-lint.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extends: relaxed
2+
3+
rules:
4+
line-length:
5+
max: 120

CODE_OF_CONDUCT.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Prometheus Community Code of Conduct
22

3-
Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md).
3+
Prometheus follows the
4+
[CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md).

CONTRIBUTING.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,28 @@
22

33
Prometheus uses GitHub to manage reviews of pull requests.
44

5-
* If you have a trivial fix or improvement, go ahead and create a pull request,
5+
- If you have a trivial fix or improvement, go ahead and create a pull request,
66
addressing (with `@...`) the maintainer of this repository (see
77
[MAINTAINERS.md](MAINTAINERS.md)) in the description of the pull request.
88

9-
* If you plan to do something more involved, first discuss your ideas
9+
- If you plan to do something more involved, first discuss your ideas
1010
on our [mailing list](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers).
1111
This will avoid unnecessary work and surely give you and us a good deal
1212
of inspiration.
1313

1414
## Formatting
1515

16-
This repository uses [Google Java Format](https://github.com/google/google-java-format) to format the code.
16+
This repository uses [Google Java Format](https://github.com/google/google-java-format) to format
17+
the code.
1718

1819
Run `./mvnw spotless:apply` to format the code (only changed files) before committing.
1920

2021
## Running Tests
2122

2223
If you're getting errors when running tests:
2324

24-
- Make sure that the IDE uses only the "Maven Shade" dependency of "prometheus-metrics-exposition-formats" and the "prometheus-metrics-tracer*" dependencies.
25+
- Make sure that the IDE uses only the "Maven Shade" dependency of "
26+
prometheus-metrics-exposition-formats" and the "prometheus-metrics-tracer\*" dependencies.
2527

2628
### Avoid failures while running tests
2729

@@ -30,7 +32,8 @@ If you're getting errors when running tests:
3032
- Use `-Dcheckstyle.skip=true` to skip the checkstyle check during development.
3133
- Use `-Dwarnings=-nowarn` to skip the warnings during development.
3234

33-
Combine all with `./mvnw test -DskipTests=true -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn`.
35+
Combine all with
36+
`./mvnw test -DskipTests=true -Dspotless.check.skip=true -Dcoverage.skip=true -Dcheckstyle.skip=true -Dwarnings=-nowarn`. # editorconfig-checker-disable-line
3437

3538
## Updating the Protobuf Java Classes
3639

MAINTAINERS.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
* Fabian Stäber <[email protected]> @fstab
2-
* Doug Hoard <[email protected]> @dhoard
3-
* Tom Wilkie <[email protected]> @tomwilkie
4-
* Gregor Zeitlinger <[email protected]> @zeitlinger
1+
# Maintainers
2+
3+
- Fabian Stäber <[email protected]> @fstab
4+
- Doug Hoard <[email protected]> @dhoard
5+
- Tom Wilkie <[email protected]> @tomwilkie
6+
- Gregor Zeitlinger <[email protected]> @zeitlinger

README.md

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
# Prometheus Java Metrics Library
22

3-
[![Build](https://github.com/prometheus/client_java/actions/workflows/build.yml/badge.svg)](https://github.com/prometheus/client_java/actions/workflows/build.yml) <a href="#"><img src="https://img.shields.io/badge/JDK%20compatibility-8+-blue.svg" alt="java 8+"></a> <a href="#"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="Apache 2.0"></a>
3+
[![Build](https://github.com/prometheus/client_java/actions/workflows/build.yml/badge.svg)](https://github.com/prometheus/client_java/actions/workflows/build.yml) <a href="#"><img src="https://img.shields.io/badge/JDK%20compatibility-8+-blue.svg" alt="java 8+"></a> <a href="#"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="Apache 2.0"></a> # editorconfig-checker-disable-line
44

5-
# Documentation
5+
## Documentation
66

77
[https://prometheus.github.io/client_java](https://prometheus.github.io/client_java)
88

9-
# Contributing and community
9+
## Contributing and community
1010

11-
See [CONTRIBUTING.md](CONTRIBUTING.md) and the [community section](http://prometheus.io/community/) of the Prometheus homepage.
11+
See [CONTRIBUTING.md](CONTRIBUTING.md) and the [community section](http://prometheus.io/community/)
12+
of the Prometheus homepage.
1213

13-
The Prometheus Java community is present on the [CNCF Slack](https://cloud-native.slack.com) on `#prometheus-java`, and we have a fortnightly community call in the [Prometheus public calendar](https://prometheus.io/community/).
14+
The Prometheus Java community is present on the [CNCF Slack](https://cloud-native.slack.com) on
15+
`#prometheus-java`, and we have a fortnightly community call in
16+
the [Prometheus public calendar](https://prometheus.io/community/).
1417

15-
# Previous Releases
18+
## Previous Releases
1619

17-
The source code for 0.16.0 and older is on the [simpleclient](https://github.com/prometheus/client_java/tree/simpleclient) branch.
20+
The source code for 0.16.0 and older is on
21+
the [simpleclient](https://github.com/prometheus/client_java/tree/simpleclient) branch.
1822

19-
# License
23+
## License
2024

2125
Apache License 2.0, see [LICENSE](LICENSE).

RELEASING.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## Create a Release
1+
# Create a Release
22

3-
1. Go to https://github.com/prometheus/client_java/releases/new
3+
1. Go to <https://github.com/prometheus/client_java/releases/new>
44
2. Click on "Choose a tag", enter the tag name (e.g. `v0.1.0`), and click "Create a new tag".
5-
3. Click on "Generate release notes" to auto-generate the release notes based on the commits since the last release.
5+
3. Click on "Generate release notes" to auto-generate the release notes based on the commits since
6+
the last release.
67
4. Click on "Publish release".

benchmarks/README.md

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,37 @@
1-
Benchmarks
2-
----------
1+
# Benchmarks
32

43
## How to Run
54

6-
```
5+
```shell
76
java -jar ./benchmarks/target/benchmarks.jar
87
```
98

109
Run only one specific benchmark:
1110

12-
```
11+
```shell
1312
java -jar ./benchmarks/target/benchmarks.jar CounterBenchmark
1413
```
1514

1615
## Results
1716

1817
See Javadoc of the benchmark classes:
1918

20-
* [CounterBenchmark](https://github.com/prometheus/client_java/blob/1.0.x/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/CounterBenchmark.java)
21-
* [HistogramBenchmark](https://github.com/prometheus/client_java/blob/1.0.x/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/HistogramBenchmark.java)
19+
- [CounterBenchmark](https://github.com/prometheus/client_java/blob/1.0.x/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/CounterBenchmark.java) <!-- editorconfig-checker-disable-line -->
20+
- [HistogramBenchmark](https://github.com/prometheus/client_java/blob/1.0.x/benchmarks/src/main/java/io/prometheus/metrics/benchmarks/HistogramBenchmark.java) <!-- editorconfig-checker-disable-line -->
2221

2322
## What Prometheus Java client optimizes for
2423

2524
concurrent updates of metrics in multi-threaded applications.
26-
If your application is single-threaded and uses only one processor core, your application isn't performance critical anyway.
27-
If your application is designed to use all available processor cores for maximum performance, then you want a metric library that doesn't slow your application down.
28-
Prometheus client Java metrics support concurrent updates and scrapes. This shows in benchmarks with multiple threads recording data in shared metrics.
25+
If your application is single-threaded and uses only one processor core, your application isn't
26+
performance critical anyway.
27+
If your application is designed to use all available processor cores for maximum performance, then
28+
you want a metric library that doesn't slow your
29+
application down.
30+
Prometheus client Java metrics support concurrent updates and scrapes. This shows in benchmarks with
31+
multiple threads recording data in shared
32+
metrics.
2933

3034
## Archive
3135

32-
The `src/main/archive/` directory contains the old benchmarks from 0.16.0 and earlier. It will be removed as soon as all benchmarks are ported to the 1.0.0 release.
36+
The `src/main/archive/` directory contains the old benchmarks from 0.16.0 and earlier. It will be
37+
removed as soon as all benchmarks are ported to the 1.0.0 release.

0 commit comments

Comments
 (0)