Skip to content

Commit 2cf062e

Browse files
authored
Merge branch 'main' into dropwizard-apply-label-mapper-to-snapshot-metrics
2 parents 67f68c5 + 6c82338 commit 2cf062e

File tree

329 files changed

+174020
-9385
lines changed

Some content is hidden

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

329 files changed

+174020
-9385
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
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

Lines changed: 5 additions & 2 deletions
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/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# .github/release.yml
2+
3+
changelog:
4+
categories:
5+
- title: 🏕 Features
6+
labels:
7+
- "*"
8+
exclude:
9+
labels:
10+
- chore
11+
- dependencies
12+
- title: 🧹 Chore
13+
labels:
14+
- chore
15+
- title: 👒 Dependencies
16+
labels:
17+
- dependencies

.github/super-linter.env

Lines changed: 34 additions & 0 deletions
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|CODE_OF_CONDUCT.md
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
Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,18 @@
1+
---
12
name: OpenTelemetry Acceptance Tests
23

3-
on:
4-
push:
5-
branches: [ "main" ]
6-
pull_request:
7-
branches: [ "main" ]
4+
on: [pull_request]
5+
6+
permissions: {}
87

98
jobs:
109
acceptance-tests:
1110
runs-on: ubuntu-24.04
1211
steps:
13-
- uses: actions/checkout@v4
14-
- name: Check out oats
15-
uses: actions/checkout@v4
16-
with:
17-
repository: grafana/oats
18-
ref: v0.1.0
19-
path: oats
20-
- name: Set up JDK
21-
uses: actions/setup-java@v4
12+
- name: Check out
2213
with:
23-
java-version: 17
24-
distribution: temurin
25-
cache: 'maven'
26-
- name: Set up Go
27-
uses: actions/setup-go@v5
28-
with:
29-
go-version: '1.23'
30-
cache-dependency-path: oats/go.sum
31-
- name: Run the Maven verify phase
32-
run: |
33-
./mvnw clean install -DskipTests
14+
persist-credentials: false
15+
uses: actions/checkout@v4
16+
- uses: jdx/mise-action@c94f0bf9e520b150e34c017db785461f7e71c5fb # v2.1.1
3417
- name: Run acceptance tests
35-
run: ./scripts/run-acceptance-tests.sh
36-
- name: upload log file
37-
uses: actions/upload-artifact@v4
38-
if: failure()
39-
with:
40-
name: OATS logs
41-
path: oats/yaml/build/**/*.log
18+
run: mise run acceptance-test

.github/workflows/build.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1+
---
12
name: Build
23

3-
on:
4-
push:
5-
branches: [ "main" ]
6-
pull_request:
7-
branches: [ "main" ]
4+
on: [pull_request]
5+
6+
permissions: {}
87

98
jobs:
109
build:
1110
runs-on: ubuntu-24.04
1211
steps:
1312
- uses: actions/checkout@v4
14-
- name: Setup ASDF
15-
uses: equisoft-actions/with-asdf-vm@v2
13+
with:
14+
persist-credentials: false
15+
- uses: jdx/mise-action@c94f0bf9e520b150e34c017db785461f7e71c5fb # v2.1.1
1616
- name: Cache local Maven repository
1717
uses: actions/cache@v4
1818
with:
@@ -21,10 +21,4 @@ jobs:
2121
restore-keys: |
2222
${{ runner.os }}-maven-
2323
- name: Run the Maven verify phase
24-
env:
25-
PROTO_GENERATION: true
26-
REQUIRE_PROTO_UP_TO_DATE: true
27-
run: |
28-
mvn -v
29-
./mvnw clean install
30-
./mvnw javadoc:javadoc -P javadoc # just to check if javadoc is generated
24+
run: mise run ci

.github/workflows/github-pages.yaml

Lines changed: 17 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ on:
1111
# Allows you to run this workflow manually from the Actions tab
1212
workflow_dispatch:
1313

14-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15-
permissions:
16-
contents: read
17-
pages: write
18-
id-token: write
14+
permissions: {}
1915

20-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
21-
# 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.
2220
concurrency:
2321
group: "pages"
2422
cancel-in-progress: false
@@ -32,55 +30,34 @@ jobs:
3230
# Build job
3331
build:
3432
runs-on: ubuntu-24.04
35-
env:
36-
HUGO_VERSION: 0.115.4
3733
steps:
3834
- uses: actions/checkout@v4
3935
with:
40-
fetch-tags: 'true'
36+
persist-credentials: false
37+
fetch-tags: "true"
4138
fetch-depth: 0
42-
- name: Set up JDK
43-
uses: actions/setup-java@v4
39+
- uses: jdx/mise-action@c94f0bf9e520b150e34c017db785461f7e71c5fb # v2.1.1
4440
with:
45-
java-version: 17
46-
distribution: temurin
47-
cache: 'maven'
48-
- name: Set release version
49-
run: ./scripts/set-release-version-github-pages.sh
50-
- name: Install Hugo CLI
51-
run: |
52-
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
53-
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
54-
- name: Make Javadoc
55-
run: ./mvnw -B clean compile javadoc:javadoc javadoc:aggregate -P javadoc
56-
- name: Move the Javadoc to docs/static/api/
57-
run: mv ./target/reports/apidocs ./docs/static/api && echo && echo 'ls ./docs/static/api' && ls ./docs/static/api
41+
cache: "false"
5842
- name: Setup Pages
5943
id: pages
6044
uses: actions/configure-pages@v5
61-
- name: Install Node.js dependencies
62-
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
63-
working-directory: ./docs
64-
- name: Build with Hugo
45+
- name: Build GitHub Pages
46+
run: mise run build-gh-pages
6547
env:
66-
# For maximum backward compatibility with Hugo modules
67-
HUGO_ENVIRONMENT: production
68-
HUGO_ENV: production
69-
run: |
70-
hugo \
71-
--gc \
72-
--minify \
73-
--baseURL "${{ steps.pages.outputs.base_url }}/"
74-
working-directory: ./docs
75-
- name: ls ./docs/public/api
76-
run: echo 'ls ./docs/public/api' && ls ./docs/public/api
48+
BASE_URL: "${{ steps.pages.outputs.base_url }}/"
7749
- name: Upload artifact
7850
uses: actions/upload-pages-artifact@v3
7951
with:
8052
path: ./docs/public
53+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
8154

8255
# Deployment job
8356
deploy:
57+
permissions:
58+
contents: read
59+
pages: write
60+
id-token: write
8461
environment:
8562
name: github-pages
8663
url: ${{ steps.deployment.outputs.page_url }}

.github/workflows/lint-rest.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Lint What Super Linter Can't
3+
4+
on: [pull_request]
5+
6+
permissions: {}
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-24.04
11+
steps:
12+
- name: Check out
13+
with:
14+
persist-credentials: false
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
- uses: jdx/mise-action@c94f0bf9e520b150e34c017db785461f7e71c5fb # v2.1.1
17+
- name: Lint
18+
run: mise run lint-rest

.github/workflows/native-tests.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1+
---
12
name: GraalVM Native Tests
23

3-
on:
4-
push:
5-
branches: [ "main" ]
6-
pull_request:
7-
branches: [ "main" ]
4+
on: [pull_request]
5+
6+
permissions: {}
87

98
jobs:
109
native-tests:
1110
runs-on: ubuntu-24.04
1211
steps:
13-
- uses: actions/checkout@v4
14-
- name: Set up JDK
15-
uses: actions/setup-java@v4
12+
- name: Check out
1613
with:
17-
java-version: '21'
18-
distribution: graalvm
19-
cache: 'maven'
20-
- name: Run the Maven verify phase
21-
run: ./scripts/run-native-tests.sh
14+
persist-credentials: false
15+
uses: actions/checkout@v4
16+
- uses: jdx/mise-action@c94f0bf9e520b150e34c017db785461f7e71c5fb # v2.1.1
17+
- name: Run native tests
18+
run: mise run native-test

.github/workflows/release.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Deploy to Maven Central
23

34
on:
@@ -9,32 +10,36 @@ jobs:
910
deploy:
1011
if: ${{ github.repository == 'prometheus/client_java' }}
1112
runs-on: ubuntu-24.04
13+
permissions: {}
1214

1315
steps:
14-
- name: Debug gpg key - remove after debugging
16+
- name: Debug gpg key
1517
env:
16-
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
18+
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
1719
run: |
18-
echo "$GPG_SIGNING_KEY" | wc -c
19-
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
2022
- name: Checkout Plugin Repository
2123
uses: actions/checkout@v4
24+
with:
25+
persist-credentials: false
2226

2327
- name: Set Up JDK
2428
uses: actions/setup-java@v4
2529
with:
2630
java-version: 17
2731
distribution: temurin
28-
cache: 'maven'
2932

3033
- name: Build with Maven
31-
run: ./scripts/build-release.sh ${{ github.ref_name }}
34+
run: ./scripts/build-release.sh
35+
env:
36+
TAG: ${{ github.ref_name }}
3237

3338
- name: Set up Apache Maven Central
3439
uses: actions/setup-java@v4
3540
with:
36-
distribution: 'temurin'
37-
java-version: '17'
41+
distribution: "temurin"
42+
java-version: "17"
3843
server-id: ossrh
3944
server-username: MAVEN_USERNAME
4045
server-password: MAVEN_CENTRAL_TOKEN

.github/workflows/super-linter.yml

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

0 commit comments

Comments
 (0)