Skip to content

Commit 89911ae

Browse files
zeitlingerjaydeluca
authored andcommitted
test: validate Micrometer typed-descriptor compatibility (#2123)
Draft validation PR for the downstream opt-in path. Depends on #2114 for the typed descriptor implementation. This branch is stacked on the #2114 head, so once #2114 lands this PR should shrink to only the Micrometer opt-in compatibility tooling. This validates Micrometer using the new descriptor API, defaulting to: - `MICROMETER_REPOSITORY=zeitlinger/micrometer` - `MICROMETER_REF=feat/prometheus-client-opt-in` That Micrometer branch provides `MetricFamilyDescriptor` metadata from the Prometheus registry without invoking scrape/sample callbacks during registration. Local validation: - `mise run lint` - `MICROMETER_DIR=/tmp/micrometer-compat-optin mise run micrometer:test` --------- Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com> Signed-off-by: Jay DeLuca <jaydeluca4@gmail.com>
1 parent bde8f67 commit 89911ae

3 files changed

Lines changed: 52 additions & 13 deletions

File tree

.github/renovate-tracked-deps.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@
5858
},
5959
".github/workflows/micrometer-compatibility.yml": {
6060
"regex": [
61-
"mise"
61+
"micrometer-metrics/micrometer",
62+
"mise",
63+
"zeitlinger/micrometer"
6264
]
6365
},
6466
".github/workflows/native-tests.yml": {

.github/renovate.json5

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,21 @@
7777
"<!-- renovate: datasource=(?<datasource>[a-z-]+?) packageName=(?<packageName>.+?) -->\\s*<api\\.diff\\.baseline\\.version>(?<currentValue>[^<]+)</api\\.diff\\.baseline\\.version>"
7878
]
7979
},
80+
{
81+
customType: "regex",
82+
description: "track the latest Micrometer release for upstream compatibility",
83+
managerFilePatterns: ["/^\\.github\\/workflows\\/micrometer-compatibility\\.yml$/"],
84+
matchStrings: [
85+
"# renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+) packageName=(?<packageName>\\S+)\\n\\s*ref:\\s*(?<currentValue>v[0-9][^\\s]*)",
86+
],
87+
},
88+
{
89+
customType: "regex",
90+
description: "pin the Micrometer typed-descriptor compatibility ref",
91+
managerFilePatterns: ["/^\\.github\\/workflows\\/micrometer-compatibility\\.yml$/"],
92+
matchStrings: [
93+
"# renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+) packageName=(?<packageName>\\S+) currentValue=(?<currentValue>\\S+)\\n\\s*ref:\\s*(?<currentDigest>[a-f0-9]{40})",
94+
],
95+
},
8096
],
8197
}

.github/workflows/micrometer-compatibility.yml

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,30 @@ name: Micrometer Compatibility
44
on:
55
pull_request:
66
workflow_dispatch:
7-
inputs:
8-
micrometer-repository:
9-
description: Micrometer repository to test, in owner/name form
10-
required: false
11-
default: micrometer-metrics/micrometer
12-
micrometer-ref:
13-
description: Micrometer branch, tag, or commit to test
14-
required: true
157

168
permissions: {}
179

1810
jobs:
19-
micrometer-compatibility:
11+
compat-test:
12+
name: ${{ matrix.name }}
2013
runs-on: ubuntu-24.04
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
include:
18+
- name: upstream
19+
repository: micrometer-metrics/micrometer
20+
# renovate: datasource=github-releases depName=micrometer-metrics/micrometer packageName=micrometer-metrics/micrometer
21+
ref: v1.16.5
22+
- name: typed-descriptor
23+
# TODO: remove this temporary opt-in leg once Micrometer switches the
24+
# Prometheus client integration to typed descriptors by default.
25+
# Follow-up: https://github.com/prometheus/client_java/issues/2182
26+
repository: zeitlinger/micrometer
27+
# renovate: datasource=git-refs depName=zeitlinger/micrometer packageName=https://github.com/zeitlinger/micrometer currentValue=feat/prometheus-client-opt-in
28+
ref: 1af1b3185058941eea57dc467bfe0df5a4786fe4
2129
steps:
22-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
30+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2331
with:
2432
persist-credentials: false
2533
- uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4.0.1
@@ -35,6 +43,19 @@ jobs:
3543
- name: Run Micrometer compatibility tests
3644
working-directory: .mise/envs/micrometer
3745
env:
38-
MICROMETER_REPOSITORY: ${{ inputs.micrometer-repository || 'micrometer-metrics/micrometer' }}
39-
MICROMETER_REF: ${{ inputs.micrometer-ref }}
46+
MICROMETER_REPOSITORY: ${{ matrix.repository }}
47+
MICROMETER_REF: ${{ matrix.ref }}
4048
run: mise compat-test
49+
50+
micrometer-compatibility:
51+
name: micrometer-compatibility
52+
runs-on: ubuntu-24.04
53+
needs: compat-test
54+
if: always()
55+
steps:
56+
- name: Aggregate matrix results
57+
run: |
58+
if [[ "${{ needs.compat-test.result }}" != "success" ]]; then
59+
echo "compat-test matrix failed: ${{ needs.compat-test.result }}"
60+
exit 1
61+
fi

0 commit comments

Comments
 (0)