Skip to content

Commit 6815a6a

Browse files
committed
Merge remote-tracking branch 'upstream/main' into copilot-code-review-test
2 parents e713084 + fae2551 commit 6815a6a

File tree

11 files changed

+72
-94
lines changed

11 files changed

+72
-94
lines changed

.github/renovate.json5

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,5 +202,15 @@
202202
depNameTemplate: 'java',
203203
extractVersionTemplate: '^(?<version>\\d+)',
204204
},
205+
{
206+
customType: 'regex',
207+
datasourceTemplate: 'github-releases',
208+
managerFilePatterns: [
209+
'**/build.gradle.kts',
210+
],
211+
matchStrings: [
212+
'"https://github.com/(?<depName>[^/]+/[^/]+)/zipball/(?<currentValue>.+?)"',
213+
],
214+
},
205215
],
206216
}

.github/workflows/build-common.yml

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,25 @@ permissions:
1818
contents: read
1919

2020
jobs:
21+
spotless:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
25+
26+
- name: Set up JDK for running Gradle
27+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
28+
with:
29+
distribution: temurin
30+
java-version: 17
31+
32+
- name: Set up Gradle
33+
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
34+
with:
35+
cache-read-only: ${{ inputs.cache-read-only }}
36+
37+
- name: Spotless
38+
run: ./gradlew spotlessCheck ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
39+
2140
build:
2241
runs-on: ubuntu-latest
2342
steps:
@@ -29,13 +48,13 @@ jobs:
2948
distribution: temurin
3049
java-version: 17
3150

32-
- name: Set up gradle
51+
- name: Set up Gradle
3352
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
3453
with:
3554
cache-read-only: ${{ inputs.cache-read-only }}
3655

37-
- name: Gradle build and test
38-
run: ./gradlew build -x test ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
56+
- name: Build
57+
run: ./gradlew build -x spotlessCheck -x test ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
3958

4059
test:
4160
name: Test
@@ -44,8 +63,6 @@ jobs:
4463
fail-fast: false
4564
matrix:
4665
os:
47-
- macos-latest
48-
- macos-13
4966
- ubuntu-latest
5067
- windows-latest
5168
test-java-version:
@@ -54,18 +71,6 @@ jobs:
5471
- 17
5572
- 21
5673
- 24 # renovate: datasource=java-version
57-
# macos-latest drops support for java 8 temurin. Run java 8 on macos-13. Run java 11, 17, 21 on macos-latest.
58-
exclude:
59-
- os: macos-latest
60-
test-java-version: 8
61-
- os: macos-13
62-
test-java-version: 11
63-
- os: macos-13
64-
test-java-version: 17
65-
- os: macos-13
66-
test-java-version: 21
67-
- os: macos-13
68-
test-java-version: 24 # renovate: datasource=java-version
6974
steps:
7075
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
7176

@@ -83,12 +88,12 @@ jobs:
8388
distribution: temurin
8489
java-version: 17
8590

86-
- name: Set up gradle
91+
- name: Set up Gradle
8792
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
8893
with:
8994
cache-read-only: ${{ inputs.cache-read-only }}
9095

91-
- name: Gradle test
96+
- name: Test
9297
run: >
9398
./gradlew test
9499
"-PtestJavaVersion=${{ matrix.test-java-version }}"
@@ -97,6 +102,10 @@ jobs:
97102
"-PmaxTestRetries=${{ inputs.max-test-retries }}"
98103
${{ inputs.no-build-cache && '--no-build-cache' || '' }}
99104
105+
- name: Build scan
106+
if: ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}
107+
run: cat build-scan.txt
108+
100109
integration-test:
101110
runs-on: ubuntu-latest
102111
steps:
@@ -108,14 +117,18 @@ jobs:
108117
distribution: temurin
109118
java-version: 17
110119

111-
- name: Set up gradle
120+
- name: Set up Gradle
112121
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
113122
with:
114123
cache-read-only: ${{ inputs.cache-read-only }}
115124

116125
- name: Integration test
117126
run: ./gradlew integrationTest "-PmaxTestRetries=${{ inputs.max-test-retries }}" ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
118127

128+
- name: Build scan
129+
if: ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}
130+
run: cat build-scan.txt
131+
119132
- name: Save integration test results
120133
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
121134
if: always()

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
needs:
2222
- common
2323
runs-on: ubuntu-latest
24+
# skipping release branches because the versions in those branches are not snapshots
25+
if: github.ref_name == 'main' && github.repository == 'open-telemetry/opentelemetry-java-contrib'
2426
steps:
2527
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2628

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: CodeQL
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
- release/*
84
pull_request:
95
branches:
106
- main
@@ -15,6 +11,10 @@ on:
1511
# - https://github.com/github/codeql-action/issues/1537
1612
# - https://github.com/github/codeql-action/issues/2691
1713
# merge_group:
14+
push:
15+
branches:
16+
- main
17+
- release/*
1818
schedule:
1919
- cron: "29 13 * * 2" # weekly at 13:29 UTC on Tuesday
2020

.github/workflows/release.yml

Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -11,59 +11,15 @@ permissions:
1111
contents: read
1212

1313
jobs:
14-
build:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
18-
19-
- name: Set up JDK for running Gradle
20-
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
21-
with:
22-
distribution: temurin
23-
java-version: 17
24-
25-
- name: Set up gradle
26-
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
27-
- name: Gradle build
28-
run: ./gradlew build
29-
30-
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
31-
name: Save unit test results
32-
if: always()
33-
with:
34-
name: test-results
35-
path: jmx-metrics/build/reports/tests/test
36-
37-
integration-test:
38-
runs-on: ubuntu-latest
39-
steps:
40-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
41-
42-
- name: Set up JDK for running Gradle
43-
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
44-
with:
45-
distribution: temurin
46-
java-version: 17
47-
48-
- name: Set up gradle
49-
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
50-
- name: Integration test
51-
run: ./gradlew integrationTest
52-
53-
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
54-
name: Save integration test results
55-
if: always()
56-
with:
57-
name: integration-test-results
58-
path: jmx-metrics/build/reports/tests/integrationTest
14+
common:
15+
uses: ./.github/workflows/build-common.yml
5916

6017
release:
6118
permissions:
6219
contents: write # for creating the release
6320
runs-on: ubuntu-latest
6421
needs:
65-
- build
66-
- integration-test
22+
- common
6723
outputs:
6824
version: ${{ steps.create-github-release.outputs.version }}
6925
steps:

dependencyManagement/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
}
44

55
val otelInstrumentationVersion = "2.19.0-alpha"
6-
val semconvVersion = "1.34.0"
6+
val semconvVersion = "1.37.0"
77

88
javaPlatform {
99
allowDependencies()

jmx-metrics/src/integrationTest/java/io/opentelemetry/contrib/jmxmetrics/target_systems/KafkaIntegrationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected KafkaIntegrationTest(String configName) {
4444

4545
@Container
4646
GenericContainer<?> kafka =
47-
new GenericContainer<>("bitnami/kafka:2.8.1")
47+
new GenericContainer<>("bitnamilegacy/kafka:2.8.1")
4848
.withNetwork(Network.SHARED)
4949
.withEnv("KAFKA_CFG_ZOOKEEPER_CONNECT", "zookeeper:2181")
5050
.withEnv("ALLOW_PLAINTEXT_LISTENER", "yes")
@@ -80,7 +80,7 @@ public Set<Startable> getDependencies() {
8080
};
8181

8282
protected GenericContainer<?> kafkaProducerContainer() {
83-
return new GenericContainer<>("bitnami/kafka:2.8.1")
83+
return new GenericContainer<>("bitnamilegacy/kafka:2.8.1")
8484
.withNetwork(Network.SHARED)
8585
.withEnv("KAFKA_CFG_ZOOKEEPER_CONNECT", "zookeeper:2181")
8686
.withEnv("ALLOW_PLAINTEXT_LISTENER", "yes")
@@ -207,7 +207,7 @@ static class KafkaConsumerIntegrationTest extends KafkaIntegrationTest {
207207

208208
@Container
209209
GenericContainer<?> consumer =
210-
new GenericContainer<>("bitnami/kafka:2.8.1")
210+
new GenericContainer<>("bitnamilegacy/kafka:2.8.1")
211211
.withNetwork(Network.SHARED)
212212
.withEnv("KAFKA_CFG_ZOOKEEPER_CONNECT", "zookeeper:2181")
213213
.withEnv("ALLOW_PLAINTEXT_LISTENER", "yes")

jmx-scraper/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,18 @@ This is an alternative to the [JMX Gatherer](../jmx-metrics/README.md) utility.
99
## Release
1010

1111
This project is released as part of the [OpenTelemetry Java Contrib](https://github.com/open-telemetry/opentelemetry-java-contrib) project.
12-
The latest release is available from [Maven Central](https://central.sonatype.com/artifact/io.opentelemetry.contrib/opentelemetry-jmx-scraper)
13-
or can be browsed via [MVN Repository](https://mvnrepository.com/artifact/io.opentelemetry.contrib/opentelemetry-jmx-scraper).
12+
The latest release is available from:
13+
14+
- [GitHub Release assets](https://github.com/open-telemetry/opentelemetry-java-contrib/releases/latest/download/opentelemetry-jmx-scraper.jar)
15+
- [Maven Central](https://central.sonatype.com/artifact/io.opentelemetry.contrib/opentelemetry-jmx-scraper) or can be browsed via [MVN Repository](https://mvnrepository.com/artifact/io.opentelemetry.contrib/opentelemetry-jmx-scraper).
1416

1517
## Usage
1618

1719
The general command to invoke JMX scraper is `java -jar scraper.jar <config>`, where `scraper.jar`
18-
is the `build/libs/opentelemetry-jmx-scraper-<version>.jar` packaged binary when building this module.
20+
is the packaged binary:
21+
22+
- `build/libs/opentelemetry-jmx-scraper-<version>.jar` when building from sources
23+
- `.jar` file downloaded from Maven central or Release assets
1924

2025
Minimal configuration required
2126

jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper/target_systems/kafka/KafkaContainerFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
public class KafkaContainerFactory {
1313
private static final int KAFKA_PORT = 9092;
1414
private static final String KAFKA_BROKER = "kafka:" + KAFKA_PORT;
15-
private static final String KAFKA_DOCKER_IMAGE = "bitnami/kafka:2.8.1";
15+
private static final String KAFKA_DOCKER_IMAGE = "bitnamilegacy/kafka:2.8.1";
1616

1717
private KafkaContainerFactory() {}
1818

opamp-client/build.gradle.kts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import de.undercouch.gradle.tasks.download.DownloadExtension
2-
import java.net.HttpURLConnection
3-
import java.net.URL
42

53
plugins {
64
id("otel.java-conventions")
@@ -53,19 +51,7 @@ abstract class DownloadOpampProtos @Inject constructor(
5351

5452
@TaskAction
5553
fun execute() {
56-
// Get the latest release tag by following the redirect from GitHub's latest release URL
57-
val latestReleaseUrl = "https://github.com/open-telemetry/opamp-spec/releases/latest"
58-
val connection = URL(latestReleaseUrl).openConnection() as HttpURLConnection
59-
connection.instanceFollowRedirects = false
60-
connection.requestMethod = "HEAD"
61-
62-
val redirectLocation = connection.getHeaderField("Location")
63-
connection.disconnect()
64-
65-
// Extract tag from URL like: https://github.com/open-telemetry/opamp-spec/releases/tag/v0.12.0
66-
val latestTag = redirectLocation.substringAfterLast("/")
67-
// Download the source code for the latest release
68-
val zipUrl = "https://github.com/open-telemetry/opamp-spec/zipball/$latestTag"
54+
val zipUrl = "https://github.com/open-telemetry/opamp-spec/zipball/v0.14.0"
6955

7056
download.run {
7157
src(zipUrl)

0 commit comments

Comments
 (0)